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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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