backends

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KCServerDefaultFamilyNameProperty = kcc.PR_SURNAME_A
	KCServerDefaultGivenNameProperty  = kcc.PR_GIVEN_NAME_A
)

Property mappings for Kopano Server user meta data.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	RunWithContext(context.Context) error

	Logon(ctx context.Context, audience string, username string, password string) (success bool, userID *string, sessionRef *string, claims map[string]interface{}, err error)
	GetUser(ctx context.Context, userID string, sessionRef *string) (user UserFromBackend, err error)

	ResolveUserByUsername(ctx context.Context, username string) (user UserFromBackend, err error)

	RefreshSession(ctx context.Context, userID string, sessionRef *string, claims map[string]interface{}) error
	DestroySession(ctx context.Context, sessionRef *string) error

	UserClaims(userID string, authorizedScopes map[string]bool) map[string]interface{}
	ScopesSupported() []string
	ScopesMeta() *scopes.Scopes

	Name() string
}

A Backend is an identifier Backend providing functionality to logon and to fetch user meta data.

type KCIdentifierBackend

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

KCIdentifierBackend is a backend for the Identifier which connects to Kopano Core via kcc-go.

func NewKCIdentifierBackend

func NewKCIdentifierBackend(c *config.Config, client *kcc.KCC, useGlobalSession bool, username string, password string) (*KCIdentifierBackend, error)

NewKCIdentifierBackend creates a new KCIdentifierBackend with the provided parameters.

func (*KCIdentifierBackend) DestroySession added in v0.12.0

func (b *KCIdentifierBackend) DestroySession(ctx context.Context, sessionRef *string) error

DestroySession implements the Backend interface providing destroy to KC session.

func (*KCIdentifierBackend) GetUser

func (b *KCIdentifierBackend) GetUser(ctx context.Context, userEntryID string, sessionRef *string) (UserFromBackend, error)

GetUser implements the Backend interface, providing user meta data retrieval for the user specified by the userID. Requests are bound to the provided context.

func (*KCIdentifierBackend) Logon

func (b *KCIdentifierBackend) Logon(ctx context.Context, audience, username, password string) (bool, *string, *string, map[string]interface{}, error)

Logon implements the Backend interface, enabling Logon with user name and password as provided. Requests are bound to the provided context.

func (*KCIdentifierBackend) Name added in v0.13.0

func (b *KCIdentifierBackend) Name() string

Name implements the Backend interface.

func (*KCIdentifierBackend) RefreshSession added in v0.12.0

func (b *KCIdentifierBackend) RefreshSession(ctx context.Context, userID string, sessionRef *string, claims map[string]interface{}) error

RefreshSession implements the Backend interface providing refresh to KC session.

func (*KCIdentifierBackend) RegisterManagers added in v0.13.0

func (b *KCIdentifierBackend) RegisterManagers(mgrs *managers.Managers) error

RegisterManagers registers the provided managers,

func (*KCIdentifierBackend) ResolveUserByUsername added in v0.13.0

func (b *KCIdentifierBackend) ResolveUserByUsername(ctx context.Context, username string) (UserFromBackend, error)

ResolveUserByUsername implements the Beckend interface, providing lookup for user by providing the username. Requests are bound to the provided context.

func (*KCIdentifierBackend) RunWithContext

func (b *KCIdentifierBackend) RunWithContext(ctx context.Context) error

RunWithContext implements the Backend interface. KCIdentifierBackends keep a session to the accociated Kopano Core client. This session is auto renewed and auto rerestablished and is bound to the provided Context.

func (*KCIdentifierBackend) ScopesMeta added in v0.16.0

func (b *KCIdentifierBackend) ScopesMeta() *scopes.Scopes

ScopesMeta implements the Backend interface, providing meta data for supported scopes.

func (*KCIdentifierBackend) ScopesSupported added in v0.7.0

func (b *KCIdentifierBackend) ScopesSupported() []string

ScopesSupported implements the Backend interface, providing supported scopes when running this backend.

func (*KCIdentifierBackend) UserClaims added in v0.9.0

func (b *KCIdentifierBackend) UserClaims(userID string, authorizedScopes map[string]bool) map[string]interface{}

UserClaims implements the Backend interface, providing user specific claims for the user specified by userID.

type LDAPIdentifierBackend added in v0.3.0

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

LDAPIdentifierBackend is a backend for the Identifier which connects LDAP.

func NewLDAPIdentifierBackend added in v0.3.0

func NewLDAPIdentifierBackend(
	c *config.Config,
	tlsConfig *tls.Config,
	uriString,
	bindDN,
	bindPassword,
	baseDN,
	scopeString,
	filter string,
	subAttributes []string,
	mappedAttributes map[string]string,
) (*LDAPIdentifierBackend, error)

NewLDAPIdentifierBackend creates a new LDAPIdentifierBackend with the provided parameters.

func (*LDAPIdentifierBackend) DestroySession added in v0.12.0

func (b *LDAPIdentifierBackend) DestroySession(ctx context.Context, sessionRef *string) error

DestroySession implements the Backend interface providing destroy to KC session.

func (*LDAPIdentifierBackend) GetUser added in v0.3.0

func (b *LDAPIdentifierBackend) GetUser(ctx context.Context, entryID string, sessionRef *string) (UserFromBackend, error)

GetUser implements the Backend interface, providing user meta data retrieval for the user specified by the userID. Requests are bound to the provided context.

func (*LDAPIdentifierBackend) Logon added in v0.3.0

func (b *LDAPIdentifierBackend) Logon(ctx context.Context, audience, username, password string) (bool, *string, *string, map[string]interface{}, error)

Logon implements the Backend interface, enabling Logon with user name and password as provided. Requests are bound to the provided context.

func (*LDAPIdentifierBackend) Name added in v0.13.0

func (b *LDAPIdentifierBackend) Name() string

Name implements the Backend interface.

func (*LDAPIdentifierBackend) RefreshSession added in v0.12.0

func (b *LDAPIdentifierBackend) RefreshSession(ctx context.Context, userID string, sessionRef *string, claims map[string]interface{}) error

RefreshSession implements the Backend interface.

func (*LDAPIdentifierBackend) ResolveUserByUsername added in v0.13.0

func (b *LDAPIdentifierBackend) ResolveUserByUsername(ctx context.Context, username string) (UserFromBackend, error)

ResolveUserByUsername implements the Beckend interface, providing lookup for user by providing the username. Requests are bound to the provided context.

func (*LDAPIdentifierBackend) RunWithContext added in v0.3.0

func (b *LDAPIdentifierBackend) RunWithContext(ctx context.Context) error

RunWithContext implements the Backend interface.

func (*LDAPIdentifierBackend) ScopesMeta added in v0.16.0

func (b *LDAPIdentifierBackend) ScopesMeta() *scopes.Scopes

ScopesMeta implements the Backend interface, providing meta data for supported scopes.

func (*LDAPIdentifierBackend) ScopesSupported added in v0.7.0

func (b *LDAPIdentifierBackend) ScopesSupported() []string

ScopesSupported implements the Backend interface, providing supported scopes when running this backend.

func (*LDAPIdentifierBackend) UserClaims added in v0.9.0

func (b *LDAPIdentifierBackend) UserClaims(userID string, authorizedScopes map[string]bool) map[string]interface{}

UserClaims implements the Backend interface, providing user specific claims for the user specified by the userID.

type UserFromBackend added in v0.17.0

type UserFromBackend interface {
	identity.UserWithUsername
	BackendClaims() map[string]interface{}
}

UserFromBackend are users as provided by backends which can have additional claims together with a user name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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