github.com/goadesign/goa/examples/chatter
chatter
import "github.com/goadesign/goa/examples/chatter"
Overview
Index
- Variables
- func ChatterBasicAuth(ctx context.Context, user, pass string, s *security.BasicScheme) (context.Context, error)
- func ChatterJWTAuth(ctx context.Context, token string, s *security.JWTScheme) (context.Context, error)
- func NewChatter(logger *log.Logger) chattersvc.Service
Package files
Variables
var (
// ErrUnauthorized is the error returned by Login when the request credentials
// are invalid.
ErrUnauthorized error = chattersvc.Unauthorized("invalid username and password combination")
// ErrInvalidToken is the error returned when the JWT token is invalid.
ErrInvalidToken error = chattersvc.Unauthorized("invalid token")
// ErrInvalidScopes is the error returned when the scopes provided in
// the JWT token claims are invalid.
ErrInvalidTokenScopes error = chattersvc.InvalidScopes("invalid scopes in token")
// Key is the key used in JWT authentication
Key = []byte("secret")
)
func ChatterBasicAuth
func ChatterBasicAuth(ctx context.Context, user, pass string, s *security.BasicScheme) (context.Context, error)
ChatterBasicAuth implements the authorization logic for service “chatter” for the “basic” security scheme.
func ChatterJWTAuth
func ChatterJWTAuth(ctx context.Context, token string, s *security.JWTScheme) (context.Context, error)
ChatterJWTAuth implements the authorization logic for service “chatter” for the “jwt” security scheme.
func NewChatter
func NewChatter(logger *log.Logger) chattersvc.Service
NewChatter returns the chatter service implementation.
Generated by godoc2md