contember/contember

generateReadUrl ignores project prefix

Closed this issue · 2 comments

generateReadUrl probably ignores project prefix in presign. Experiencing on 1.2.0-rc.4

mutation {
	generateReadUrl(
		objectKey: "project-group/project/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.jpeg"
		expiration: 3600
	) {
		url
	}
}

generates

https://contember-prod-eu-data.s3.eu-west-1.amazonaws.com/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=XXXXXXXXXXXXXXXXXXX%2F20230220%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20230220T143903Z&X-Amz-Expires=3600&X-Amz-Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&X-Amz-SignedHeaders=host

it probably is missing project-group/project/ prefix and should be:

https://contember-prod-eu-data.s3.eu-west-1.amazonaws.com/project-group/project/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=XXXXXXXXXXXXXXXXXXX%2F20230220%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20230220T143903Z&X-Amz-Expires=3600&X-Amz-Signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&X-Amz-SignedHeaders=host

Hi @ViliamKopecky thanks for reporting! We quickly looked at it and looks like a bug, good catch! We'll look into it more next week and should be able to release fix for this.

@ViliamKopecky Thanks again for reporting. It's fixed now with #377 and the 1.2.0-rc.5 version also contains this fix and is already running on Contember Cloud.