feat(ui): add identity management for tenants and users
CI / build-and-test (push) Successful in 1m47s
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user