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

Require client to specify HTTP methods for pre-signed URLs #161

Closed

Conversation

Laonel
Copy link
Member

@Laonel Laonel commented Oct 30, 2024

When generating pre-signed URLs on HEAD requests is enabled, require additional request header X-Trino-Pre-Signed-Url-Methods which determines for which HTTP methods pre-signed URLs are generated.

When generating pre-signed URLs on HEAD requests is enabled, require
additional request header `X-Trino-Pre-Signed-Url-Methods` which
determines for which HTTP methods pre-signed URLs are generated.
@cla-bot cla-bot bot added the cla-signed label Oct 30, 2024
@Laonel Laonel requested a review from Randgalt October 30, 2024 13:39
.flatMap(httpMethod -> buildPresignedRemoteUrl(httpMethod, signingMetadata, request, targetRequestTimestamp, remoteUri, signatureExpiry))
.collect(toImmutableMap(Map.Entry::getKey, Map.Entry::getValue));
}

private Set<String> getPresignedUrlRequestedMethods(ParsedS3Request request)
{
Set<String> requestedMethods = request.requestHeaders().unmodifiedHeaders().get(PRESIGNED_URL_METHODS_HEADER_NAME).stream()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PresignAwareAmazonS3 and PresignAwareS3Client need to be updated with this new header.

@Laonel Laonel closed this Oct 31, 2024
@Laonel Laonel deleted the patryk/main/presigned-methods-header branch October 31, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants