login

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 Challenge

type Challenge struct {

	// Description is a description of the challenge.
	Description string `json:"description" mapstructure:"description" yaml:"description"`

	// Name is the name of the challenge.
	Name string `json:"name" mapstructure:"name" yaml:"name"`

	// Sensitive indicates whether the response to the challenge is sensitive.
	Sensitive bool `json:"sensitive" mapstructure:"sensitive" yaml:"sensitive"`

	// Validator is a regex for validating the response to the challenge.
	Validator string `json:"validator" mapstructure:"validator" yaml:"validator"`
}

Challenge represents an authentication challenge.

type Challenges

type Challenges struct {

	// Value defines the challenge values if error is not nil.
	Value []Challenge

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

Challenges represents a challenges response.

type Client

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

Client implements the RPC client for login plugins.

func (*Client) Authenticate

func (c *Client) Authenticate(responses []Response, subjects [][]string) Subject

Authenticate calls the plugin's authenticate method and returns authentication response.

func (*Client) Challenges

func (c *Client) Challenges() Challenges

Challenges calls the plugin's challenge method and returns the challenges response.

func (*Client) Configure

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

Configure calls the plugin's configure method and configures the plugin returns 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 login plugins.

func (*Plugin) Server

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

Server returns an RPC server for login plugins.

type Provider

type Provider interface {

	// Authenticate authenticates the responses and verified subjects then returns the subject.
	Authenticate([]Response, [][]string) Subject

	// Challenges returns the challenges for this provider.
	Challenges() Challenges

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

Provider defines the interface for login providers.

type Response

type Response struct {

	// Name is the name of the challenge.
	Name string `json:"name" mapstructure:"name" yaml:"name"`

	// Value is the value of the response.
	Value string `json:"value" mapstructure:"value" yaml:"value"`
}

Response represents an authentication response.

type Server

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

Server represents the RPC server for login provider plugins, according to the net/rpc requirements.

func (*Server) Authenticate

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

Authenticate authenticates the responses and context then returns the subject or an error

func (*Server) Challenges

func (s *Server) Challenges(args interface{}, response *Challenges) error

Challenges returns the challenges for this provider

func (*Server) Configure

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

Configure configures the login provider or returns an error

type Subject

type Subject struct {

	// Value is the authenticated subject if error is not nil.
	Value string

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

Subject represents an authentication response.

Jump to

Keyboard shortcuts

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