pokearu commented on a change in pull request #6:
URL: https://github.com/apache/airavata-mft/pull/6#discussion_r412749232
##########
File path:
services/secret-service/server/src/main/java/org/apache/airavata/mft/secret/server/backend/file/FileBasedSecretBackend.java
##########
@@ -211,4 +213,57 @@ public boolean updateAzureSecret(AzureSecretUpdateRequest
request) throws Except
public boolean deleteAzureSecret(AzureSecretDeleteRequest request) throws
Exception {
throw new UnsupportedOperationException("Operation is not supported in
backend");
}
+
+ @Override
+ public Optional<GCSSecret> getGCSSecret(GCSSecretGetRequest request)
throws Exception {
+ JSONParser jsonParser = new JSONParser();
+ InputStream inputStream =
FileBasedSecretBackend.class.getClassLoader().getResourceAsStream(secretFile);
+
+ try (InputStreamReader reader = new InputStreamReader(inputStream)) {
+ Object obj = jsonParser.parse(reader);
+ JSONArray resourceList = (JSONArray) obj;
+
+ List<GCSSecret> gcsSecrets = (List<GCSSecret>)
resourceList.stream()
+ .filter(resource -> "GCS".equals(((JSONObject)
resource).get("type").toString()))
+ .map(resource -> {
+ JSONObject r = (JSONObject) resource;
+ StringBuilder contentBuilder = new StringBuilder();
+ BufferedReader br = null;
+ String jsonContents = "";
+ try {
+ br = new BufferedReader(new
FileReader(r.get("jsonCredentialsFilePath").toString()));
Review comment:
We read from the file path only in the SecretService. The agent no
longer requires the file to be accessible, we assume the file is available with
the SecretService.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]