jose

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CognitoClaim

type CognitoClaim struct {
	TokenUse string `json:"token_use"`
	Scope    string `json:"scope"`
	ClientID string `json:"client_id"`
	Version  int    `json:"version"`
}

CognitoClaim defines a JWT Claim for tokens issued by the AWS Cognito Service

type Config

type Config struct {
	JSONWebKeySetURL string // JSON Web Key Set (JWKS) URL for JSON Web Token (JWT) Verification
	ValidIssuer      string // URL of the JWT Issuer for this environment
}

Config contains configuration for the JOSE package

func (Config) NewJOSE

func (c Config) NewJOSE() (JOSE, error)

NewJOSE creates and returns a JOSE client for use.

func (*Config) RegisterFlags

func (c *Config) RegisterFlags(flags *pflag.FlagSet)

RegisterFlags registers JOSE flags with pflags

type JOSE

type JOSE struct {
	// contains filtered or unexported fields
}

JOSE contains configuration for handling JWTs, JWKS, and other JOSE specifications

func (JOSE) ParseValidateJWT

func (j JOSE) ParseValidateJWT(input string, claims ...interface{}) error

ParseValidateJWT accepts a string containing a JWT token and attempts to parse and validate the token. If you wish to inspect other components of the payload, you may supply one or more claims structs which will be populated if the JWT is valid. Claims must be structs with json fields that match the keys in the payload field, or a map[string]interface{}. Use of map[string]interface{} is strongly discouraged.

Jump to

Keyboard shortcuts

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