lib

package
v0.0.0-...-7dfa8bc Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2016 License: AGPL-3.0 Imports: 3 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromTokenContext

func FromTokenContext(ctx context.Context) (string, bool)

func MustFromTokenContext

func MustFromTokenContext(ctx context.Context) string

func NewContext

func NewContext(ctx context.Context, idt *Identity) context.Context

NewContext returns a new Context carrying an Identity pat.

func NewTokenContext

func NewTokenContext(ctx context.Context, token string) context.Context

Types

type Identity

type Identity struct {
	Pid         string `json:"pid"`
	Idp         string `json:"idp"`
	Email       string `json:"email"`
	DisplayName string `json:"email"`
}

func FromContext

func FromContext(ctx context.Context) (*Identity, bool)

FromContext extracts the Identity pat from ctx, if present.

func MustFromContext

func MustFromContext(ctx context.Context) *Identity

MustFromContext extracts the identity from ctx. If not present it panics.

func ParseToken

func ParseToken(t, secret string) (*Identity, error)

func (*Identity) String

func (i *Identity) String() string

Jump to

Keyboard shortcuts

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