sp4-v2-1770499323/services/chat-svc/internal/port/auth.go
rdev-worker 34f37a44b8
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
build: /implement-feature mesh-interop --requirements 'Chat Service must cal...
2026-02-07 21:49:45 +00:00

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)
}