feat(ui): add identity management for tenants and users
CI / build-and-test (push) Successful in 1m47s

* Implement tenant and user creation in IdentityPage
* Add API calls for managing tenants and users
* Introduce tenant-scoped API requests
* Update sidebar to include identity navigation
* Create BooleanStatusBadge component for key status
This commit is contained in:
2026-07-20 22:50:55 +02:00
parent 3d4e6d0939
commit 196b543bee
64 changed files with 3363 additions and 615 deletions
+20
View File
@@ -36,6 +36,26 @@ func TestNewKeyringAndLookup(t *testing.T) {
}
}
func TestConfiguredKeyUsesTenantID(t *testing.T) {
keyring, err := NewKeyring([]config.APIKey{{ID: "agent-key", Value: "secret", TenantID: "acme"}})
if err != nil {
t.Fatalf("NewKeyring() error = %v", err)
}
if got := keyring.TenantForKey("agent-key"); got != "acme" {
t.Fatalf("TenantForKey() = %q, want acme", got)
}
}
func TestConfiguredKeySuperadmin(t *testing.T) {
keyring, err := NewKeyring([]config.APIKey{{ID: "operator", Value: "secret", Superadmin: true}})
if err != nil {
t.Fatalf("NewKeyring() error = %v", err)
}
if !keyring.IsSuperadmin("operator") || keyring.IsSuperadmin("missing") {
t.Fatal("IsSuperadmin() did not return the configured role")
}
}
func TestMiddlewareAllowsHeaderAuthAndSetsContext(t *testing.T) {
keyring, err := NewKeyring([]config.APIKey{{ID: "client-a", Value: "secret"}})
if err != nil {