Documentation
¶
Index ¶
- Constants
- Variables
- func NewHashId(id string) string
- func NewHashSeed(id string) int64
- func NewRandomID() string
- func RequireActorWithClaims[T Actor](ctx Context, opts ...ActorClaimValidator) (parsedActor T, err error)
- func VerifyActorClaims(ctx Context, opts ...ActorClaimValidator) error
- type Actor
- type ActorClaimValidator
- type Context
- type Error
- type ErrorOpt
- type PublicError
Constants ¶
View Source
const (
TypeActorServer = "backend"
)
Variables ¶
View Source
var ( ErrNoUserActor = errors.New("actor is not a user actor") ErrNotAuthenticated = errors.New("actor is not authenticated") ErrNoPermission = errors.New("actor does not have permission") ErrAuthenticated = errors.New("actor is authenticated") ErrInvalidActorType = errors.New("actor does not fullfill the required type") )
View Source
var (
ErrorNotAuthorized = errors.New("not authorized")
)
Functions ¶
func NewHashSeed ¶
func NewRandomID ¶
func NewRandomID() string
func RequireActorWithClaims ¶
func RequireActorWithClaims[T Actor](ctx Context, opts ...ActorClaimValidator) (parsedActor T, err error)
func VerifyActorClaims ¶
func VerifyActorClaims(ctx Context, opts ...ActorClaimValidator) error
Types ¶
type ActorClaimValidator ¶
func IsActorOfType ¶
func IsActorOfType(interfaceName string) ActorClaimValidator
func IsServer ¶
func IsServer() ActorClaimValidator
func OfType ¶
func OfType(requiredType string) ActorClaimValidator
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) PublicError ¶
PublicError returns the public error message If no public message is set, it returns the inner error message If no inner error is set, it returns "unknown error"
func (*Error) StatusCode ¶
type ErrorOpt ¶
type ErrorOpt = func(e *Error)
func WithPublicResponse ¶
Sets the public message and status code
type PublicError ¶
Click to show internal directories.
Click to hide internal directories.