token

package
v0.0.0-...-b83c349 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(provider Provider)

Serve starts the provider as a plugin and blocks indefinitely.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements the RPC client for token plugins.

func (*Client) Configure

func (c *Client) Configure(configuration map[string]interface{}) plugin.BasicError

Configure configures the provider or returns an error.

func (*Client) Token

func (c *Client) Token(subject string, scopes []string) Token

Token returns a token (i.e., a set of claims) for the provided subject and scopes or an error.

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin implements the plugin interface for token plugins.

func (*Plugin) Client

func (p *Plugin) Client(broker *plugin.MuxBroker, client *rpc.Client) (interface{}, error)

Client returns an RPC client for token plugins.

func (*Plugin) Server

func (p *Plugin) Server(broker *plugin.MuxBroker) (interface{}, error)

Server returns an RPC server for token plugins.

type Provider

type Provider interface {

	// Configure configures the provider or returns an error.
	Configure(config map[string]interface{}) plugin.BasicError

	// Token returns a token (i.e., a set of claims) for the provided subject and scopes.
	Token(subject string, scopes []string) Token
}

Provider defines the interface for token providers.

Token providers convert a subject and a set of scopes into a token (i.e., a set of claims). The token will be used to identify the user or system making the request and any associated attributes.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server implements the RPC server for token plugins.

func (*Server) Configure

func (s *Server) Configure(args map[string]interface{}, response *plugin.BasicError) error

Configure configures the provider or returns an error.

func (*Server) Token

func (s *Server) Token(args map[string]interface{}, response *Token) error

Token returns a token (i.e., a set of claims) for the provided args (i.e., a subject and scopes) or an error.

type Token

type Token struct {

	// Value is the token or nil if error is not nil.
	Value map[string]interface{}

	// Error captures the error raised if any.
	Error plugin.BasicError
}

Token represents an token response.

Jump to

Keyboard shortcuts

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