You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2021/08/10 17:11:17 UTC
[airavata-data-lake] branch master updated: Removing bearer token
part and validating the token
This is an automated email from the ASF dual-hosted git repository.
dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-data-lake.git
The following commit(s) were added to refs/heads/master by this push:
new 499dfe9 Removing bearer token part and validating the token
499dfe9 is described below
commit 499dfe9471d038e65d33f0a310fc181cd0c38ce4
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Tue Aug 10 13:11:09 2021 -0400
Removing bearer token part and validating the token
---
.../orchestrator/handlers/mft/MFTRequestHandler.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/data-orchestrator/data-orchestrator-service/data-orchestrator-api-server/src/main/java/org/apache/airavata/datalake/orchestrator/handlers/mft/MFTRequestHandler.java b/data-orchestrator/data-orchestrator-service/data-orchestrator-api-server/src/main/java/org/apache/airavata/datalake/orchestrator/handlers/mft/MFTRequestHandler.java
index 20045c1..d3aab79 100644
--- a/data-orchestrator/data-orchestrator-service/data-orchestrator-api-server/src/main/java/org/apache/airavata/datalake/orchestrator/handlers/mft/MFTRequestHandler.java
+++ b/data-orchestrator/data-orchestrator-service/data-orchestrator-api-server/src/main/java/org/apache/airavata/datalake/orchestrator/handlers/mft/MFTRequestHandler.java
@@ -59,6 +59,19 @@ public class MFTRequestHandler {
@PathVariable String resourceid) throws Exception {
logger.info("MFT download request to resource {}", resourceid);
+
+ if (authTokenStr!= null || authTokenStr.isEmpty()) {
+ logger.error("Auth token can not be null");
+ throw new Exception("Auth token can not be null");
+ }
+
+ if (!authTokenStr.startsWith("Bearer")) {
+ logger.error("No bearer token provided");
+ throw new Exception("No bearer token provided");
+ }
+
+ authTokenStr = authTokenStr.substring(7).trim();
+
MFTApiServiceGrpc.MFTApiServiceBlockingStub mftClient = MFTApiClient.buildClient(mftHost, mftPort);
ManagedChannel channel = ManagedChannelBuilder.forAddress(drmsHost, drmsPort).usePlaintext().build();