infra

package
v0.0.0-...-7d41a23 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package infra regroups all infra (driven-side) implementations that are transverse to domains.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendLDAP

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

BackendLDAP implements a backend over LDAP (OpenLDAP schema).

func NewBackendLDAP

func NewBackendLDAP() BackendLDAP

NewBackendLDAP creates a new BackendLDAP.

func (BackendLDAP) AppendGroup

func (b BackendLDAP) AppendGroup(g group.Group) error

AppendGroup add attributes to the group with id.

func (BackendLDAP) AppendUnit

func (b BackendLDAP) AppendUnit(u unit.Unit) error

AppendUnit add attributes to the unit with id.

func (BackendLDAP) AppendUser

func (b BackendLDAP) AppendUser(u user.User) error

AppendUser add attributes to the user with id.

func (BackendLDAP) CreateGroup

func (b BackendLDAP) CreateGroup(g group.Group) error

CreateGroup creates a new group in the default unit.

func (BackendLDAP) CreateUnit

func (b BackendLDAP) CreateUnit(u unit.Unit) error

CreateUnit creates a new unit in the server.

func (BackendLDAP) CreateUser

func (b BackendLDAP) CreateUser(u user.User) error

CreateUser creates a new user in the default unit.

func (BackendLDAP) DeleteGroup

func (b BackendLDAP) DeleteGroup(id string) error

DeleteGroup deletes a group.

func (BackendLDAP) DeleteUnit

func (b BackendLDAP) DeleteUnit(id string) error

DeleteUnit deletes a unit.

func (BackendLDAP) DeleteUser

func (b BackendLDAP) DeleteUser(id string) error

DeleteUser deletes a user.

func (BackendLDAP) GetGroup

func (b BackendLDAP) GetGroup(id string) (group.Group, error)

GetGroup returns a specific group with id.

func (BackendLDAP) GetPrincipalEmail

func (b BackendLDAP) GetPrincipalEmail(userID string) (string, error)

GetPrincipalEmail returns the main e-mail (of index 0) of a specific unit with id.

func (BackendLDAP) GetUnit

func (b BackendLDAP) GetUnit(id string) (unit.Unit, error)

GetUnit returns a specific unit with id.

func (BackendLDAP) GetUser

func (b BackendLDAP) GetUser(id string) (user.User, error)

GetUser returns a specific user with id.

func (BackendLDAP) ListGroups

func (b BackendLDAP) ListGroups() (group.List, error)

ListGroups list all groups contained in the LDAP server.

func (BackendLDAP) ListUnits

func (b BackendLDAP) ListUnits() (unit.List, error)

ListUnits list all units contained in the LDAP server.

func (BackendLDAP) ListUsers

func (b BackendLDAP) ListUsers() (user.List, error)

ListUsers list all users contained in the LDAP server.

func (*BackendLDAP) OpenConnection

func (b *BackendLDAP) OpenConnection(c credentials.Credentials) error

OpenConnection connect to the LDAP server with given credentials.

func (BackendLDAP) RemoveGroup

func (b BackendLDAP) RemoveGroup(g group.Group) error

RemoveGroup remove attributes from the group with id.

func (BackendLDAP) RemoveUnit

func (b BackendLDAP) RemoveUnit(u unit.Unit) error

RemoveUnit remove attributes from the unit with id.

func (BackendLDAP) RemoveUser

func (b BackendLDAP) RemoveUser(u user.User) error

RemoveUser remove attributes from the user with id.

func (BackendLDAP) SetUserPassword

func (b BackendLDAP) SetUserPassword(userID string, hashedPassword string) error

SetUserPassword sets hashed password to user.

func (BackendLDAP) TestCredentials

func (b BackendLDAP) TestCredentials(c credentials.Credentials) (bool, error)

TestCredentials tests specific credentials.

func (BackendLDAP) UpdateGroup

func (b BackendLDAP) UpdateGroup(g group.Group) error

UpdateGroup modify an existing group.

func (BackendLDAP) UpdateUnit

func (b BackendLDAP) UpdateUnit(u unit.Unit) error

UpdateUnit modify an existing unit.

func (BackendLDAP) UpdateUser

func (b BackendLDAP) UpdateUser(u user.User) error

UpdateUser modify an existing user.

func (*BackendLDAP) UseUnit

func (b *BackendLDAP) UseUnit(id string)

UseUnit sets the default organizational unit for all operations.

type MailService

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

MailService implements SecretPusher to deliver secrets by mail (not safe!).

func NewMailService

func NewMailService(addr, from string) MailService

NewMailService create a new MailService object.

func (MailService) CanPushSecret

func (ms MailService) CanPushSecret() error

CanPushSecret return nil if everything looks good and a secret can be delivered.

func (MailService) GetTemplate

func (ms MailService) GetTemplate(templateID string) (string, error)

GetTemplate returns the mail template for the given secret type.

func (MailService) PushSecret

func (ms MailService) PushSecret(email string, secretType string, secret string) error

PushSecret deliver a secret to the user e-mail.

Directories

Path Synopsis
Package credentials regroups all infra (driven-side) implementations of the credentials domain.
Package credentials regroups all infra (driven-side) implementations of the credentials domain.
Package realm regroups all infra (driven-side) implementations of the realm domain.
Package realm regroups all infra (driven-side) implementations of the realm domain.

Jump to

Keyboard shortcuts

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