refresh

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2016 License: Apache-2.0 Imports: 4 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

View Source
const (
	DefaultRefreshTokenPayloadLength = 64
	TokenDelimer                     = "/"
)

Variables

View Source
var (
	ErrorInvalidUserID   = errors.New("invalid user ID")
	ErrorInvalidClientID = errors.New("invalid client ID")

	ErrorInvalidToken = errors.New("invalid token")
)

Functions

func DefaultRefreshTokenGenerator

func DefaultRefreshTokenGenerator() ([]byte, error)

Types

type RefreshTokenGenerator

type RefreshTokenGenerator func() ([]byte, error)

func (RefreshTokenGenerator) Generate

func (g RefreshTokenGenerator) Generate() ([]byte, error)

type RefreshTokenRepo

type RefreshTokenRepo interface {
	// Create generates and returns a new refresh token for the given client-user pair.
	// The scopes will be stored with the refresh token, and used to verify
	// against future OIDC refresh requests' scopes.
	// On success the token will be returned.
	Create(userID, clientID, connectorID string, scope []string) (string, error)

	// Verify verifies that a token belongs to the client.
	// It returns the user ID to which the token belongs, and the scopes stored
	// with token.
	Verify(clientID, token string) (userID, connectorID string, scope scope.Scopes, err error)

	// Revoke deletes the refresh token if the token belongs to the given userID.
	Revoke(userID, token string) error

	// Revoke old refresh token and generates a new one
	RenewRefreshToken(clientID, userID, oldToken string) (newRefreshToken string, err error)

	// RevokeTokensForClient revokes all tokens issued for the userID for the provided client.
	RevokeTokensForClient(userID, clientID string) error

	// ClientsWithRefreshTokens returns a list of all clients the user has an outstanding client with.
	ClientsWithRefreshTokens(userID string) ([]client.Client, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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