Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/edc credentials null error #144

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions api/endpoints/members.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,26 +643,18 @@ def get(self, endpoint_uri):
if maap_user is None:
return Response('Unauthorized', status=status.HTTP_401_UNAUTHORIZED)
else:
edc_response = get_edc_credentials(endpoint_uri=endpoint_uri, user_id=maap_user.id)
json_response = get_edc_credentials(endpoint_uri=endpoint_uri, user_id=maap_user.id)

try:
edc_response_json = json.loads(edc_response)
response = jsonify(
accessKeyId=edc_response_json['accessKeyId'],
secretAccessKey=edc_response_json['secretAccessKey'],
sessionToken=edc_response_json['sessionToken'],
expiration=edc_response_json['expiration']
)
response = jsonify(
accessKeyId=json_response['accessKeyId'],
secretAccessKey=json_response['secretAccessKey'],
sessionToken=json_response['sessionToken'],
expiration=json_response['expiration']
)

response.headers.add('Access-Control-Allow-Origin', '*')
response.headers.add('Access-Control-Allow-Origin', '*')

return response

except ValueError as ex:
response_body = dict()
response_body["code"] = status.HTTP_500_INTERNAL_SERVER_ERROR
response_body["message"] = edc_response.decode("utf-8")
return response_body, status.HTTP_500_INTERNAL_SERVER_ERROR
return response


@ns.route('/self/awsAccess/workspaceBucket')
Expand Down Expand Up @@ -793,4 +785,4 @@ def get_edc_credentials(endpoint_uri, user_id):
else:
edl_response = edl_federated_request(url=endpoint)

return edl_response.content
return json.loads(edl_response.content)
bsatoriu marked this conversation as resolved.
Show resolved Hide resolved