Documentation ¶
Index ¶
- Constants
- Variables
- func GetUserID(ctx context.Context) uuid.UUID
- func IsAuthError(err error) bool
- func NewAuthError(format string, args ...any) error
- func SetClaims(ctx context.Context, claims Claims) context.Context
- func SetUserID(ctx context.Context, userID uuid.UUID) context.Context
- type Auth
- type Claims
- type Config
- type KeyLookup
Constants ¶
View Source
const ( RuleAuthenticate = "auth" RuleAny = "ruleAny" RuleAdminOnly = "ruleAdminOnly" RuleUserOnly = "ruleUserOnly" RuleAdminOrSubject = "ruleAdminOrSubject" )
These the current set of rules we have for auth.
Variables ¶
View Source
var ErrForbidden = errors.New("attempted action is not allowed")
Functions ¶
func IsAuthError ¶
IsAuthError checks if an error of type AuthError exists.
func NewAuthError ¶
NewAuthError creates an AuthError for the provided message.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) Authenticate ¶
Authenticate processes the token to validate the sender's token is valid.
Click to show internal directories.
Click to hide internal directories.