Documentation
¶
Index ¶
- func ClaimsKey() any
- func ExtractTenant(api huma.API) func(huma.Context, func(huma.Context))
- func JWT(api huma.API, secret string) func(huma.Context, func(huma.Context))
- func MetricsMW(ctx huma.Context, next func(huma.Context))
- func RBAC(enf *casbin.Enforcer, resolve RoleResolver) func(huma.Context, func(huma.Context))
- func UserFromContext(ctx context.Context) string
- func UserKey() any
- type RoleResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTenant ¶
claimsKey is the context key used by the auth middleware to store JWT claims. This mirrors the implementation there so that this middleware can read them. ExtractTenant obtains the tenant ID from the X-Tenant-ID header or JWT claim "tid". A missing tenant results in 400.
func UserFromContext ¶
UserFromContext returns the user subject stored in the context.
Types ¶
Click to show internal directories.
Click to hide internal directories.