ldbbolt

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Package ldbbolt provides the lower-level Database functions for managing LDAP Entries in a BoltDB database. Some implementation details:

The database is currently separated in these three buckets

  • id2entry: This bucket contains the GOB encoded ldap.Entry instances keyed by a unique 64bit ID

  • dn2id: This bucket is used as an index to lookup the ID of an entry by its DN. The DN is used in an normalized (case-folded) form here.

  • id2children: This bucket uses the entry-ids as and index and the values contain a list of the entry ids of its direct childdren

Additional buckets will likely be added in the future to create efficient search indexes

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEntryAlreadyExists = errors.New("entry already exists")
	ErrEntryNotFound      = errors.New("entry does not exist")
	ErrNonLeafEntry       = errors.New("entry is not a leaf entry")
)

Functions

This section is empty.

Types

type LdbBolt

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

func (*LdbBolt) Close

func (bdb *LdbBolt) Close()

func (*LdbBolt) Configure

func (bdb *LdbBolt) Configure(logger logrus.FieldLogger, baseDN, dbfile string, options *bolt.Options) error

func (*LdbBolt) EntryDelete

func (bdb *LdbBolt) EntryDelete(dn string) error

func (*LdbBolt) EntryModify

func (bdb *LdbBolt) EntryModify(req *ldap.ModifyRequest) error

func (*LdbBolt) EntryModifyDN added in v0.5.0

func (bdb *LdbBolt) EntryModifyDN(req *ldap.ModifyDNRequest) error

func (*LdbBolt) EntryPut

func (bdb *LdbBolt) EntryPut(e *ldap.Entry) error

func (*LdbBolt) Initialize

func (bdb *LdbBolt) Initialize() error

Initialize() opens the Database file and create the required buckets if they do not exist yet. After calling initialize the database is ready to process transactions

func (*LdbBolt) Search

func (bdb *LdbBolt) Search(base string, scope int) ([]*ldap.Entry, error)

Performs basic LDAP searches, using the dn2id and id2children buckets to generate a list of Result entries. Currently this does strip of the non-request attribute Neither does it support LDAP filters. For now we rely on the frontent (LDAPServer) to both.

func (*LdbBolt) UpdatePassword

func (bdb *LdbBolt) UpdatePassword(req *ldap.PasswordModifyRequest) error

Jump to

Keyboard shortcuts

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