Documentation ¶
Index ¶
- type AttrsOrig
- type CacheAttrsNorm
- type CacheAttrsOrig
- type CacheEntry
- type Changelog
- func (c *Changelog) Add(sv *schema.SchemaValue) error
- func (c *Changelog) AddWithouCheck(sv *schema.SchemaValue) error
- func (c *Changelog) DN() *schema.DN
- func (c *Changelog) DNNorm() string
- func (c *Changelog) Delete(sv *schema.SchemaValue) error
- func (c *Changelog) HasAttr(attrName string) bool
- func (c *Changelog) NewDN() *schema.DN
- func (c *Changelog) NewEntry() map[string]*schema.SchemaValue
- func (c *Changelog) ObjectClassesNorm() ([]string, bool)
- func (c *Changelog) Replace(sv *schema.SchemaValue) error
- func (c *Changelog) Requester() *schema.DN
- func (c *Changelog) Timestamp() string
- func (c *Changelog) ToAttrsOrig() AttrsOrig
- func (c *Changelog) ToDiff() map[string]*ModOperation
- func (c *Changelog) ToMemberOfDiff() (add []string, del []string)
- func (c *Changelog) ToNewAttrsOrig() AttrsOrig
- func (c *Changelog) UpdateDN(newDN *schema.DN)
- func (c *Changelog) Validate() error
- type DBAttrsNorm
- type DBEntry
- type DBRepository
- type DBRepositoryConfig
- type DefaultRepository
- func (r *DefaultRepository) Association(ctx context.Context, sv *schema.SchemaValue) (*schema.SchemaValue, error)
- func (r *DefaultRepository) Bind(ctx context.Context, dn *schema.DN, ...) error
- func (r *DefaultRepository) CacheAll(ctx context.Context) error
- func (r *DefaultRepository) CacheAssociation(ctx context.Context, cacheTx *reindexer.Tx, dbTx *sqlx.Tx, memberOf []int64) error
- func (r *DefaultRepository) CacheEntry(ctx context.Context, tx *reindexer.Tx, entry *DBEntry, ignoreParent bool) error
- func (r *DefaultRepository) CacheEntryByID(ctx context.Context, cacheTx *reindexer.Tx, dbTx *sqlx.Tx, id int64, ...) error
- func (r *DefaultRepository) CacheEntryBySubTree(ctx context.Context, cacheTx *reindexer.Tx, dbTx *sqlx.Tx, id int64) error
- func (r *DefaultRepository) DeleteByDN(ctx context.Context, dn *schema.DN) error
- func (r *DefaultRepository) DeleteCacheEntry(ctx context.Context, cacheTx *reindexer.Tx, dbTx *sqlx.Tx, id, parentId int64, ...) (int, error)
- func (r *DefaultRepository) FindPPolicyByDN(ctx context.Context, dn *schema.DN) (*schema.PPolicy, error)
- func (r *DefaultRepository) Init() error
- func (r *DefaultRepository) Insert(ctx context.Context, changelog *Changelog) (int64, error)
- func (r *DefaultRepository) OnUpdate(ctx context.Context, m *NotifyMessage) error
- func (r *DefaultRepository) RefreshCache(ctx context.Context) error
- func (r *DefaultRepository) Search(ctx context.Context, baseDN *schema.DN, option *SearchOption, ...) (int32, int32, error)
- func (r *DefaultRepository) Update(ctx context.Context, dn *schema.DN, ...) error
- func (r *DefaultRepository) UpdateDN(ctx context.Context, oldDN, newDN *schema.DN, oldRDN *schema.RelativeDN, ...) error
- type FetchedCredential
- type FetchedDNOrig
- type FilterContext
- type FilterTranslator
- func (t *FilterTranslator) AnyMatch(s *schema.AttributeType, q *reindexer.Query, val string, i int)
- func (t *FilterTranslator) ApproxMatch(ctx context.Context, s *schema.AttributeType, q *reindexer.Query, val string)
- func (t *FilterTranslator) EndsMatch(s *schema.AttributeType, q *reindexer.Query, val string, i int)
- func (t *FilterTranslator) EqualityMatch(ctx context.Context, s *schema.AttributeType, q *reindexer.Query, val string)
- func (t *FilterTranslator) GreaterOrEqualMatch(ctx context.Context, s *schema.AttributeType, q *reindexer.Query, val string)
- func (t *FilterTranslator) LessOrEqualMatch(ctx context.Context, s *schema.AttributeType, q *reindexer.Query, val string)
- func (t *FilterTranslator) Name(s *schema.AttributeType) string
- func (t *FilterTranslator) PresentMatch(ctx context.Context, s *schema.AttributeType, q *reindexer.Query)
- func (t *FilterTranslator) StartsWithMatch(s *schema.AttributeType, q *reindexer.Query, val string, i int)
- type ModOperation
- type NotifyMessage
- type NotifyOp
- type RDNCache
- type Repository
- type SearchEntry
- type SearchOption
- type StmtCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheAttrsNorm ¶
type CacheAttrsNorm map[string][]interface{}
func (CacheAttrsNorm) ValueInt64 ¶
func (c CacheAttrsNorm) ValueInt64(name string) []int64
func (CacheAttrsNorm) ValueStr ¶
func (c CacheAttrsNorm) ValueStr(name string) []string
type CacheAttrsOrig ¶
type CacheEntry ¶
type CacheEntry struct { ID int64 `reindex:"id,,pk" json:"id"` Version int64 `reindex:"rev" json:"rev"` ParentID int64 `reindex:"parentId" json:"parentId"` Path []int64 `reindex:"path,tree" json:"path"` IsContainer bool `reindex:"isContainer" json:"isContainer"` RDNNorm string `reindex:"rdnNorm" json:"rdnNorm"` RDNOrig string `reindex:"-" json:"rdnOrig"` AttrsNorm struct { } `reindex:"attrsNorm" json:"attrsNorm"` AttrsOrig CacheAttrsOrig `reindex:"-" json:"attrsOrig"` Dummy string `reindex:"dummy" json:"-"` }
type Changelog ¶
type Changelog struct {
// contains filtered or unexported fields
}
func NewChangelog ¶
func (*Changelog) AddWithouCheck ¶
func (c *Changelog) AddWithouCheck(sv *schema.SchemaValue) error
func (*Changelog) Delete ¶
func (c *Changelog) Delete(sv *schema.SchemaValue) error
Delete from current value(s) if the value matchs.
func (*Changelog) ObjectClassesNorm ¶
func (*Changelog) Replace ¶
func (c *Changelog) Replace(sv *schema.SchemaValue) error
Replace with the value(s).
func (*Changelog) ToAttrsOrig ¶
func (*Changelog) ToDiff ¶
func (c *Changelog) ToDiff() map[string]*ModOperation
func (*Changelog) ToMemberOfDiff ¶
func (*Changelog) ToNewAttrsOrig ¶
type DBAttrsNorm ¶
type DBEntry ¶
type DBEntry struct { ID int64 `db:"id"` Version int64 `db:"rev"` ParentID int64 `db:"parent_id"` Path pq.Int64Array `db:"path"` IsContainer bool `db:"is_container"` RDNNorm string `db:"rdn_norm"` RDNOrig string `db:"rdn_orig"` AttrsOrig types.JSONText `db:"attrs_orig"` AttrsOrigMap map[string][]string `db:"-"` // for cache }
type DBRepository ¶
type DBRepository struct {
// contains filtered or unexported fields
}
type DBRepositoryConfig ¶
type DefaultRepository ¶
type DefaultRepository struct {
*DBRepository
}
func (*DefaultRepository) Association ¶
func (r *DefaultRepository) Association(ctx context.Context, sv *schema.SchemaValue) (*schema.SchemaValue, error)
Association resolves the association related attributes in the attributes. This is used for MOD operation.
func (*DefaultRepository) Bind ¶
func (r *DefaultRepository) Bind(ctx context.Context, dn *schema.DN, callback func(current *FetchedCredential) error) error
Bind fetches the current bind entry by specified DN. Then execute callback with the entry. The callback is expected checking the credential, account lock status and so on. This is used for BIND operation.
func (*DefaultRepository) CacheAll ¶
func (r *DefaultRepository) CacheAll(ctx context.Context) error
func (*DefaultRepository) CacheAssociation ¶
func (*DefaultRepository) CacheEntry ¶
func (*DefaultRepository) CacheEntryByID ¶
func (*DefaultRepository) CacheEntryBySubTree ¶
func (*DefaultRepository) DeleteByDN ¶
DeleteByDN deletes the entry by specified DN.
func (*DefaultRepository) DeleteCacheEntry ¶
func (*DefaultRepository) FindPPolicyByDN ¶
func (r *DefaultRepository) FindPPolicyByDN(ctx context.Context, dn *schema.DN) (*schema.PPolicy, error)
FindPPolicyByDN returns the password policy entry by specified DN. This is used for password policy process.
func (*DefaultRepository) Init ¶
func (r *DefaultRepository) Init() error
func (*DefaultRepository) OnUpdate ¶
func (r *DefaultRepository) OnUpdate(ctx context.Context, m *NotifyMessage) error
func (*DefaultRepository) RefreshCache ¶
func (r *DefaultRepository) RefreshCache(ctx context.Context) error
func (*DefaultRepository) Search ¶
func (r *DefaultRepository) Search(ctx context.Context, baseDN *schema.DN, option *SearchOption, handler func(entry *SearchEntry) error) (int32, int32, error)
Search handles search request by filter. This is used for SEARCH operation.
func (*DefaultRepository) Update ¶
func (r *DefaultRepository) Update(ctx context.Context, dn *schema.DN, callback func(attrsOrig AttrsOrig) (*Changelog, error)) error
Update modifies the entry by specified change data. This is used for MOD operation.
func (*DefaultRepository) UpdateDN ¶
func (r *DefaultRepository) UpdateDN(ctx context.Context, oldDN, newDN *schema.DN, oldRDN *schema.RelativeDN, callback func(attrsOrig AttrsOrig) (*Changelog, error)) error
UpdateRDN modifies the entry RDN by specified change data. This is used for MODRDN operation.
type FetchedCredential ¶
type FetchedDNOrig ¶
type FilterContext ¶
type FilterTranslator ¶
type FilterTranslator struct {
// contains filtered or unexported fields
}
func (*FilterTranslator) AnyMatch ¶
func (t *FilterTranslator) AnyMatch(s *schema.AttributeType, q *reindexer.Query, val string, i int)
func (*FilterTranslator) ApproxMatch ¶
func (t *FilterTranslator) ApproxMatch(ctx context.Context, s *schema.AttributeType, q *reindexer.Query, val string)
func (*FilterTranslator) EndsMatch ¶
func (t *FilterTranslator) EndsMatch(s *schema.AttributeType, q *reindexer.Query, val string, i int)
func (*FilterTranslator) EqualityMatch ¶
func (t *FilterTranslator) EqualityMatch(ctx context.Context, s *schema.AttributeType, q *reindexer.Query, val string)
func (*FilterTranslator) GreaterOrEqualMatch ¶
func (t *FilterTranslator) GreaterOrEqualMatch(ctx context.Context, s *schema.AttributeType, q *reindexer.Query, val string)
func (*FilterTranslator) LessOrEqualMatch ¶
func (t *FilterTranslator) LessOrEqualMatch(ctx context.Context, s *schema.AttributeType, q *reindexer.Query, val string)
func (*FilterTranslator) Name ¶
func (t *FilterTranslator) Name(s *schema.AttributeType) string
func (*FilterTranslator) PresentMatch ¶
func (t *FilterTranslator) PresentMatch(ctx context.Context, s *schema.AttributeType, q *reindexer.Query)
func (*FilterTranslator) StartsWithMatch ¶
func (t *FilterTranslator) StartsWithMatch(s *schema.AttributeType, q *reindexer.Query, val string, i int)
type ModOperation ¶
func (*ModOperation) IsAdd ¶
func (m *ModOperation) IsAdd() bool
func (*ModOperation) IsClear ¶
func (m *ModOperation) IsClear() bool
func (*ModOperation) IsDelete ¶
func (m *ModOperation) IsDelete() bool
func (*ModOperation) IsReplace ¶
func (m *ModOperation) IsReplace() bool
type NotifyMessage ¶
type NotifyMessage struct { Issuer string `json:"iss"` ID int64 `json:"id"` Op NotifyOp `json:"op"` Rev int64 `json:"rev"` Association bool `json:"asc"` Dependant []int64 `json:"dep"` Sub bool `json:"sub"` }
func (*NotifyMessage) IsAdd ¶
func (n *NotifyMessage) IsAdd() bool
func (*NotifyMessage) IsDel ¶
func (n *NotifyMessage) IsDel() bool
func (*NotifyMessage) IsMod ¶
func (n *NotifyMessage) IsMod() bool
type Repository ¶
type Repository interface { // Init is called when initializing repository implementation. Init() error // Bind fetches the current bind entry by specified DN. Then execute callback with the entry. // The callback is expected checking the credential, account lock status and so on. // This is used for BIND operation. Bind(ctx context.Context, dn *schema.DN, callback func(current *FetchedCredential) error) error // FindPPolicyByDN returns the password policy entry by specified DN. // This is used for password policy process. FindPPolicyByDN(ctx context.Context, dn *schema.DN) (*schema.PPolicy, error) // Search handles search request by filter. // This is used for SEARCH operation. Search(ctx context.Context, baseDN *schema.DN, option *SearchOption, handler func(entry *SearchEntry) error) (int32, int32, error) // Update modifies the entry by specified change data. // This is used for MOD operation. Update(ctx context.Context, dn *schema.DN, callback func(attrsOrig AttrsOrig) (*Changelog, error)) error // Association resolves the association related attributes in the attributes. // This is used for MOD operation. Association(ctx context.Context, sv *schema.SchemaValue) (*schema.SchemaValue, error) // UpdateRDN modifies the entry DN by specified change data. // This is used for MODRDN operation. UpdateDN(ctx context.Context, oldDN, newDN *schema.DN, oldRDN *schema.RelativeDN, callback func(attrsOrig AttrsOrig) (*Changelog, error)) error // Insert creates the entry by specified entry data. Insert(ctx context.Context, entry *Changelog) (int64, error) // DeleteByDN deletes the entry by specified DN. DeleteByDN(ctx context.Context, dn *schema.DN) error OnUpdate(ctx context.Context, m *NotifyMessage) error }
func NewRepository ¶
func NewRepository(config *DBRepositoryConfig, sr *schema.SchemaRegistry) (Repository, error)
type SearchEntry ¶
type SearchEntry struct {
// contains filtered or unexported fields
}
func NewSearchEntry ¶
func NewSearchEntry(s *schema.SchemaRegistry, dnOrig string, attrsOrig CacheAttrsOrig) *SearchEntry
func (*SearchEntry) AttrOrig ¶
func (s *SearchEntry) AttrOrig(attrName string) (string, []string, bool)
func (*SearchEntry) AttrsOrig ¶
func (s *SearchEntry) AttrsOrig() CacheAttrsOrig
func (*SearchEntry) AttrsOrigWithoutOperationalAttrs ¶
func (s *SearchEntry) AttrsOrigWithoutOperationalAttrs() AttrsOrig
func (*SearchEntry) DNOrig ¶
func (s *SearchEntry) DNOrig() string
func (*SearchEntry) OperationalAttrsOrig ¶
func (s *SearchEntry) OperationalAttrsOrig() AttrsOrig