brokers

package
v0.0.0-...-d8cb2d5 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithRootDir

func WithRootDir(p string) func(o *options)

WithRootDir uses a dedicated path for our root.

Types

type Broker

type Broker struct {
	ID            string
	Name          string
	BrandIconPath string
	// contains filtered or unexported fields
}

func NewBroker

func NewBroker(ctx context.Context, name, configFile string, bus *dbus.Conn) (b Broker, err error)

func (Broker) GetAuthenticationModes

func (b Broker) GetAuthenticationModes(ctx context.Context, username, lang string, supportedUiLayouts []map[string]string) (sessionID, encryptionKey string, authenticationModes []map[string]string, err error)

GetAuthenticationModes calls the broker corresponding method, expanding sessionID with the broker ID prefix. This solves the case of 2 brokers returning the same ID.

func (Broker) IsAuthorized

func (b Broker) IsAuthorized(ctx context.Context, sessionID, authenticationData string) (access string, userInfo string, err error)

IsAuthorized calls the broker corresponding method, stripping broker ID prefix from sessionID.

func (Broker) SelectAuthenticationMode

func (b Broker) SelectAuthenticationMode(ctx context.Context, sessionID, authenticationModeName string) (uiLayoutInfo map[string]string, err error)

SelectAuthenticationMode calls the broker corresponding method, stripping broker ID prefix from sessionID.

type Manager

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

func NewManager

func NewManager(ctx context.Context, configuredBrokers []string, args ...Option) (m *Manager, err error)

func (*Manager) AvailableBrokers

func (m *Manager) AvailableBrokers() (r []*Broker)

AvailableBrokers returns currently loaded and available brokers in preference order.

func (*Manager) BrokerForSessionID

func (m *Manager) BrokerForSessionID(sessionID string) (broker *Broker, err error)

BrokerForSessionID returns broker currently in use for a given transaction sessionID.

func (*Manager) BrokerForUser

func (m *Manager) BrokerForUser(username string) (broker *Broker)

BrokerForUser returns any previously selected broker for a given user, if any.

func (*Manager) GetBroker

func (m *Manager) GetBroker(brokerID string) (broker *Broker, err error)

GetBroker returns the broker matching this brokerID.

func (*Manager) SetBrokerForSessionID

func (m *Manager) SetBrokerForSessionID(sessionID string, broker *Broker)

SetBrokerForSessionID set a broker as currently use for a given transaction with this sessionID.

func (*Manager) SetDefaultBrokerForUser

func (m *Manager) SetDefaultBrokerForUser(username string, broker *Broker)

SetDefaultBrokerForUser memorizes which broker was used for which user.

type Option

type Option func(*options)

Option is the function signature used to tweak the daemon creation.

Jump to

Keyboard shortcuts

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