auth

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnonymousAuth

type AnonymousAuth struct {
	AuthRole string
}

AnonymousAuth is a authenticator which provides a configurable authrole for previously unauthenticated clients.

func (AnonymousAuth) AuthMethod

func (a AnonymousAuth) AuthMethod() string

AuthMethod returns a string representing the type of the authenticator Use the crossbar.io "anonymous" authmethod name here.

func (AnonymousAuth) Authenticate

func (a AnonymousAuth) Authenticate(_ wamp.ID, _ wamp.Dict, _ wamp.Peer) (*wamp.Welcome, error)

Authenticate assigns an authrole and an authid to the given session.

type DynamicAuthorizer

type DynamicAuthorizer struct {
	PermitDefault      bool
	TrustedAuthRoles   mapset.Set
	UpstreamAuthorizer string
	Realm              string
}

DynamicAuthorizer is an authorizer that uses a WAMP RPC call to verify permissions for various actions like CALL, SUBSCRIBE, PUBLISH, REGISTER

func (DynamicAuthorizer) Authorize

func (a DynamicAuthorizer) Authorize(sess *wamp.Session, msg wamp.Message) (bool, error)

Authorize checks whether the session `sess` is allowed to send the message `msg`

type DynamicTicketAuth

type DynamicTicketAuth struct {
	SharedSecretAuthenticator
	UpstreamAuthFunc string
	AllowResumeToken bool
}

DynamicTicketAuth is an authenticator which performs authentication based on a user and its password (i.e. shared secret)

func NewDynamicTicket

func NewDynamicTicket(authfunc string, authrolefunc string, realm string, invalid mapset.Set, allowtoken bool) (*DynamicTicketAuth, error)

NewDynamicTicket creates a new DynamicTicketAuth object based on the given parameters

func (*DynamicTicketAuth) Authenticate

func (a *DynamicTicketAuth) Authenticate(sid wamp.ID, details wamp.Dict, client wamp.Peer) (*wamp.Welcome, error)

Authenticate authenticates requests a ticket (=password) from the user and authenticates the user based on its response.

type FeatureAuthorizer

type FeatureAuthorizer struct {
	PermitDefault    bool
	MatrixURI        string
	MappingURI       string
	TrustedAuthRoles mapset.Set
	FeatureMatrix    *FeatureMatrix
	FeatureMapping   *FeatureMapping
	CallCounter      int
}

func NewFeatureAuthorizer

func NewFeatureAuthorizer(permitDefault bool, matrixURI string, mappingURI string, trustedAuthRoles mapset.Set) *FeatureAuthorizer

func (*FeatureAuthorizer) Authorize

func (this *FeatureAuthorizer) Authorize(sess *wamp.Session, msg wamp.Message) (bool, error)

func (*FeatureAuthorizer) Initialize

func (this *FeatureAuthorizer) Initialize()

func (*FeatureAuthorizer) Update

func (this *FeatureAuthorizer) Update(_ context.Context, args wamp.List, _, _ wamp.Dict) *client.InvokeResult

func (*FeatureAuthorizer) UpdateMapping

func (this *FeatureAuthorizer) UpdateMapping() error

func (*FeatureAuthorizer) UpdateMatrix

func (this *FeatureAuthorizer) UpdateMatrix() error

type FeatureMapping

type FeatureMapping map[wamp.URI]wamp.URI

type FeatureMatrix

type FeatureMatrix map[wamp.URI]map[string]bool

type ResumeAuthenticator

type ResumeAuthenticator struct {
	SharedSecretAuthenticator
	// Map from token -> Token
	Tokens map[string]token
}

ResumeAuthenticator is an authenticator which performs authentication based on a previously created one-time-token. It is designed to be used with the normal ticket authenticator.

func NewResumeAuthenticator

func NewResumeAuthenticator(authrolefunc string, realm string, invalidRoles mapset.Set) (*ResumeAuthenticator, error)

NewResumeAuthenticator creates a new ResumeAuthenticator based on the given parameters

func (*ResumeAuthenticator) Authenticate

func (r *ResumeAuthenticator) Authenticate(sid wamp.ID, details wamp.Dict, client wamp.Peer) (*wamp.Welcome, error)

Authenticate asks for the users ticket, checks the provided response with the list of previously created tokens.

func (*ResumeAuthenticator) Initialize

func (r *ResumeAuthenticator) Initialize()

Initialize registers the create-new-token-endpoint

type SharedSecretAuthenticator

type SharedSecretAuthenticator struct {
	Realm                    string
	UpstreamGetAuthRolesFunc string
	InvalidAuthRoles         mapset.Set
	AuthMethodValue          string
}

SharedSecretAuthenticator is a base type of authenticators which operate on shared secrets like passwords and tokens.

func (*SharedSecretAuthenticator) AuthMethod

func (s *SharedSecretAuthenticator) AuthMethod() string

AuthMethod returns a string representing the type of the authenticator

func (*SharedSecretAuthenticator) FetchAndFilterAuthRoles

func (s *SharedSecretAuthenticator) FetchAndFilterAuthRoles(authid string) (*wamp.Welcome, error)

FetchAndFilterAuthRoles tries to fetch authroles for a previously authenticated client based on its authid using the configured UpstreamGetAuthRolesFunc

type TLSAuth

type TLSAuth struct {
	ValidClientCAs []cli.TLSClientCAInfo
}

func (TLSAuth) AuthMethod

func (self TLSAuth) AuthMethod() string

func (TLSAuth) Authenticate

func (self TLSAuth) Authenticate(sid wamp.ID, details wamp.Dict, client wamp.Peer) (*wamp.Welcome, error)

Jump to

Keyboard shortcuts

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