Commit 7aeaf1e1 authored by Komal Makkar's avatar Komal Makkar
Browse files

skipping authz as it is deeply coupled with partition information and pubsub...

skipping authz as it is deeply coupled with partition information and pubsub handshake request doesn't carry that.
parent 18538477
Pipeline #17792 failed with stages
in 51 seconds
......@@ -50,6 +50,10 @@ public class AuthorizationFilter {
if (StringUtils.isBlank(dpsHeaders.getAuthorization()))
throw new AppException(302, "Redirect", "No credentials sent on request.");
if(requestInfoExt.skipAuthorize()) {
return true;
}
if (StringUtils.isBlank(dpsHeaders.getPartitionId())) {
requestInfoExt.assignPartitionIdIfNotInHeader();
}
......
......@@ -56,7 +56,7 @@ public class RequestInfoExt extends RequestInfo {
}
public void assignPartitionIdIfNotInHeader() {
if (!this.httpRequest.getMethod().equalsIgnoreCase("POST")) {
if ((!this.httpRequest.getMethod().equalsIgnoreCase("POST"))) {
return;
}
......@@ -68,4 +68,9 @@ public class RequestInfoExt extends RequestInfo {
headers.put(DpsHeaders.DATA_PARTITION_ID, tenant);
}
}
// This is in response to issue: https://community.opengroup.org/osdu/platform/system/notification/-/issues/16
public boolean skipAuthorize() {
return requestBodyExtractor.isHandshakeRequest();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment