19 lines
449 B
Go
19 lines
449 B
Go
package port
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// AuthUser represents a validated user from the auth service.
|
|
type AuthUser struct {
|
|
UserID string `json:"user_id"`
|
|
Email string `json:"email,omitempty"`
|
|
Roles []string `json:"roles,omitempty"`
|
|
Scopes []string `json:"scopes,omitempty"`
|
|
}
|
|
|
|
// AuthValidator validates tokens against the auth service.
|
|
type AuthValidator interface {
|
|
ValidateToken(ctx context.Context, token string) (*AuthUser, error)
|
|
}
|