backend

package
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2017 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package backend implements the backend of the token server of API v0.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RefreshRequiresRenew

func RefreshRequiresRenew(claim jwt.Claim) bool

RefreshRequiresRenew returns a bool telling the refresh token is required to renew.

Types

type Backend

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

Backend is a structure to hold the context of the token backend.

func New

func New() (Backend, error)

New returns a new backend.Backend.

func (Backend) Authenticate

func (backend Backend) Authenticate(token string) (jwt.Claim, jwt.Error)

Authenticate returns a claim authenticated with the given access token.

func (Backend) AuthenticateMail

func (backend Backend) AuthenticateMail(token string) (jwt.Claim, jwt.Error)

AuthenticateMail returns a claim authenticated with the given token embedded in an email.

func (Backend) AuthenticateRefresh

func (backend Backend) AuthenticateRefresh(token string) (jwt.Claim, jwt.Error)

AuthenticateRefresh returns a claim authenticated with the given refresh token.

func (Backend) IssueAccess

func (backend Backend) IssueAccess(sub, scope string) (string, error)

IssueAccess returns an access token.

func (Backend) IssueMail

func (backend Backend) IssueMail(sub string) (string, error)

IssueMail returns a token to embed in an email.

func (Backend) IssueRefresh

func (backend Backend) IssueRefresh(sub, scope string) (string, error)

IssueRefresh returns a refresh token.

func (Backend) IssueTmpUserAccess

func (backend Backend) IssueTmpUserAccess(sub string) (string, error)

IssueTmpUserAccess returns an access token which is valid until the user fills his information, including credentials.

Jump to

Keyboard shortcuts

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