Documentation ¶
Index ¶
- Variables
- type Backend
- type KCIdentifierBackend
- func (b *KCIdentifierBackend) GetUser(ctx context.Context, userID string) (identity.User, error)
- func (b *KCIdentifierBackend) Logon(ctx context.Context, username, password string) (bool, *string, error)
- func (b *KCIdentifierBackend) ResolveUser(ctx context.Context, username string) (identity.UserWithUsername, error)
- func (b *KCIdentifierBackend) RunWithContext(ctx context.Context) error
- type LDAPIdentifierBackend
- func (b *LDAPIdentifierBackend) GetUser(ctx context.Context, userID string) (identity.User, error)
- func (b *LDAPIdentifierBackend) Logon(ctx context.Context, username, password string) (bool, *string, error)
- func (b *LDAPIdentifierBackend) ResolveUser(ctx context.Context, username string) (identity.UserWithUsername, error)
- func (b *LDAPIdentifierBackend) RunWithContext(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ( KCServerDefaultFamilyNameProperty = kcc.PR_SURNAME_A KCServerDefaultGivenNameProperty = kcc.PR_GIVEN_NAME_A )
Property mappings for Kopano Server user meta data.
var KCServerDefaultUsername = "SYSTEM"
KCServerDefaultUsername is the default username used by KCIdentifierBackend for KCC when the provided username is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { RunWithContext(context.Context) error Logon(ctx context.Context, username string, password string) (success bool, userID *string, err error) ResolveUser(ctx context.Context, username string) (user identity.UserWithUsername, err error) GetUser(ctx context.Context, userID string) (user identity.User, err error) }
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, username string, password string) (*KCIdentifierBackend, error)
NewKCIdentifierBackend creates a new KCIdentifierBackend with the provided parameters.
func (*KCIdentifierBackend) GetUser ¶
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, username, password string) (bool, *string, error)
Logon implements the Backend interface, enabling Logon with user name and password as provided. Requests are bound to the provided context.
func (*KCIdentifierBackend) ResolveUser ¶
func (b *KCIdentifierBackend) ResolveUser(ctx context.Context, username string) (identity.UserWithUsername, error)
ResolveUser 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.
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, mappedAttributes map[string]string, ) (*LDAPIdentifierBackend, error)
NewLDAPIdentifierBackend creates a new LDAPIdentifierBackend with the provided parameters.
func (*LDAPIdentifierBackend) GetUser ¶ added in v0.3.0
GetUser implements the Backend interface, providing user meta data retrieval for the user specified by the useID. Requests are bound to the provided context.
func (*LDAPIdentifierBackend) Logon ¶ added in v0.3.0
func (b *LDAPIdentifierBackend) Logon(ctx context.Context, username, password string) (bool, *string, error)
Logon implements the Backend interface, enabling Logon with user name and password as provided. Requests are bound to the provided context.
func (*LDAPIdentifierBackend) ResolveUser ¶ added in v0.3.0
func (b *LDAPIdentifierBackend) ResolveUser(ctx context.Context, username string) (identity.UserWithUsername, error)
ResolveUser 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.