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

Support runtime injection of origin #281

Open
HHK1 opened this issue Oct 8, 2020 · 1 comment · May be fixed by #282
Open

Support runtime injection of origin #281

HHK1 opened this issue Oct 8, 2020 · 1 comment · May be fixed by #282

Comments

@HHK1
Copy link

HHK1 commented Oct 8, 2020

Current behaviour

Right now, the origins that are allowed are passed during the wrapping of the app. They are static and cannot be injected dynamically.

Desired behaviour

My use case is the following: I'm exchanging an http-only session cookie against a JWT on a centralized auth server. The front client is a SPA hosted on a lot of different domains. I need to set allow-credentials to True, and need an actual whitelist.
I can't inject the full list of domains during the app creation: it's too large, and I want to be able to add some in a database without having to reload the flask app.

I'd like to have a hook where I have access to the request headers, and return what should be injected in the Allow-Origin response header. That way I can compare the origin against my dynamic whitelist, and return the origin only if it's a match.

@HHK1
Copy link
Author

HHK1 commented Oct 9, 2020

Actually this has been implemented in #268 ! Would love to have this merged @corydolphin 🙏

@HHK1 HHK1 linked a pull request Oct 20, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant