auth

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidClaims = errors.New("invalid claims")

Functions

func NewSession

func NewSession(subject string, secret string, issuer string, audience protocol.ID, duration time.Duration) (*models.Session, error)

func NewToken

func NewToken(id string, subject string, expiry time.Time, scope Scope, secret string, issuer string, audience string) (string, error)

Types

type Scope

type Scope string
const (
	Access  Scope = "access"
	Refresh Scope = "refresh"
)

type TextileClaims

type TextileClaims struct {
	Scope Scope `json:"scopes"`
	jwt.StandardClaims
}

func ParseClaims

func ParseClaims(claims jwt.Claims) (*TextileClaims, error)

Jump to

Keyboard shortcuts

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