Conversation
implemented This is a copy of danieldeer#15 which became very outdated due to the new and improved structure of the codebase It might be a good idea to not let just anyone hit the endpoints as they please. This adds a very simple working template for how a future, more robust authentication system might look. - If you don't want you use any authentication at all, just toggle the `require_auth` flag in `auth.py` to false. If you do want authentication, toggle it to true. - You'll need to set an `auth_token` in a `.env` (this PR comes with an example of that) - In the request, use the `Autorization` header with the typical `Bearer <token>` pattern If the token is not correct or the usage is not correct, you'll receive a `401 Unauthorized` response. Otherwise the endpoints will respond with what they usually do. This is just a working POC and does not cover all the use cases that might be needed. I would be glad to continue working on a more finished and functional version of authentication, but I figured it might me best to create a POC before venturing too deep
mattsva
reviewed
Sep 13, 2026
Collaborator
|
Isnt this "just a working POC". So this shouldnt be a Open PR in my opinion. It does have conflicts and is just a POC so its not open for a merge at this point. |
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.
Foreword
This is a copy of #15 modified to fit the new and improved structure of the codebase
Authorization
It might be a good idea to not let just anyone hit the endpoints as they please. This adds a very simple working template for how a future, more robust authentication system might look.
Usage
require_authflag inauth.pyto false. If you do want authentication, toggle it to true.auth_tokenin a.env(this PR comes with an example of that)Autorizationheader with the typicalBearer <token>patternIf the token is not correct or the usage is not correct, you'll receive a
401 Unauthorizedresponse. Otherwise the endpoints will respond with what they usually do.NOTE
This is just a working POC and does not cover all the use cases that might be needed. I would be glad to continue working on a more finished and functional version of authentication, but I figured it might be best to create a POC before venturing too deep