Publish curated Unraid-AppOps-Gateway source from 034c9f844d2455850ba37b31379b7edaa786583e
This commit is contained in:
1 parent
c61fbfd87f
commit
1a54836efc
101 files changed
+4973
-1298
No files matched your search
@@ -46,10 +46,8 @@ def init_db() -> None:
|
||||
if changed:
|
||||
session.commit()
|
||||
from ..services.setup_service import apply_stored_connector_settings
|
||||
from ..services.runtime_service import apply_stored_operator_auth_setting
|
||||
|
||||
apply_stored_connector_settings(session)
|
||||
apply_stored_operator_auth_setting(session)
|
||||
_ensure_notification_suppression_index()
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,44 @@ from sqlmodel import Column, Field, SQLModel
|
||||
from ..core.time import utc_now
|
||||
|
||||
|
||||
class GatewayUser(SQLModel, table=True):
|
||||
__tablename__ = "gateway_users"
|
||||
id: str = Field(primary_key=True)
|
||||
provider: str
|
||||
issuer: str
|
||||
subject: str
|
||||
email: str = ""
|
||||
display_name: str = ""
|
||||
role: str = "read_only"
|
||||
enabled: bool = True
|
||||
permissions: list[str] = Field(default_factory=list, sa_column=Column(JSON))
|
||||
created_at: datetime = Field(default_factory=utc_now)
|
||||
last_login: datetime = Field(default_factory=utc_now)
|
||||
|
||||
|
||||
class UserSession(SQLModel, table=True):
|
||||
__tablename__ = "user_sessions"
|
||||
id: str = Field(primary_key=True) # SHA-256 of the opaque cookie, never the cookie itself.
|
||||
user_id: str = Field(index=True)
|
||||
expires_at: int = Field(index=True)
|
||||
|
||||
|
||||
class LoginFlow(SQLModel, table=True):
|
||||
__tablename__ = "login_flows"
|
||||
id: str = Field(primary_key=True)
|
||||
provider: str
|
||||
browser_hash: str
|
||||
nonce: str
|
||||
verifier: str
|
||||
expires_at: int = Field(index=True)
|
||||
|
||||
|
||||
class BootstrapGrant(SQLModel, table=True):
|
||||
__tablename__ = "user_bootstrap_grants"
|
||||
id: str = Field(primary_key=True)
|
||||
user_id: str
|
||||
|
||||
|
||||
class App(SQLModel, table=True):
|
||||
id: str = Field(primary_key=True)
|
||||
name: str
|
||||
|
||||
Reference in new issue
Block a user