keychain

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package keychain manages the validation and processing of jwt tokens

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInvalidKey is returned when a public key is invalid
	ErrInvalidKey = errors.New("invalid public key")
)

Functions

func ImportKeys added in v1.3.0

func ImportKeys(keyData []byte) error

ImportKeys import keys in the standard jwks json format

func ImportKeysFromURL added in v1.3.0

func ImportKeysFromURL(jwksURL string) error

ImportKeysFromURL will fetch and import the public keys from the specified url

func ValidateToken

func ValidateToken(tokenString string, scopes ...[]string) (cloud.AuthToken, error)

ValidateToken validates a jwt token

Types

type AuthToken added in v1.3.2

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

AuthToken is an JWT AuthToken

func (*AuthToken) Claims added in v1.3.2

func (t *AuthToken) Claims() cloud.Claims

Claims returns the underlying claims

func (*AuthToken) ClientID added in v1.3.2

func (t *AuthToken) ClientID() string

ClientID returns the token client id

func (*AuthToken) ExpiresAt added in v1.3.2

func (t *AuthToken) ExpiresAt() int64

ExpiresAt returns the epoch for the token expiration

func (*AuthToken) ID added in v1.3.2

func (t *AuthToken) ID() string

ID returns the token id

func (*AuthToken) Scope added in v1.3.2

func (t *AuthToken) Scope() []string

Scope returns the token scope

func (*AuthToken) String added in v1.3.2

func (t *AuthToken) String() string

String returns the string value of the token

func (*AuthToken) Use added in v1.3.2

func (t *AuthToken) Use() string

Use returns the token usage

func (*AuthToken) Username added in v1.3.2

func (t *AuthToken) Username() string

Username returns the user for the tokem

Jump to

Keyboard shortcuts

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