Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControl ¶ added in v0.10.4
type AccessControl struct {
// contains filtered or unexported fields
}
AccessControl middleware to restrict to make POST/PUT/DELETE requests by admin only
func NewAccessControl ¶ added in v0.10.4
func NewAccessControl(audience, userIDClaim string, isUserAdmin IsUserAdminFunc) *AccessControl
NewAccessControl instance constructor
type AuthMiddleware ¶ added in v0.15.0
type AuthMiddleware struct {
// contains filtered or unexported fields
}
AuthMiddleware middleware to verify personal access tokens (PAT) and JWT tokens
func NewAuthMiddleware ¶ added in v0.15.0
func NewAuthMiddleware(getAccountFromPAT GetAccountFromPATFunc, validateAndParseToken ValidateAndParseTokenFunc, markPATUsed MarkPATUsedFunc, audience string) *AuthMiddleware
NewAuthMiddleware instance constructor
func (*AuthMiddleware) CheckJWTFromRequest ¶ added in v0.15.0
func (m *AuthMiddleware) CheckJWTFromRequest(w http.ResponseWriter, r *http.Request) error
CheckJWTFromRequest checks if the JWT is valid
func (*AuthMiddleware) CheckPATFromRequest ¶ added in v0.15.0
func (m *AuthMiddleware) CheckPATFromRequest(w http.ResponseWriter, r *http.Request) error
CheckPATFromRequest checks if the PAT is valid
type GetAccountFromPATFunc ¶ added in v0.15.0
type GetAccountFromPATFunc func(token string) (*server.Account, *server.User, *server.PersonalAccessToken, error)
GetAccountFromPATFunc function
type IsUserAdminFunc ¶ added in v0.6.0
type IsUserAdminFunc func(claims jwtclaims.AuthorizationClaims) (bool, error)
type MarkPATUsedFunc ¶ added in v0.15.0
MarkPATUsedFunc function
Click to show internal directories.
Click to hide internal directories.