Open-EO / openeo-web-editor

An interactive and easy to use web-based editor for the OpenEO API.
https://editor.openeo.org
Apache License 2.0
12 stars 17 forks source link

Editor sends authorization header for signed URLs resulting in error messages #263

Closed dthiex closed 2 years ago

dthiex commented 2 years ago

The editor is adding the Authorization header (using the user token) to the request when fetching the data. Amazon (S3) doesn't like that, as the presigned url already has authorization in itself.

Please check if the Authorization header could be left away in such cases.

Error message:

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidArgument</Code><Message>Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified</Message><ArgumentName>Authorization</ArgumentName><ArgumentValue>Bearer basic//eyJraWQiOiJzaCIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI2MTYyN2NiNC0zZDFjLTRjMmQtYWZmOS1hOTBlN2RlZTUxZmQiLCJhdWQiOiJmYjhkMWJjYS1iZTUyLTQxZWMtYjhiMC05OWJiMzU2MDg1NzgiLCJqdGkiOiJiMTBiMTM1OS1hZDc5LTQyZDItOGEzZC1mNGRhMmExNWMyOGMiLCJleHAiOjE2NTQ2MTE2MDQsIm5hbWUiOiJNaWhhIEthZHVuYyIsImVtYWlsIjoibWloYS5rYWR1bmMrb3BlbmVvQHNpbmVyZ2lzZS5jb20iLCJnaXZlbl9uYW1lIjoiTWloYSIsImZhbWlseV9uYW1lIjoiS2FkdW5jIiwic2lkIjoiYzlhOTBlOTYtMmZjYi00ZTY3LTliN2ItNGU3YmY0NzRmNzljIiwib3JnIjoiYTUyY2U2ZGEtMjI5MC00N2MyLTg0YjEtNWZkNTg5ZGFhYzI1IiwiZGlkIjoxLCJhaWQiOiIzZDkwYzBjNi1iNWRlLTQ3ODMtYmE0OC0xYmVmNmQxNDgzZjciLCJkIjp7IjEiOnsicmEiOnsicmFnIjo3LCJyYSI6eyJidGMiOjF9fSwidCI6MTQwMDB9fX0.ZK6N13UHxv8NCyfIGM0Dw1NYyucSSp00Bl5OxnK96SOO4oIT91x4NXU-58p6yiZQWNOAsoWTq2jSdz04DoNCPrQho4625ePlbHb3i0-AvxaQgS_K1MO8oCG-x9Conx_Z-ayN1jOtAKaWZeRCNp92YJpjHLV4D_3RV-4KyX9e4M1sCOZKYFbqJs8LdBDnDXZfbjGoFv7UwKsb65hRCcLONZzYHgKpVyJ6Ro7MEyveIb3AHtzMksfPXl8T6XddVdsWq_vbaQrHsDypDimIBwkbq-2BDhuAh1YBS-b-Sq-IfKU9GihnsH4xdtcx3TB_X8hBVz_bpezkLWUQMnvTi1JEnA</ArgumentValue><RequestId>RFJ0AJBCTD060YQS</RequestId><HostId>rlVEzO3chTR+c246AcAvDHZDKainHJdfZbmi52KYtvIcQkL9r9Bkn6pnvObmGXrTYkx4nI3pwps=</HostId></Error>
m-mohr commented 2 years ago

Is this for fetching the metadata or for the COG?

m-mohr commented 2 years ago

It was the data and I've committed a quick fix. Can you check whether it works for you on editor.openeo.org? @dthiex Then I can also deploy it at editor.openeo.cloud.

dthiex commented 2 years ago

Yes, the quick fix worked.

Small potential improvement idea: open by default the map view and not the metadata view in the visual panel. I would suspect most people are initially more interested in the map view.

image

m-mohr commented 2 years ago

Yes, I'm planning to not open the metadata at all. Have you asset roles assigned ("data" / "metadata")? Otherwise, I can't filter it.

dthiex commented 2 years ago

Have you asset roles assigned ("data" / "metadata")?

Not yet but created an internal issue for it and will be added.

dthiex commented 2 years ago

We add roles now to our batch job results, so I am closing this issue as the original thing was already solved. For the don't open metadata I created a new issue: https://github.com/Open-EO/openeo-web-editor/issues/265