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:
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/uptrace/bunrouter"
|
||||
|
||||
"git.warky.dev/wdevs/amcs/internal/store"
|
||||
"git.warky.dev/wdevs/amcs/internal/tenancy"
|
||||
)
|
||||
|
||||
func registerResolveSpecAdminRoutes(mux *http.ServeMux, db *store.DB, middleware func(http.Handler) http.Handler, logger *slog.Logger) error {
|
||||
@@ -45,7 +46,12 @@ func registerResolveSpecAdminRoutes(mux *http.ServeMux, db *store.DB, middleware
|
||||
rsMount.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
middleware(rsMount).ServeHTTP(w, r)
|
||||
middleware(http.HandlerFunc(func(w http.ResponseWriter, authenticated *http.Request) {
|
||||
if tenantID := strings.TrimSpace(authenticated.Header.Get("X-AMCS-Tenant-ID")); tenantID != "" {
|
||||
authenticated = authenticated.WithContext(tenancy.WithTenantKey(authenticated.Context(), tenantID))
|
||||
}
|
||||
rsMount.ServeHTTP(w, authenticated)
|
||||
})).ServeHTTP(w, r)
|
||||
})
|
||||
|
||||
mux.Handle("/api/rs/", protectedRSMount)
|
||||
|
||||
Reference in New Issue
Block a user