Skip to content

feat(auth-template): A very simple template of how auth could be implemented - #69

Closed
Airbag65 wants to merge 3 commits into
danieldeer:developmentfrom
Airbag65:feat/auth-template
Closed

Airbag65 wants to merge 3 commits into
danieldeer:developmentfrom
Airbag65:feat/auth-template

Conversation

@Airbag65

@Airbag65 Airbag65 commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

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

  • 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.

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

Airbag65 and others added 2 commits September 13, 2026 16:54
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
Comment thread .env.example Outdated
@AnnoDomine
AnnoDomine changed the base branch from main to development September 19, 2026 08:11
@mattsva
mattsva marked this pull request as draft September 19, 2026 16:53
@mattsva

mattsva commented Sep 19, 2026

Copy link
Copy Markdown
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.

@danieldeer
danieldeer deleted the branch danieldeer:development September 20, 2026 08:23
@danieldeer danieldeer closed this Sep 20, 2026
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 this pull request may close these issues.

3 participants