Documentation
¶
Overview ¶
Package examplebroker implements an example broker that will be used by the authentication daemon.
Index ¶
- Constants
- func StartBus(cfgPath string) (conn *dbus.Conn, err error)
- type Broker
- func (b *Broker) CancelIsAuthenticated(ctx context.Context, sessionID string)
- func (b *Broker) EndSession(ctx context.Context, sessionID string) error
- 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, data string, err error)
- func (b *Broker) NewSession(ctx context.Context, username, lang, mode string) (sessionID, encryptionKey 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) (string, error)
- type Bus
- func (b *Bus) CancelIsAuthenticated(sessionID string) (dbusErr *dbus.Error)
- func (b *Bus) EndSession(sessionID string) (dbusErr *dbus.Error)
- func (b *Bus) GetAuthenticationModes(sessionID string, supportedUILayouts []map[string]string) (authenticationModes []map[string]string, dbusErr *dbus.Error)
- func (b *Bus) IsAuthenticated(sessionID, authenticationData string) (access, data string, dbusErr *dbus.Error)
- func (b *Bus) NewSession(username, lang, mode string) (sessionID, encryptionKey string, dbusErr *dbus.Error)
- func (b *Bus) SelectAuthenticationMode(sessionID, authenticationModeName string) (uiLayoutInfo map[string]string, dbusErr *dbus.Error)
- func (b *Bus) UserPreCheck(username string) (userinfo string, dbusErr *dbus.Error)
Constants ¶
const ( // UserIntegrationPrefix is the prefix for an user for integration tests. UserIntegrationPrefix = "user-integration-" // UserIntegrationMfaPrefix is the prefix for an mfa user for integration tests. UserIntegrationMfaPrefix = "user-mfa-integration-" // UserIntegrationMfaNeedsResetPrefix is the prefix for an mfa-needs-reset user for integration tests. UserIntegrationMfaNeedsResetPrefix = "user-mfa-needs-reset-integration-" // UserIntegrationMfaWithResetPrefix is the prefix for an mfa-with-reset user for integration tests. UserIntegrationMfaWithResetPrefix = "user-mfa-with-reset-integration-" // UserIntegrationNeedsResetPrefix is the prefix for a needs-reset user for integration tests. UserIntegrationNeedsResetPrefix = "user-needs-reset-integration-" // UserIntegrationCanResetPrefix is the prefix for a can-reset user for integration tests. UserIntegrationCanResetPrefix = "user-can-reset-integration-" // UserIntegrationLocalGroupsPrefix is the prefix for a local-groups user for integration tests. UserIntegrationLocalGroupsPrefix = "user-local-groups-integration-" // UserIntegrationQRcodeStaticPrefix is the prefix for a static qrcode user for integration tests. UserIntegrationQRcodeStaticPrefix = "user-integration-qrcode-static-" // UserIntegrationPreCheckValue is the value for a pre-check user for integration tests. UserIntegrationPreCheckValue = "pre-check" // UserIntegrationPreCheckPrefix is the prefix for a pre-check user for integration tests. UserIntegrationPreCheckPrefix = UserIntegrationPrefix + UserIntegrationPreCheckValue + "-" // UserIntegrationUnexistent is an unexistent user leading to a non-existent user error. UserIntegrationUnexistent = "user-unexistent" // UserIntegrationAuthModesPrefix is the prefix for an user listing for supported auth modes. // The modes can be exposed as list, in the form: `user-auth-modes-id1,id2,id3-integration-whatever`. UserIntegrationAuthModesPrefix = "user-auth-modes-" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker represents an examplebroker object.
func (*Broker) CancelIsAuthenticated ¶
CancelIsAuthenticated cancels the IsAuthenticated request for the specified session. If there is no pending IsAuthenticated call for the session, this is a no-op.
func (*Broker) EndSession ¶
EndSession ends the requested session and triggers the necessary clean up steps, if any.
func (*Broker) GetAuthenticationModes ¶
func (b *Broker) GetAuthenticationModes(ctx context.Context, sessionID string, supportedUILayouts []map[string]string) (authenticationModes []map[string]string, err error)
GetAuthenticationModes returns the list of supported authentication modes for the selected broker depending on session info.
func (*Broker) IsAuthenticated ¶
func (b *Broker) IsAuthenticated(ctx context.Context, sessionID, authenticationData string) (access, data string, err error)
IsAuthenticated evaluates the provided authenticationData and returns the authentication status for the user.
func (*Broker) NewSession ¶
func (b *Broker) NewSession(ctx context.Context, username, lang, mode string) (sessionID, encryptionKey string, err error)
NewSession creates a new session for the specified user.
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus is the D-Bus object that will answer calls for the broker.
func (*Bus) CancelIsAuthenticated ¶
CancelIsAuthenticated is the method through which the broker and the daemon will communicate once dbusInterface.CancelIsAuthenticated is called.
func (*Bus) EndSession ¶
EndSession is the method through which the broker and the daemon will communicate once dbusInterface.EndSession is called.
func (*Bus) GetAuthenticationModes ¶
func (b *Bus) GetAuthenticationModes(sessionID string, supportedUILayouts []map[string]string) (authenticationModes []map[string]string, dbusErr *dbus.Error)
GetAuthenticationModes is the method through which the broker and the daemon will communicate once dbusInterface.GetAuthenticationModes is called.
func (*Bus) IsAuthenticated ¶
func (b *Bus) IsAuthenticated(sessionID, authenticationData string) (access, data string, dbusErr *dbus.Error)
IsAuthenticated is the method through which the broker and the daemon will communicate once dbusInterface.IsAuthenticated is called.
func (*Bus) NewSession ¶
func (b *Bus) NewSession(username, lang, mode string) (sessionID, encryptionKey string, dbusErr *dbus.Error)
NewSession is the method through which the broker and the daemon will communicate once dbusInterface.NewSession is called.
func (*Bus) SelectAuthenticationMode ¶
func (b *Bus) SelectAuthenticationMode(sessionID, authenticationModeName string) (uiLayoutInfo map[string]string, dbusErr *dbus.Error)
SelectAuthenticationMode is the method through which the broker and the daemon will communicate once dbusInterface.SelectAuthenticationMode is called.