repo

package
v0.0.0-...-998df39 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSessionDuration = time.Hour

Functions

This section is empty.

Types

type Client

type Client struct {
	Users    *UserStore
	Sessions *SessionStore
	JWKs     *JWKStore
	// contains filtered or unexported fields
}

func NewClient

func NewClient(table string, ddb dynamodbiface.DynamoDBAPI) *Client

type JWKS

type JWKS struct {
	Keys []json.RawMessage `json:"keys"`
}

type JWKStore

type JWKStore store

func (*JWKStore) FetchLatestKID

func (s *JWKStore) FetchLatestKID(ctx context.Context, region string) (string, error)

func (*JWKStore) List

func (s *JWKStore) List(ctx context.Context) (*JWKS, error)

type Session

type Session struct {
	ID       string    `json:"jti"`
	UserID   string    `json:"sub"`
	Created  time.Time `json:"iat"`
	Expires  time.Time `json:"exp"`
	Issuer   string    `json:"iss"`
	Audience string    `json:"aud"`
	Scopes   []string  `json:"scopes,omitempty"`
	Nonce    string    `json:"-"`
}

type SessionStore

type SessionStore store

func (*SessionStore) Create

func (s *SessionStore) Create(ctx context.Context, sess *Session) error

type UserStore

type UserStore store

func (*UserStore) CreateFromWebID

func (s *UserStore) CreateFromWebID(ctx context.Context, wid WebID) (string, error)

func (*UserStore) IDFromWebID

func (s *UserStore) IDFromWebID(ctx context.Context, wid WebID) (string, error)

type WebID

type WebID struct {
	Issuer, Subject string
	Created         time.Time
}

func (WebID) CanonicalKey

func (w WebID) CanonicalKey() string

Jump to

Keyboard shortcuts

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