authenticator

package
v0.0.0-...-5f6b46d Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: MPL-2.0, MPL-2.0 Imports: 7 Imported by: 0

README

Overview

While forwarwarding traffic between systems, Proctor can facilitate the role of an authentication broker.

authentication

An Authenticator plugin is an independant natively compiled binary that exposes an API over net/rpc. This allows us to generecise any given authentication mechanism using a plug-in model and enables its reuse across different applications and environments.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HandshakeConfig is prevents users from executing bad plugins
	// from the command line and be launched as a plugin only.
	// It is a UX feature, not a security feature.
	HandshakeConfig = plugin.HandshakeConfig{
		ProtocolVersion:  1,
		MagicCookieKey:   "BASIC_PLUGIN",
		MagicCookieValue: "hello",
	}
)

Functions

func LaunchPlugin

func LaunchPlugin(authenticator Authenticator, name string)

LaunchPlugin launches a plugin

Types

type Authenticator

type Authenticator interface {
	//Authenticate(interface{}) map[string]string
	Authenticate(map[string]string) map[string]string
}

Authenticator is the interface exposed as a plugin

func DispenseAuthenticator

func DispenseAuthenticator(pluginPath string, level hclog.Level) (Authenticator, *plugin.Client)

DispenseAuthenticator loads an Authenticator plug-in into memory

type AuthenticatorPlugin

type AuthenticatorPlugin struct {
	// Impl injection
	Impl Authenticator
}

AuthenticatorPlugin has two methods: Server must return an RPC server for this plugin type. We construct a AuthenticatorRPCServer for this.

Client must return an implementation of our interface that communicates over an RPC client. We return AuthenticatorRPC for this.

func (AuthenticatorPlugin) Client

func (AuthenticatorPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

Client is the RPC client that communicated with the RPC server

func (*AuthenticatorPlugin) Server

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

Server is the RPC server that serves the Authenticator Plugin

type AuthenticatorRPC

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

AuthenticatorRPC is an Authenticator implementation that talks over RPC

func (*AuthenticatorRPC) Authenticate

func (a *AuthenticatorRPC) Authenticate(dataIn map[string]string) (dataOut map[string]string)

Authenticate will call the Authenticate method of the plugin

type AuthenticatorRPCServer

type AuthenticatorRPCServer struct {
	//This is the real implementation
	Impl Authenticator
}

AuthenticatorRPCServer is the RPC server that AuthenticatorRPC talks to, conforming to net/rpc reqjuirements

func (*AuthenticatorRPCServer) Authenticate

func (s *AuthenticatorRPCServer) Authenticate(args map[string]string, resp *map[string]string) error

Authenticate ... func (s *AuthenticatorRPCServer) Authenticate(args interface{}, resp *map[string]string) error {

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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