Squashed commit of the following:

commit a6a5de4a35
Author: ahtlon <git@ahtlon.de>
Date:   Fri May 15 20:47:45 2026 +0200

    Auth working :)

commit 6ad50df3c2
Author: ahtlon <git@ahtlon.de>
Date:   Fri May 8 13:17:32 2026 +0200

    Implement auth
    I basically copied this article https://fastapi.tiangolo.com/tutorial/security/oauth2-jwt

commit 6243618abb
Author: ahtlon <git@ahtlon.de>
Date:   Fri May 8 12:18:56 2026 +0200

    Add auth deps
This commit is contained in:
2026-05-15 22:01:57 +02:00
parent 2a211c2cf0
commit cbc2526c14
7 changed files with 251 additions and 8 deletions

View File

@@ -18,7 +18,7 @@ class UserCreate(UserBase):
class UserDB(UserBase, table=True):
id: int | None = Field(default=None, primary_key=True)
password: str
passwordhash: str
class UserUpdate(Base):
name: str | None = None
@@ -31,6 +31,14 @@ class AaGroupLink(Base, table=True):
group_id: int | None = Field(default=None, foreign_key="groupdb.id", primary_key=True)
accessauth_id: int | None = Field(default=None, foreign_key="accessauthorizationdb.id", primary_key=True)
#### Token
class Token(Base):
access_token: str
token_type: str
class TokenData(Base):
username: str | None = None
#### Group
class GroupBase(Base):
name: str = Field(index=True, unique=True)