Back to godoc.org

Package middleware

v0.1.73
Latest Go to latest

The latest major version is .

Published: 5 days ago | License: MIT | Module: github.com/pace/bricks

Index

type RequiredScopes

type RequiredScopes map[string]oauth2.Scope

RequiredScopes defines the scope each endpoint requires

type ScopesMiddleware

type ScopesMiddleware struct {
	RequiredScopes RequiredScopes
}

Deprecated: ScopesMiddleware contains required scopes for each endpoint - For generated APIs use the generated AuthenticationBackend with oauth2.Authorizer and set a Scope

func NewScopesMiddleware

func NewScopesMiddleware(scopes RequiredScopes) *ScopesMiddleware

Deprecated: NewScopesMiddleware return a new scopes middleware - For generated APIs use the generated AuthenticationBackend with oauth2.Authorizer and set a scope

func (*ScopesMiddleware) Handler

func (m *ScopesMiddleware) Handler(next http.Handler) http.Handler

Handler checks if the token extracted from the request's context has the required scope for the requested route and returns a 401 response if not.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier