MAAP-Project / Community

Issue for MAAP (Zenhub)
2 stars 1 forks source link

Add support for s3credentials 401 redirects #694

Closed bsatoriu closed 1 year ago

bsatoriu commented 1 year ago

A MAAP user encountered an error trying to obtain s3 temporary credentials for the ORNL DAAC using the earthdata_s3_credentials method: maap.aws.earthdata_s3_credentials('https://data.ornldaac.earthdata.nasa.gov/s3credentials')

This endpoint in the MAAP API only supports 307 responses for authorization, not 401 responses. The s3 endpoint for LP DAAC uses a 307 response for authentication, hence this call returns a successful result: maap.aws.earthdata_s3_credentials('https://data.lpdaac.earthdatacloud.nasa.gov/s3credentials')

Modify the MAAP API edcCredentials endpoint to support both 401 and 307 responses during the authorization process.

bsatoriu commented 1 year ago

The s3credentials endpoint is now updated to support both 401 and 307 redirects.

bsatoriu commented 1 year ago

Testing instructions:

On Ops ADE, both of these calls should return valid s3 credentials:

print(maap.aws.earthdata_s3_credentials('https://data.ornldaac.earthdata.nasa.gov/s3credentials'))

print(maap.aws.earthdata_s3_credentials('https://data.lpdaac.earthdatacloud.nasa.gov/s3credentials'))
gchang commented 1 year ago

chuck d. reviewed