Documentation ¶
Overview ¶
Package auth is an interface for authentication and authorization.
Index ¶
- Variables
- func ClientWrapper(a Auth) client.Wrapper
- func ContextWithToken(ctx context.Context, t *Token) context.Context
- func HandlerWrapper(a Auth) server.HandlerWrapper
- func HeaderWithToken(hd map[string]string, t *Token) map[string]string
- func NewContext(ctx context.Context, c Auth) context.Context
- type Auth
- type Option
- type Options
- type Request
- type Token
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidToken = errors.New("invalid token")
)
Functions ¶
func ClientWrapper ¶
func HandlerWrapper ¶
func HandlerWrapper(a Auth) server.HandlerWrapper
Types ¶
type Auth ¶
type Auth interface { // Check if authorised Authorized(ctx context.Context, req Request) (*Token, error) // Retrieve token from context Introspect(ctx context.Context) (*Token, error) // Revoke a token Revoke(t *Token) error // Retrieve client token Token() (*Token, error) String() string }
https://github.com/beego/social-auth Auth handles client side validation of authentication The client does not actually handle authentication itself. This could be an oauth2 provider, openid, basic auth, etc.
Click to show internal directories.
Click to hide internal directories.