8000 add /_extension to well-known path prefixes to avoid s3 fallback handling by thrau · Pull Request #11796 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

add /_extension to well-known path prefixes to avoid s3 fallback handling #11796

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

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

thrau
Copy link
Member
@thrau thrau commented Nov 6, 2024

Motivation

Over time we've made /_extension a well-known path prefix, similar to /_aws or /_localstack, which still suffers from S3 xml errors when calling URLs within the /_extension submount that don't exist. This is a band aid fix for that.

Changes

  • calls to /_extension/<path> are now no longer handled by the s3 fallback handler

@thrau thrau requested a review from bentsku November 6, 2024 19:29
@thrau thrau requested a review from alexrashed as a code owner November 6, 2024 19:29
Copy link
github-actions bot commented Nov 6, 2024

S3 Image Test Results (AMD64 / ARM64)

  2 files    2 suites   3m 45s ⏱️
423 tests 369 ✅  54 💤 0 ❌
846 runs  738 ✅ 108 💤 0 ❌

Results for commit 3f783ca.

Copy link
github-actions bot commented Nov 6, 2024

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 42m 8s ⏱️ +3s
3 534 tests ±0  3 119 ✅ ±0  415 💤 ±0  0 ❌ ±0 
3 536 runs  ±0  3 119 ✅ ±0  417 💤 ±0  0 ❌ ±0 

Results for commit 3f783ca. ± Comparison against base commit 359f45f.

@thrau thrau added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Nov 6, 2024
Copy link
Contributor
@bentsku bentsku left a comment

Choose a reason for hiding this comment

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

Ah, good catch! Looking at this, I wonder if we often have the case that we have edge routes that actually need to have the service, especially since it does not have access to the request context. I think we'd be almost ready to move the service name parser after the edge routes to be honest, as the CORS detection does not rely on the services anymore (managed for S3 and APIGW, with some heuristics).

It doesn't really change anything to this particular issue though, but it made me think that maybe we could have a way to register some base path in our edge router (similar to Flask Blueprints somehow) so that we could return some default values when hitting some base path, instead of continuing the chain and having those hardcoded rules. I can see the issues we could get with that, as it'd be maybe difficult to dynamically add routes to those "blueprints".

But yeah, maybe we should think about registering rules for those base endpoints, so that we could avoid those tricks? What do you think?

In any case, this is a good fix and good to merge! 👌

edit: also, as a nit, I think it's not really a S3 fallback handler anymore since we removed the proxy listeners, just that those requests fit the routing rules of the S3 specs which are extremely greedy 😄

@thrau thrau merged commit d5cd2dc into master Nov 6, 2024
41 of 42 checks passed
@thrau thrau deleted the add-extension-prefix branch November 6, 2024 22:05
@thrau
Copy link
Member Author
thrau commented Nov 6, 2024

all great points @bentsku! thanks for greenlighting this, while also noticing some systemic issues we're not addressing here. definitely let's rework this soon!

6E66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0