Repository navigation
Allow tenant browser origins on /v1/me - #6
Merged
Merged
Conversation
The preflight is answered by the middleware, so the streams no longer need OPTIONS routes or a CORS step per route.
A tenant's page can call its /v1/me routes directly and read every response, 401 and 403 included. Routes without a tenant in the path allow any tenant's origins.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets a tenant's page call
/v1/me/*from the browser, so ListenBrainz can show the inbox without proxying through its backend.rs/corsmiddleware, chained ahead of OAuth for both/v1/meand the streams. Responses are readable by an allowed page, 401 and 403 included, and the preflight is answered without a token.stream_origins. Routes without a tenant in the path (e.g./v1/me/channels) allow any tenant's origins.listen%62rainzcan't fall back to every tenant's origins.OPTIONSroutes.Tests:
e2e/me_cors_test.go; stream preflight test updated forrs/corsechoing the requested method and headers.