package auth import ( "context" "time" "github.com/google/uuid" ) type User struct { ID uuid.UUID `json:"id"` Username string `json:"username"` DisplayName string `json:"display_name"` IsAdmin bool `json:"is_admin"` QuotaBytes int64 `json:"quota_bytes"` UsedBytes int64 `json:"used_bytes"` // Persönliche Palette. Sie bleibt gespeichert, auch wenn UseCustomTheme // aus ist – so kann man jederzeit umschalten, ohne sie neu zu wählen. PrimaryColor string `json:"primary_color"` AccentColor string `json:"accent_color"` UseCustomTheme bool `json:"use_custom_theme"` // IsOIDC heißt: Dieses Konto meldet sich über den Identitätsanbieter an // und hat hier gar kein Passwort (`password` steht auf ''). Die Oberfläche // blendet die Passwortänderung dann aus – ein Formular, das nur // fehlschlagen kann, ist schlimmer als keines. // // Nicht sicherheitsrelevant, sondern eine Auskunft: Anmeldung und // Passwortänderung scheitern für solche Konten ohnehin schon daran, dass // '' kein gültiger Argon2-Hash ist. IsOIDC bool `json:"is_oidc"` CreatedAt time.Time `json:"created_at"` } // UsageQuerier is satisfied by files.Store – keeps auth ↔ files decoupled. type UsageQuerier interface { UsedBytes(ctx context.Context, userID uuid.UUID) (int64, error) }