Documentation ¶
Index ¶
Constants ¶
View Source
const AccountID = "accountID"
AccountID is the context key used when adding/retrieven the account ID from a gin.Context
Variables ¶
View Source
var ErrNotAuthenticated = errors.New("no authentication found")
ErrNotAuthenticated is returned if no authentication has been found
Functions ¶
func AccountFromRequest ¶
AccountFromRequest returns the account ID that is used in the request
func GetAccountID ¶
GetAccountID returns the account ID associated with a request. The request route must be annotated with RequireAuth() for the account ID to be loaded and stored in the request context
func Permission ¶
func Permission(action string, rfn ExtractResourceFunc) gin.HandlerFunc
Permission returns a middleware function that checks permissions against an authz server
func Required ¶
func Required() gin.HandlerFunc
Types ¶
type ExtractResourceFunc ¶
ExtractResourceFunc should return the target resource URN of the given request
func ConstantName ¶
func ConstantName(name string) ExtractResourceFunc
ConstantName returns an ExtractResourceFunc that always returns name
Click to show internal directories.
Click to hide internal directories.