authentication

package
v0.0.0-...-8567bd0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Overview

Package authentication defines interfaces for coordinator and communication server authentication

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientAuthenticator

type ClientAuthenticator interface {
	GenerateClientAuthMessage() (*protocol.AuthMessage, error)
	GenerateClientConnectURL(coordinatorURL string) (string, error)
}

ClientAuthenticator is the client authentication mechanism, used for simulation only

type CoordinatorAuthenticator

type CoordinatorAuthenticator interface {
	AuthenticateFromURL(role protocol.Role, r *http.Request) (bool, error)
}

CoordinatorAuthenticator is the coordinator authentication mechanism

type NoopAuthenticator

type NoopAuthenticator struct{}

NoopAuthenticator is a Server|Coordinator|Client authenticator that does nothing

func (*NoopAuthenticator) AuthenticateFromMessage

func (a *NoopAuthenticator) AuthenticateFromMessage(role protocol.Role, bytes []byte) (bool, []byte, error)

AuthenticateFromMessage always return true

func (*NoopAuthenticator) AuthenticateFromURL

func (a *NoopAuthenticator) AuthenticateFromURL(role protocol.Role, r *http.Request) (bool, error)

AuthenticateFromURL always return true

func (*NoopAuthenticator) GenerateClientAuthMessage

func (a *NoopAuthenticator) GenerateClientAuthMessage() (*protocol.AuthMessage, error)

GenerateClientAuthMessage generates client empty auth message

func (*NoopAuthenticator) GenerateClientConnectURL

func (a *NoopAuthenticator) GenerateClientConnectURL(coordinatorURL string) (string, error)

GenerateClientConnectURL generates CoordinatorURL with no parameters

func (*NoopAuthenticator) GenerateServerAuthMessage

func (a *NoopAuthenticator) GenerateServerAuthMessage() (*protocol.AuthMessage, error)

GenerateServerAuthMessage generates server empty auth message

func (*NoopAuthenticator) GenerateServerConnectURL

func (a *NoopAuthenticator) GenerateServerConnectURL(coordinatorURL string, role protocol.Role) (string, error)

GenerateServerConnectURL generates CoordinatorURL with no parameters

type ServerAuthenticator

type ServerAuthenticator interface {
	AuthenticateFromMessage(role protocol.Role, bytes []byte) (bool, []byte, error)
	GenerateServerAuthMessage() (*protocol.AuthMessage, error)
	GenerateServerConnectURL(coordinatorURL string, role protocol.Role) (string, error)
}

ServerAuthenticator is the communication server authentication mechanism

Jump to

Keyboard shortcuts

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