auth

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	// CreateAccessToken create a new token.
	// The identity of this token, which can be any data that is json serializable.
	CreateAccessToken(identity interface{}, fresh bool) (string, error)

	// CreateRefreshToken create a new refresh token.
	// The identity of this token, which can be any data that is json serializable.
	CreateRefreshToken(identity interface{}) (string, error)

	// ParseToken parse a token.
	ParseToken(token string) (Claims, error)
}

Auth is the interface for authentication.

type Claims

type Claims interface {
	// GetIdentity return the identity of this token, which can be any data that is json serializable.
	GetIdentity() interface{}

	// HasExpired returns true if the claims have expired.
	HasExpired() bool
}

Claims is the interface for all the claims that can be made by the auth package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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