Documentation
¶
Overview ¶
Package brokers contains the broker object definitions, implementations and manager that will be used by the daemon for authentication.
Index ¶
- Constants
- type Broker
- func (b *Broker) GetAuthenticationModes(ctx context.Context, sessionID string, supportedUILayouts []map[string]string) (authenticationModes []map[string]string, err error)
- func (b Broker) IsAuthenticated(ctx context.Context, sessionID, authenticationData string) (access string, data string, err error)
- func (b Broker) SelectAuthenticationMode(ctx context.Context, sessionID, authenticationModeName string) (uiLayoutInfo map[string]string, err error)
- func (b Broker) UserPreCheck(ctx context.Context, username string) (userinfo string, err error)
- type Manager
- func (m *Manager) AvailableBrokers() (r []*Broker)
- func (m *Manager) BrokerExists(brokerID string) bool
- func (m *Manager) BrokerForUser(username string) (broker *Broker)
- func (m *Manager) BrokerFromSessionID(id string) (broker *Broker, err error)
- func (m *Manager) EndSession(sessionID string) error
- func (m *Manager) NewSession(brokerID, username, lang, mode string) (sessionID string, encryptionKey string, err error)
- func (m *Manager) SetDefaultBrokerForUser(brokerID, username string) error
- func (m *Manager) Stop()
Constants ¶
const DbusInterface string = "com.ubuntu.authd.Broker"
DbusInterface is the expected interface that should be implemented by the brokers.
const LocalBrokerName = "local"
LocalBrokerName is the name of the local broker.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
ID string
Name string
BrandIconPath string
// contains filtered or unexported fields
}
Broker represents a broker object that can be used for authentication.
func (*Broker) GetAuthenticationModes ¶
func (b *Broker) GetAuthenticationModes(ctx context.Context, sessionID string, supportedUILayouts []map[string]string) (authenticationModes []map[string]string, err error)
GetAuthenticationModes calls the broker corresponding method, stripping broker ID prefix from sessionID.
func (Broker) IsAuthenticated ¶
func (b Broker) IsAuthenticated(ctx context.Context, sessionID, authenticationData string) (access string, data string, err error)
IsAuthenticated calls the broker corresponding method, stripping broker ID prefix from sessionID.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the object that manages the available brokers and the session->broker and user->broker relationships.
func NewManager ¶
func NewManager(ctx context.Context, brokersConfPath string, configuredBrokers []string) (m *Manager, err error)
NewManager creates a new broker manager object.
func (*Manager) AvailableBrokers ¶
AvailableBrokers returns currently loaded and available brokers in preference order.
func (*Manager) BrokerExists ¶
BrokerExists returns true if the brokerID is known by the manager. It can happen that a broker which was stored in the database is not available anymore because the user removed the configuration file.
func (*Manager) BrokerForUser ¶
BrokerForUser returns any previously selected broker for a given user, if any.
func (*Manager) BrokerFromSessionID ¶
BrokerFromSessionID returns broker currently in use for a given transaction sessionID.
func (*Manager) EndSession ¶
EndSession signals the end of the session to the broker associated with the sessionID and then removes the session -> broker mapping.
func (*Manager) NewSession ¶
func (m *Manager) NewSession(brokerID, username, lang, mode string) (sessionID string, encryptionKey string, err error)
NewSession create a new session for the broker and store the sesssionID on the manager.
func (*Manager) SetDefaultBrokerForUser ¶
SetDefaultBrokerForUser memorizes which broker was used for which user.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package auth contains the authentication related code.
|
Package auth contains the authentication related code. |
|
Package layouts lists all the broker UI layouts we support.
|
Package layouts lists all the broker UI layouts we support. |
|
entries
Package entries lists all the broker entries we support.
|
Package entries lists all the broker entries we support. |