session

package
v0.0.0-...-be0919c Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const SignaturePrefix = "MystVpnSessionId:"

SignaturePrefix is used to prefix with each session string before calculating signature or extracting identity

Variables

This section is empty.

Functions

func SignatureCredentialsProvider

func SignatureCredentialsProvider(sessionID session.ID, signer identity.Signer) func() (username string, password string, err error)

SignatureCredentialsProvider returns session id as username and id signed with given signer as password

Types

type SessionMap

type SessionMap interface {
	Add(session.Session)
	Find(session.ID) (session.Session, bool)
	Remove(session.ID)
}

SessionMap defines map of current sessions

type Validator

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

Validator structure that keeps attributes needed Validator operations

func NewValidator

func NewValidator(sessionMap SessionMap, extractor identity.Extractor) *Validator

NewValidator return Validator instance

func (*Validator) Cleanup

func (v *Validator) Cleanup(sessionString string) error

Cleanup removes session from underlying session managers

func (*Validator) Validate

func (v *Validator) Validate(clientID int, sessionString, signatureString string) (bool, error)

Validate provides glue code for openvpn management interface to validate incoming client login request, it expects session id as username, and session signature signed by client as password

Jump to

Keyboard shortcuts

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