token

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCleartextTokenParserPlugin

func NewCleartextTokenParserPlugin(key string) cleartextTokerParser

NewCleartextTokenParserPlugin return a “Cleartext“ type token parser plugin. The token parser plugin require the token from client endpoint mustn't be encrypted. The key specify the token's enctype, it can be “base64“ or a ""(null chart string).

func NewFileTokenSourcePlugin

func NewFileTokenSourcePlugin(tokenSource string) fileTokenSourcePlugin

NewFileTokenSourcePlugin return a “File“ type token source plugin. “File“ type token source plugin will read the token from a file. The tokenSource is the file path.

func NewFixedTokenPlugin

func NewFixedTokenPlugin(tokenSource string) fixedTokenSourcePlugin

NewFixedTokenPlugin return a “Fixed“ type token source plugin. “Fixed“ token source plugin will return a fixed token always, this mean that all client applications always assess same server application. The plugin directly return the value tokenSource

Types

type TokenParserPlugin

type TokenParserPlugin interface {
	// ParseToken parse the token and return the parse result
	ParseToken(token string) (string, error)
}

Used to parse token which form client endpoint

type TokenSourcePlugin

type TokenSourcePlugin interface {
	// GetToken return a token string according to the addr (client application address) parameter
	GetToken(addr string) (string, error)
}

Used to provide token to client endpoint

Jump to

Keyboard shortcuts

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