15 lines
437 B
Go
15 lines
437 B
Go
|
|
package authmw
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"code.nochebuena.dev/einherjar/contracts/security"
|
||
|
|
)
|
||
|
|
|
||
|
|
// IdentityEnricher is implemented by the application layer to load user data
|
||
|
|
// from token claims and return a populated security.Identity.
|
||
|
|
// Called once per request by EnrichmentMiddleware after token verification.
|
||
|
|
type IdentityEnricher interface {
|
||
|
|
Enrich(ctx context.Context, uid string, claims map[string]any) (security.Identity, error)
|
||
|
|
}
|