token

package
v0.5.13 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Zlib Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticate added in v0.5.9

type Authenticate interface {
	Type() string
	Create(source Source, expireSeconds int64) (Token, error)
	Decode(source Source, token string) (Token, error)
	Check(source Source, token string) (Token, error)
	IsEnabled(source Source) bool
	SetEnabled(source Source, enable bool)
}

type Engine added in v0.5.11

type Engine interface {
	Client() Route
	Server() Route
}

type Key

type Key secret.Key

type Route added in v0.5.11

type Route interface {
	Auth() Authenticate
	Use(a Authenticate) Route
	SetSourceKeyFunc(keyFunc SourceKeyFunc) Route
}

type Secret added in v0.5.11

type Secret interface {
	GetSecret(source Source) secret.Secret
	SetEnabled(source Source, enable bool)
	IsEnabled(source Source) bool
}

type Session

type Session struct {
	Uid       string `json:"uid"`
	UserToken string `json:"-"`
}

type Source added in v0.5.9

type Source struct {
	AppId  string `json:"appId"`
	Source string `json:"source"`
}

type SourceKeyFunc added in v0.5.11

type SourceKeyFunc func(source Source) string

SourceKeyFunc source to key function

type Token

type Token interface {
	WithSession(session Session) Token
	WithExtend(extend string) Token
	GetSession() Session
	GetExtend() string
	GetToken() string
	Update() (string, error)
}

Jump to

Keyboard shortcuts

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