authorize

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTokenParams

func GetTokenParams(ctx context.Context, name string) (string, bool)

GetTokenParams - return custom param

func GetUser

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

GetUser - return authorize user

func GetUserId

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

GetUserId - return authorize user id

Types

type Authorize

type Authorize struct {
	Secret     string
	Security   bool
	Params     []string
	Prefix     string
	Check      Check
	CheckBasic CheckBasic
}

func NewAuthorize

func NewAuthorize(secret string, security bool, Check Check, CheckBasic CheckBasic) *Authorize

NewAuthorize

func (*Authorize) ParseBasic

func (a *Authorize) ParseBasic(t string) (*pbauthorize.AuthorizeResponse, error)

func (*Authorize) ParseToken

func (a *Authorize) ParseToken(t string) (*pbauthorize.AuthorizeResponse, error)

ParseToken

type Check

type Check func(token string) error

type CheckBasic

type CheckBasic func(username string, password string) error

Jump to

Keyboard shortcuts

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