Files
Aether/backend/internal/auth/model.go
T
HoneyandClaude Opus 5 31a027c93a feat(aether): initial commit – self-hosted Cloud, Phasen 1–7
Go-Backend (chi, pgx, golang-migrate) + React/TS-Frontend als PWA.
Enthalten: Auth inkl. OIDC, Dateien mit Versionen und Papierkorb,
Freigaben (Links + intern), WebDAV, Gruppenordner, Admin/Theming,
Volltextsuche mit OCR, eigener PDF-Betrachter und WOPI-Office
(Collabora/OnlyOffice).

Nicht im Repo: deploy/.env (Sitzungsschlüssel, DB- und Admin-Passwort)
sowie alle Daten- und Build-Verzeichnisse – siehe .gitignore.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-24 09:25:36 +02:00

38 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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)
}