auth

package
v0.0.0-...-86e536e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JwtExtraOptionsVar = &JwtExtraOptions{}

Functions

func HasRole

func HasRole(token string, scopes []string) (*models.Principal, error)

HasRole tells if the Bearer token is a JWT signed by us with a claim to be member of an authorization scope. We verify that the claimed role is one of the passed scopes

Types

type JwtExtraOptions

type JwtExtraOptions struct {
	JwtSigningKey string `long:"jwt-signing-key" description:"Key to sign JWT tokens" env:"JWT_SIGNING_KEY" required:"true"`
	JwtVerifyKey  string `long:"jwt-verify-key" description:"Key to verify JWT tokens" env:"JWT_VERIFY_KEY" required:"true"`
	JwtIssuerName string `long:"jwt-issuer-name" description:"Issuer name for JWT tokens" env:"JWT_ISSUER_NAME" required:"true"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL