Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin implements the plugin interface for token 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 ¶
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
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.