-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
admin/files: fix duplicate bucket name in presigned URLs with custom domain #19537
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
Conversation
Adds test replicating the user's issue and is added now to confirm wether this is indeed an issue and wether my fix actually works. Good, it fails. ``` FAILED authentik/admin/files/backends/tests/test_s3_backend.py::TestS3Backend::test_file_url_custom_domain_with_bucket_no_duplicate - AssertionError: 2 != 1 : Bucket name 'authentik-test-270gxfe1t2' appears 2 times in URL, expected 1. URL: https://localhost:8020/authentik-test-270gxfe1t2/authentik-test-270gxfe1t2/media/public/application-icons/test.svg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=accessKey1%2F20260117%2Fca-central-1%2Fs3%2Faws4_request&X-Amz-Date=20260117T010127Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=b24c140b41232df1d0c7d51197d6a94d59b09bcc8fbe31de54be92e34b61f65b ```
…domain
When using path-style addressing with a custom domain that includes the bucket name, the generated presigned URLs contained the bucket name twice, which is obviously not intended.
The fix strips the bucket name from the presigned URL path when path-style addressing is detected (path starts with `/{bucket}/`), since `custom_domain` must include the bucket name per configuration docs.i
A more detailed overview of the bug can be found at: #19521 (comment)
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19537 +/- ##
==========================================
+ Coverage 92.50% 93.27% +0.76%
==========================================
Files 949 949
Lines 52052 52067 +15
==========================================
+ Hits 48151 48564 +413
+ Misses 3901 3503 -398
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-14789b498f0fde1a0648af4b11e9efc951dee6a8
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-14789b498f0fde1a0648af4b11e9efc951dee6a8Afterwards, run the upgrade commands from the latest release notes. |
…lation" This reverts commit b5d0968.
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…domain (#19537) Co-authored-by: Marcelo Elizeche Landó <marcelo@goauthentik.io>
|
🍒 Cherry-pick to |
…domain (#19537) Co-authored-by: Marcelo Elizeche Landó <marcelo@goauthentik.io>
Overview:
When using path-style addressing with a custom domain that includes the bucket name, the generated presigned URLs contained the bucket name twice, which is obviously not intended.
The fix strips the bucket name from the presigned URL path when path-style addressing is detected (path starts with
/{bucket}/), sincecustom_domainmust include the bucket name per configuration docs.iA more detailed overview of the bug can be found at: #19521 (comment)
Do note that commit b5d0968 is present in this PR until #19536 is merged, so I can use the dev server and run tests locally without encountering any issues.
Motivation:
Closes: #19521