examplebroker

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Overview

Package examplebroker implements an example broker that will be used by the authentication daemon.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartBus

func StartBus(cfgPath string) (conn *dbus.Conn, err error)

StartBus starts the D-Bus service and exports it on the system bus.

Types

type Broker

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

Broker represents an examplebroker object.

func New

func New(name string) (b *Broker, fullName, brandIcon string)

New creates a new examplebroker object.

func (*Broker) CancelIsAuthenticated

func (b *Broker) CancelIsAuthenticated(ctx context.Context, sessionID string)

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

func (b *Broker) EndSession(ctx context.Context, sessionID string) error

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.

func (*Broker) SelectAuthenticationMode

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

SelectAuthenticationMode returns the UI layout information for the selected authentication mode.

func (*Broker) UserPreCheck

func (b *Broker) UserPreCheck(ctx context.Context, username string) (string, error)

UserPreCheck checks if the user is known to the broker.

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

func (b *Bus) CancelIsAuthenticated(sessionID string) (dbusErr *dbus.Error)

CancelIsAuthenticated is the method through which the broker and the daemon will communicate once dbusInterface.CancelIsAuthenticated is called.

func (*Bus) EndSession

func (b *Bus) EndSession(sessionID string) (dbusErr *dbus.Error)

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.

func (*Bus) UserPreCheck

func (b *Bus) UserPreCheck(username string) (userinfo string, dbusErr *dbus.Error)

UserPreCheck is the method through which the broker and the daemon will communicate once dbusInterface.UserPreCheck is called.

Jump to

Keyboard shortcuts

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