Documentation ¶
Index ¶
Constants ¶
View Source
const ( ScopeBundle string = "bundle" ScopeDecision string = "az" ScopeAdmin string = "root" EnvTknKeyDirectory string = "HEXA_TKN_DIRECTORY" EnvTknPrivateKeyFile string = "HEXA_TKN_PRIVKEYFILE" EnvTknPubKeyFile string = "HEXA_TKN_PUBKEYFILE" EnvTknJwksUrl string = "HEXA_TKN_JWKS_URL" DefTknPrivateKeyFile string = "issuer-priv.pem" DefTknPublicKeyFile string = "issuer-cert.pem" EnvTknEnforceMode string = "HEXA_TKN_MODE" EnvTknIssuer string = "HEXA_TKN_ISSUER" ModeEnforceAnonymous = "ANON" ModeEnforceBundle = "BUNDLE" ModeEnforceAll = "ALL" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JwtAuthToken ¶
type TokenHandler ¶
type TokenHandler struct { TokenIssuer string PrivateKey *rsa.PrivateKey PublicKey keyfunc.Keyfunc Authorizer *oauth2support.ResourceJwtAuthorizer KeyDir string PrivateKeyPath string PublicKeyPath string Mode string }
func GenerateIssuerKeys ¶
func GenerateIssuerKeys(name string, keepExisting bool) (*TokenHandler, error)
GenerateIssuerKeys will create a new JWT issuer private and public key set. Set keepExisting to true to enable auto-generation on first execution.
func LoadIssuer ¶
func LoadIssuer(name string) (*TokenHandler, error)
func (*TokenHandler) IssueToken ¶
func (a *TokenHandler) IssueToken(scopes []string, email string) (string, error)
func (*TokenHandler) PrivateKeyExists ¶
func (a *TokenHandler) PrivateKeyExists() bool
Click to show internal directories.
Click to hide internal directories.