service

package
v0.0.0-...-f3ca651 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextKey

type ContextKey int

ContextKey is a type used for storing values in a context

const (
	// ContextKeyUserID is the key used to store user ID in a context
	ContextKeyUserID ContextKey = iota
)

type JSONWebKey

type JSONWebKey struct {
	Alg string   `json:"alg"`
	Kty string   `json:"kty"`
	Kid string   `json:"kid"`
	Use string   `json:"use"`
	N   string   `json:"n"`
	E   string   `json:"e"`
	X5c []string `json:"x5c"`
}

JSONWebKey is a single JSON Web Key definition

func (JSONWebKey) GetCertificate

func (key JSONWebKey) GetCertificate() string

GetCertificate returns the certificate string for this JSONWebKey

type JSONWebKeySet

type JSONWebKeySet struct {
	Keys []JSONWebKey `json:"keys"`
}

JSONWebKeySet contains a list of JSON web keys

func GetKeySet

func GetKeySet(url string) (JSONWebKeySet, error)

GetKeySet retrieves public keys from a remote JWKS endpoint "https://" + os.Getenv("AUTH0_DOMAIN") + "/.well-known/jwks.json" https://auth0.com/docs/quickstart/backend/golang/01-authorization

func (JSONWebKeySet) Find

func (set JSONWebKeySet) Find(keyID string) (JSONWebKey, bool)

Find looks for a key with the given key ID token.Header["kid"]

func (JSONWebKeySet) GetRSAPublicKeys

func (set JSONWebKeySet) GetRSAPublicKeys() ([]*rsa.PublicKey, error)

GetRSAPublicKeys returns a slice of RSA public keys generated from this JWKS

type Opts

type Opts struct {
	API            *operations.FlamedbAPI
	Flame          database.Flame
	AccessKeyStore database.AccessKeyStore
	Key            *rsa.PublicKey
}

Opts used to configure the FlameDB service

type Service

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

Service implements handlers for the FlameDB service

func New

func New(opts Opts) *Service

New returns a new Service instance

Jump to

Keyboard shortcuts

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