Documentation ¶
Index ¶
- Constants
- Variables
- func NewHandler(s *Server, handler func(s *Server, w ldap.ResponseWriter, r *ldap.Message)) func(w ldap.ResponseWriter, r *ldap.Message)
- func NewInvalidDNError(dnNorm string) error
- func NewRetryError(err error) error
- func ParseLanguageTag(name string) (string, string, error)
- func SetSessionContext(parents context.Context, m *ldap.Message) context.Context
- type AddEntry
- func (j *AddEntry) Add(attrName string, attrValue []string) error
- func (j *AddEntry) Attrs() (map[string][]interface{}, map[string][]string)
- func (j *AddEntry) DN() *DN
- func (j *AddEntry) HasAttr(attrName string) bool
- func (j *AddEntry) IsDC() bool
- func (j *AddEntry) IsRoot() bool
- func (j *AddEntry) ParentDN() *DN
- func (j *AddEntry) SetDN(dn *DN)
- func (j *AddEntry) Validate() error
- type ArrayFlags
- type AttributeType
- func (s *AttributeType) IsAssociationAttribute() bool
- func (s *AttributeType) IsCaseIgnore() bool
- func (s *AttributeType) IsCaseIgnoreSubstr() bool
- func (s *AttributeType) IsNumberOrdering() bool
- func (s *AttributeType) IsOperationalAttribute() bool
- func (s *AttributeType) IsReverseAssociationAttribute() bool
- func (s *AttributeType) NewSchemaValueMap(size int) SchemaValueMap
- type AttributeTypeAndValue
- type AuthSession
- type DBRepository
- type DN
- func (d *DN) DNNormStr() string
- func (d *DN) DNNormStrWithoutSuffix(suffix *DN) string
- func (d *DN) DNOrigEncodedStrWithoutSuffix(suffix *DN) string
- func (d *DN) DNOrigStr() string
- func (d *DN) Equal(o *DN) bool
- func (d *DN) IsAnonymous() bool
- func (d *DN) IsDC() bool
- func (d *DN) IsRoot() bool
- func (d *DN) IsSubOf(o *DN) bool
- func (d *DN) Level() int
- func (d *DN) ModifyRDN(schemaMap *SchemaMap, newRDN string, deleteOld bool) (*DN, *RelativeDN, error)
- func (d *DN) Move(newParentDN *DN) (*DN, error)
- func (d *DN) ParentDN() *DN
- func (d *DN) RDN() map[string]NormString
- func (d *DN) RDNNormStr() string
- func (d *DN) RDNOrigEncodedStr() string
- type FetchedCredential
- type FetchedDNOrig
- type HybridDBEntry
- type HybridDBFilterTranslator
- func (t *HybridDBFilterTranslator) AnyMatch(s *AttributeType, sb *strings.Builder, val string, i int)
- func (t *HybridDBFilterTranslator) ApproxMatch(s *AttributeType, q *HybridDBFilterTranslatorResult, val string, isNot bool)
- func (t *HybridDBFilterTranslator) EndsMatch(s *AttributeType, sb *strings.Builder, val string, i int)
- func (t *HybridDBFilterTranslator) EqualityMatch(s *AttributeType, q *HybridDBFilterTranslatorResult, val string, isNot bool)
- func (t *HybridDBFilterTranslator) GreaterOrEqualMatch(s *AttributeType, q *HybridDBFilterTranslatorResult, val string, isNot bool)
- func (t *HybridDBFilterTranslator) LessOrEqualMatch(s *AttributeType, q *HybridDBFilterTranslatorResult, val string, isNot bool)
- func (t *HybridDBFilterTranslator) PresentMatch(s *AttributeType, q *HybridDBFilterTranslatorResult, isNot bool)
- func (t *HybridDBFilterTranslator) StartsWithMatch(s *AttributeType, sb *strings.Builder, val string, i int)
- type HybridDBFilterTranslatorResult
- type HybridFetchedDBEntry
- type HybridRepository
- func (r *HybridRepository) AddEntryToDBEntry(ctx context.Context, tx *sqlx.Tx, entry *AddEntry) (*HybridDBEntry, map[string][]int64, error)
- func (r *HybridRepository) Bind(ctx context.Context, dn *DN, callback func(current *FetchedCredential) error) error
- func (r HybridRepository) DeleteByDN(ctx context.Context, dn *DN) error
- func (r *HybridRepository) FindPPolicyByDN(ctx context.Context, dn *DN) (*PPolicy, error)
- func (r *HybridRepository) Init() error
- func (r *HybridRepository) Insert(ctx context.Context, entry *AddEntry) (int64, error)
- func (r *HybridRepository) Search(ctx context.Context, baseDN *DN, option *SearchOption, ...) (int32, int32, error)
- func (r *HybridRepository) Update(ctx context.Context, dn *DN, callback func(current *ModifyEntry) error) error
- func (r *HybridRepository) UpdateDN(ctx context.Context, oldDN, newDN *DN, oldRDN *RelativeDN) error
- type InvalidCredentials
- type InvalidDNError
- type LDAPAction
- type LDAPError
- func NewAccountLocked() *LDAPError
- func NewAccountLocking() *LDAPError
- func NewAlreadyExists() *LDAPError
- func NewInsufficientAccess() *LDAPError
- func NewInvalidCredentials() *LDAPError
- func NewInvalidDNSyntax() *LDAPError
- func NewInvalidPerSyntax(attr string, valueidx int) *LDAPError
- func NewMoreThanOnceError(attr string, valueidx int) *LDAPError
- func NewMultipleValuesConstraintViolation(attr string) *LDAPError
- func NewMultipleValuesProvidedError(attr string) *LDAPError
- func NewNoGlobalSuperiorKnowledge() *LDAPError
- func NewNoSuchAttribute(op, attr string) *LDAPError
- func NewNoSuchObject() *LDAPError
- func NewNoSuchObjectWithMatchedDN(dn string) *LDAPError
- func NewNoUserModificationAllowedConstraintViolation(attr string) *LDAPError
- func NewNotAllowedOnNonLeaf() *LDAPError
- func NewObjectClassModsProhibited(from, to string) *LDAPError
- func NewObjectClassViolation() *LDAPError
- func NewObjectClassViolationInvalidStructualChain(oc1, oc2 string) *LDAPError
- func NewObjectClassViolationNoStructural() *LDAPError
- func NewObjectClassViolationNotAllowed(attrName string) *LDAPError
- func NewObjectClassViolationRequiresAttribute(objectClass, attrName string) *LDAPError
- func NewOperationsError() *LDAPError
- func NewSuccess() *LDAPError
- func NewTypeOrValueExists(op, attr string, valueidx int) *LDAPError
- func NewUnavailable() *LDAPError
- func NewUndefinedType(attr string) *LDAPError
- type LDAPPassThroughClient
- type Mapper
- type ModifyEntry
- func (j *ModifyEntry) Add(attrName string, attrValue []string) error
- func (j *ModifyEntry) ApplyCurrent(attrName string, attrValue []string) error
- func (j *ModifyEntry) Attrs() (map[string][]interface{}, map[string][]string)
- func (e *ModifyEntry) Clone() *ModifyEntry
- func (j *ModifyEntry) DN() *DN
- func (j *ModifyEntry) Delete(attrName string, attrValue []string) error
- func (j *ModifyEntry) GetDNNorm() string
- func (j *ModifyEntry) GetDNOrig() string
- func (j *ModifyEntry) HasAttr(attrName string) bool
- func (j *ModifyEntry) HasKey(s *AttributeType) bool
- func (e *ModifyEntry) ModifyRDN(newDN *DN) *ModifyEntry
- func (j *ModifyEntry) ObjectClassesNorm() ([]string, bool)
- func (j *ModifyEntry) ObjectClassesOrig() ([]string, bool)
- func (j *ModifyEntry) Put(value *SchemaValue) error
- func (j *ModifyEntry) Replace(attrName string, attrValue []string) error
- func (j *ModifyEntry) SetDN(dn *DN)
- func (j *ModifyEntry) Validate() error
- type NormString
- type ObjectClass
- type PPolicy
- type PassThroughClient
- type PassThroughConfig
- type RelativeDN
- type Repository
- type RetryError
- type SchemaMap
- func (s *SchemaMap) AttributeType(k string) (*AttributeType, bool)
- func (s *SchemaMap) Dump() string
- func (s *SchemaMap) ObjectClass(k string) (*ObjectClass, bool)
- func (s *SchemaMap) PutAttributeType(k string, attributeType *AttributeType)
- func (s *SchemaMap) PutObjectClass(k string, objectClass *ObjectClass)
- func (s *SchemaMap) ValidateObjectClass(ocs []string, attrs map[string]*SchemaValue) *LDAPError
- type SchemaValue
- func (s *SchemaValue) Add(value *SchemaValue) error
- func (s *SchemaValue) Clone() *SchemaValue
- func (s *SchemaValue) Delete(value *SchemaValue) error
- func (s *SchemaValue) Equals(value *SchemaValue) bool
- func (s *SchemaValue) HasDuplicate(value *SchemaValue) bool
- func (s *SchemaValue) IsAssociationAttribute() bool
- func (s *SchemaValue) IsEmpty() bool
- func (s *SchemaValue) IsNoUserModification() bool
- func (s *SchemaValue) IsNoUserModificationWithMigrationDisabled() bool
- func (s *SchemaValue) IsSingle() bool
- func (s *SchemaValue) LanguageTag() string
- func (s *SchemaValue) Name() string
- func (s *SchemaValue) Norm() []interface{}
- func (s *SchemaValue) NormStr() []string
- func (s *SchemaValue) Orig() []string
- type SchemaValueMap
- type SearchEntry
- func (j *SearchEntry) DNOrig() string
- func (j *SearchEntry) GetAttrOrig(attrName string) (string, []string, bool)
- func (j *SearchEntry) GetAttrsOrig() map[string][]string
- func (j *SearchEntry) GetAttrsOrigWithoutOperationalAttrs() map[string][]string
- func (j *SearchEntry) GetOperationalAttrsOrig() map[string][]string
- type SearchOption
- type Server
- func (s *Server) DCRDN() string
- func (s *Server) GetRootDN() *DN
- func (s *Server) GetRootPW() string
- func (s *Server) GetSuffix() string
- func (s *Server) LoadSchema()
- func (s *Server) NormalizeDN(dn string) (*DN, error)
- func (s *Server) Repo() Repository
- func (s *Server) RequiredAuthz(m *ldap.Message, ops LDAPAction, targetDN *DN) bool
- func (s *Server) Start(bindAddress string)
- func (s *Server) Stop()
- func (s *Server) SuffixNorm() []string
- func (s *Server) SuffixOrig() []string
- func (s *Server) SuffixOrigStr() string
- type ServerConfig
- type SimpleACL
- type SimpleACLDef
- type SimpleACLScope
- type SimpleACLScopeSet
- type StmtCache
- type StringSet
Constants ¶
const TIMESTAMP_FORMAT string = "20060102150405Z"
const TIMESTAMP_NANO_FORMAT string = "20060102150405.000000Z"
Variables ¶
var ( ErrInvalidHash = errors.New("the encoded hash is not in the correct format") ErrIncompatibleVersion = errors.New("incompatible version of argon2") )
var BASE_SCHEMA_OPENLDAP24 string = `` /* 165673-byte string literal not displayed */
ldapsearch -o ldif-wrap=no -H ldap://... -x -D "cn=..." -b "cn=Subschema" -v -s base attributeTypes comparators ditContentRules ditStructureRules ldapSyntaxes matchingRules matchingRuleUse nameForms normalizers objectClasses syntaxCheckers
var LASTBIND_OPERATION_SCHEMA_OPENLDAP24 = `` /* 284-byte string literal not displayed */
var PPOLICY_OPERATION_SCHEMA_OPENLDAP24 = `` /* 573-byte string literal not displayed */
var SCHEMA_OPENLDAP24 = BASE_SCHEMA_OPENLDAP24 + PPOLICY_OPERATION_SCHEMA_OPENLDAP24 + LASTBIND_OPERATION_SCHEMA_OPENLDAP24
var SPACE_PATTERN = regexp.MustCompile(`\s+`)
Functions ¶
func NewHandler ¶
func NewHandler(s *Server, handler func(s *Server, w ldap.ResponseWriter, r *ldap.Message)) func(w ldap.ResponseWriter, r *ldap.Message)
func NewInvalidDNError ¶
func NewRetryError ¶
Types ¶
type AddEntry ¶
type AddEntry struct {
// contains filtered or unexported fields
}
func NewAddEntry ¶
type ArrayFlags ¶
type ArrayFlags []string
var CustomSchema ArrayFlags
func (*ArrayFlags) Set ¶
func (a *ArrayFlags) Set(s string) error
func (*ArrayFlags) String ¶
func (a *ArrayFlags) String() string
type AttributeType ¶
type AttributeType struct { Name string AName []string Oid string Equality string Ordering string Substr string Syntax string Sup string Usage string IndexType string ColumnName string SingleValue bool NoUserModification bool LanguageTag string // contains filtered or unexported fields }
func (*AttributeType) IsAssociationAttribute ¶
func (s *AttributeType) IsAssociationAttribute() bool
func (*AttributeType) IsCaseIgnore ¶
func (s *AttributeType) IsCaseIgnore() bool
func (*AttributeType) IsCaseIgnoreSubstr ¶
func (s *AttributeType) IsCaseIgnoreSubstr() bool
func (*AttributeType) IsNumberOrdering ¶
func (s *AttributeType) IsNumberOrdering() bool
func (*AttributeType) IsOperationalAttribute ¶
func (s *AttributeType) IsOperationalAttribute() bool
func (*AttributeType) IsReverseAssociationAttribute ¶
func (s *AttributeType) IsReverseAssociationAttribute() bool
func (*AttributeType) NewSchemaValueMap ¶
func (s *AttributeType) NewSchemaValueMap(size int) SchemaValueMap
type AttributeTypeAndValue ¶
type AttributeTypeAndValue struct { // TypeOrig is the original attribute type TypeOrig string // TypeNorm is the normalized attribute type TypeNorm string // Value is the original attribute value ValueOrig string // Value is the encoded original attribute value ValueOrigEncoded string // Value is the normalized attribute value ValueNorm string }
type AuthSession ¶
func AuthSessionContext ¶
func AuthSessionContext(ctx context.Context) (*AuthSession, error)
type DBRepository ¶
type DBRepository struct {
// contains filtered or unexported fields
}
type DN ¶
type DN struct { RDNs []*RelativeDN RDNIndex map[string]NormString }
func ParseDN ¶
ParseDN returns a distinguishedName or an error. The function respects https://tools.ietf.org/html/rfc4514 This function based on go-ldap/ldap/v3.
func (*DN) DNNormStrWithoutSuffix ¶
func (*DN) DNOrigEncodedStrWithoutSuffix ¶
func (*DN) IsAnonymous ¶
func (*DN) IsSubOf ¶
IsSubOf checks whether the arg DN is subset of self. Example:
self DN: ou=people,dc=exaple,dc=com arg DN: dc=example,dc=com
=> true
func (*DN) RDN ¶
func (d *DN) RDN() map[string]NormString
func (*DN) RDNNormStr ¶
func (*DN) RDNOrigEncodedStr ¶
type FetchedCredential ¶
type FetchedDNOrig ¶
type HybridDBEntry ¶
type HybridDBEntry struct { ID int64 `db:"id"` RDNNorm string `db:"rdn_norm"` RDNOrig string `db:"rdn_orig"` AttrsNorm types.JSONText `db:"attrs_norm"` AttrsOrig types.JSONText `db:"attrs_orig"` ParentDN *DN }
HybridDBEntry is used as insert or update entry.
type HybridDBFilterTranslator ¶
type HybridDBFilterTranslator struct { }
func (*HybridDBFilterTranslator) AnyMatch ¶
func (t *HybridDBFilterTranslator) AnyMatch(s *AttributeType, sb *strings.Builder, val string, i int)
func (*HybridDBFilterTranslator) ApproxMatch ¶
func (t *HybridDBFilterTranslator) ApproxMatch(s *AttributeType, q *HybridDBFilterTranslatorResult, val string, isNot bool)
func (*HybridDBFilterTranslator) EndsMatch ¶
func (t *HybridDBFilterTranslator) EndsMatch(s *AttributeType, sb *strings.Builder, val string, i int)
func (*HybridDBFilterTranslator) EqualityMatch ¶
func (t *HybridDBFilterTranslator) EqualityMatch(s *AttributeType, q *HybridDBFilterTranslatorResult, val string, isNot bool)
func (*HybridDBFilterTranslator) GreaterOrEqualMatch ¶
func (t *HybridDBFilterTranslator) GreaterOrEqualMatch(s *AttributeType, q *HybridDBFilterTranslatorResult, val string, isNot bool)
func (*HybridDBFilterTranslator) LessOrEqualMatch ¶
func (t *HybridDBFilterTranslator) LessOrEqualMatch(s *AttributeType, q *HybridDBFilterTranslatorResult, val string, isNot bool)
func (*HybridDBFilterTranslator) PresentMatch ¶
func (t *HybridDBFilterTranslator) PresentMatch(s *AttributeType, q *HybridDBFilterTranslatorResult, isNot bool)
func (*HybridDBFilterTranslator) StartsWithMatch ¶
func (t *HybridDBFilterTranslator) StartsWithMatch(s *AttributeType, sb *strings.Builder, val string, i int)
type HybridDBFilterTranslatorResult ¶
type HybridDBFilterTranslatorResult struct {
// contains filtered or unexported fields
}
type HybridFetchedDBEntry ¶
type HybridFetchedDBEntry struct { ID int64 `db:"id"` ParentID int64 `db:"parent_id"` RDNOrig string `db:"rdn_orig"` RawAttrsOrig types.JSONText `db:"attrs_orig"` RawMember types.JSONText `db:"member"` // No real column in the table RawUniqueMember types.JSONText `db:"uniquemember"` // No real column in the table RawMemberOf types.JSONText `db:"memberof"` // No real column in the table HasSubordinates *bool `db:"has_sub"` // No real column in the table DNOrig string `db:"dn_orig"` // No real column in the table Count int32 `db:"count"` // No real column in the table }
func (*HybridFetchedDBEntry) AttrsOrig ¶
func (e *HybridFetchedDBEntry) AttrsOrig() map[string][]string
func (*HybridFetchedDBEntry) Clear ¶
func (e *HybridFetchedDBEntry) Clear()
type HybridRepository ¶
type HybridRepository struct { *DBRepository // contains filtered or unexported fields }
func (*HybridRepository) AddEntryToDBEntry ¶
func (r *HybridRepository) AddEntryToDBEntry(ctx context.Context, tx *sqlx.Tx, entry *AddEntry) (*HybridDBEntry, map[string][]int64, error)
AddEntryToDBEntry converts LDAP entry object to DB entry object. It handles metadata such as createTimistamp, modifyTimestamp and entryUUID. Also, it handles member and uniqueMember attributes.
func (*HybridRepository) Bind ¶
func (r *HybridRepository) Bind(ctx context.Context, dn *DN, callback func(current *FetchedCredential) error) error
func (HybridRepository) DeleteByDN ¶
func (r HybridRepository) DeleteByDN(ctx context.Context, dn *DN) error
func (*HybridRepository) FindPPolicyByDN ¶
func (*HybridRepository) Init ¶
func (r *HybridRepository) Init() error
func (*HybridRepository) Search ¶
func (r *HybridRepository) Search(ctx context.Context, baseDN *DN, option *SearchOption, handler func(entry *SearchEntry) error) (int32, int32, error)
func (*HybridRepository) Update ¶
func (r *HybridRepository) Update(ctx context.Context, dn *DN, callback func(current *ModifyEntry) error) error
func (*HybridRepository) UpdateDN ¶
func (r *HybridRepository) UpdateDN(ctx context.Context, oldDN, newDN *DN, oldRDN *RelativeDN) error
oldRDN: set when keeping current entry
type InvalidCredentials ¶
type InvalidCredentials struct {
// contains filtered or unexported fields
}
func (InvalidCredentials) Error ¶
func (i InvalidCredentials) Error() string
type InvalidDNError ¶
type InvalidDNError struct {
// contains filtered or unexported fields
}
func (*InvalidDNError) Error ¶
func (e *InvalidDNError) Error() string
type LDAPAction ¶
type LDAPAction int
const ( AddOps LDAPAction = iota ModifyOps ModRDNOps DeleteOps SearchOps )
func (LDAPAction) String ¶
func (c LDAPAction) String() string
type LDAPError ¶
type LDAPError struct { Code int Msg string MatchedDN string Subtype string // contains filtered or unexported fields }
func NewAccountLocked ¶
func NewAccountLocked() *LDAPError
func NewAccountLocking ¶
func NewAccountLocking() *LDAPError
func NewAlreadyExists ¶
func NewAlreadyExists() *LDAPError
func NewInsufficientAccess ¶
func NewInsufficientAccess() *LDAPError
func NewInvalidCredentials ¶
func NewInvalidCredentials() *LDAPError
func NewInvalidDNSyntax ¶
func NewInvalidDNSyntax() *LDAPError
func NewInvalidPerSyntax ¶
func NewMoreThanOnceError ¶
func NewNoGlobalSuperiorKnowledge ¶
func NewNoGlobalSuperiorKnowledge() *LDAPError
func NewNoSuchAttribute ¶
func NewNoSuchObject ¶
func NewNoSuchObject() *LDAPError
func NewNotAllowedOnNonLeaf ¶
func NewNotAllowedOnNonLeaf() *LDAPError
func NewObjectClassViolation ¶
func NewObjectClassViolation() *LDAPError
func NewObjectClassViolationNoStructural ¶
func NewObjectClassViolationNoStructural() *LDAPError
func NewOperationsError ¶
func NewOperationsError() *LDAPError
func NewSuccess ¶
func NewSuccess() *LDAPError
func NewTypeOrValueExists ¶
func NewUnavailable ¶
func NewUnavailable() *LDAPError
func NewUndefinedType ¶
func (*LDAPError) IsAccountLocked ¶
func (*LDAPError) IsAccountLocking ¶
func (*LDAPError) IsInvalidCredentials ¶
func (*LDAPError) IsNoSuchObjectError ¶
type LDAPPassThroughClient ¶
type LDAPPassThroughClient struct { Server string SearchBase string Timeout int Filter string BindDN string Password string Scope string }
func (*LDAPPassThroughClient) Authenticate ¶
func (c *LDAPPassThroughClient) Authenticate(domain, user, password string) (bool, error)
type Mapper ¶
type Mapper struct {
// contains filtered or unexported fields
}
func (*Mapper) LDAPMessageToAddEntry ¶
type ModifyEntry ¶
type ModifyEntry struct {
// contains filtered or unexported fields
}
func NewModifyEntry ¶
func (*ModifyEntry) Add ¶
func (j *ModifyEntry) Add(attrName string, attrValue []string) error
Append to current value(s).
func (*ModifyEntry) ApplyCurrent ¶
func (j *ModifyEntry) ApplyCurrent(attrName string, attrValue []string) error
func (*ModifyEntry) Attrs ¶
func (j *ModifyEntry) Attrs() (map[string][]interface{}, map[string][]string)
func (*ModifyEntry) Clone ¶
func (e *ModifyEntry) Clone() *ModifyEntry
func (*ModifyEntry) DN ¶
func (j *ModifyEntry) DN() *DN
func (*ModifyEntry) Delete ¶
func (j *ModifyEntry) Delete(attrName string, attrValue []string) error
Delete from current value(s) if the value matchs.
func (*ModifyEntry) GetDNNorm ¶
func (j *ModifyEntry) GetDNNorm() string
func (*ModifyEntry) GetDNOrig ¶
func (j *ModifyEntry) GetDNOrig() string
func (*ModifyEntry) HasAttr ¶
func (j *ModifyEntry) HasAttr(attrName string) bool
func (*ModifyEntry) HasKey ¶
func (j *ModifyEntry) HasKey(s *AttributeType) bool
func (*ModifyEntry) ModifyRDN ¶
func (e *ModifyEntry) ModifyRDN(newDN *DN) *ModifyEntry
func (*ModifyEntry) ObjectClassesNorm ¶
func (j *ModifyEntry) ObjectClassesNorm() ([]string, bool)
func (*ModifyEntry) ObjectClassesOrig ¶
func (j *ModifyEntry) ObjectClassesOrig() ([]string, bool)
func (*ModifyEntry) Put ¶
func (j *ModifyEntry) Put(value *SchemaValue) error
func (*ModifyEntry) Replace ¶
func (j *ModifyEntry) Replace(attrName string, attrValue []string) error
Replace with the value(s).
func (*ModifyEntry) SetDN ¶
func (j *ModifyEntry) SetDN(dn *DN)
func (*ModifyEntry) Validate ¶
func (j *ModifyEntry) Validate() error
type NormString ¶
type ObjectClass ¶
type ObjectClass struct { Name string Oid string Sup string Structural bool Abstruct bool Auxiliary bool // contains filtered or unexported fields }
func (*ObjectClass) Contains ¶
func (o *ObjectClass) Contains(a string) bool
func (*ObjectClass) May ¶
func (o *ObjectClass) May() []string
func (*ObjectClass) Must ¶
func (o *ObjectClass) Must() []string
type PPolicy ¶
type PPolicy struct { PwdAttribute []string `json:"pwdAttribute"` PwdLockout []string `json:"pwdLockout"` PwdLockoutDuration []string `json:"pwdLockoutDuration"` PwdMaxFailure []string `json:"pwdMaxFailure"` }
func (*PPolicy) IsLockoutEnabled ¶
func (*PPolicy) LockoutDuration ¶
func (*PPolicy) MaxFailure ¶
func (*PPolicy) ShouldLockout ¶
type PassThroughClient ¶
type PassThroughConfig ¶
type PassThroughConfig map[string]PassThroughClient
func (PassThroughConfig) Add ¶
func (p PassThroughConfig) Add(domain string, client PassThroughClient)
func (PassThroughConfig) Get ¶
func (p PassThroughConfig) Get(domain string) (PassThroughClient, bool)
func (PassThroughConfig) Has ¶
func (p PassThroughConfig) Has(domain string) bool
type RelativeDN ¶
type RelativeDN struct {
Attributes []*AttributeTypeAndValue
}
func (*RelativeDN) NormStr ¶
func (r *RelativeDN) NormStr() string
func (*RelativeDN) OrigEncodedStr ¶
func (r *RelativeDN) OrigEncodedStr() string
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 *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 *DN) (*PPolicy, error) // Search handles search request by filter. // This is used for SEARCH operation. Search(ctx context.Context, baseDN *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 *DN, callback func(current *ModifyEntry) error) error // UpdateDN modifies the entry DN by specified change data. // This is used for MODRDN operation. UpdateDN(ctx context.Context, oldDN, newDN *DN, oldRDN *RelativeDN) error // Insert creates the entry by specified entry data. Insert(ctx context.Context, entry *AddEntry) (int64, error) // DeleteByDN deletes the entry by specified DN. DeleteByDN(ctx context.Context, dn *DN) error }
func NewRepository ¶
func NewRepository(server *Server) (Repository, error)
type RetryError ¶
type RetryError struct {
// contains filtered or unexported fields
}
func (*RetryError) Error ¶
func (e *RetryError) Error() string
func (*RetryError) Unwrap ¶
func (e *RetryError) Unwrap() error
type SchemaMap ¶
type SchemaMap struct { ObjectClasses map[string]*ObjectClass AttributeTypes map[string]*AttributeType // contains filtered or unexported fields }
func InitSchemaMap ¶
func (*SchemaMap) AttributeType ¶
func (s *SchemaMap) AttributeType(k string) (*AttributeType, bool)
func (*SchemaMap) ObjectClass ¶
func (s *SchemaMap) ObjectClass(k string) (*ObjectClass, bool)
func (*SchemaMap) PutAttributeType ¶
func (s *SchemaMap) PutAttributeType(k string, attributeType *AttributeType)
func (*SchemaMap) PutObjectClass ¶
func (s *SchemaMap) PutObjectClass(k string, objectClass *ObjectClass)
func (*SchemaMap) ValidateObjectClass ¶
func (s *SchemaMap) ValidateObjectClass(ocs []string, attrs map[string]*SchemaValue) *LDAPError
type SchemaValue ¶
type SchemaValue struct {
// contains filtered or unexported fields
}
func NewSchemaValue ¶
func NewSchemaValue(schemaMap *SchemaMap, attrName string, attrValue []string) (*SchemaValue, error)
func (*SchemaValue) Add ¶
func (s *SchemaValue) Add(value *SchemaValue) error
func (*SchemaValue) Clone ¶
func (s *SchemaValue) Clone() *SchemaValue
func (*SchemaValue) Delete ¶
func (s *SchemaValue) Delete(value *SchemaValue) error
func (*SchemaValue) Equals ¶
func (s *SchemaValue) Equals(value *SchemaValue) bool
func (*SchemaValue) HasDuplicate ¶
func (s *SchemaValue) HasDuplicate(value *SchemaValue) bool
func (*SchemaValue) IsAssociationAttribute ¶
func (s *SchemaValue) IsAssociationAttribute() bool
func (*SchemaValue) IsEmpty ¶
func (s *SchemaValue) IsEmpty() bool
func (*SchemaValue) IsNoUserModification ¶
func (s *SchemaValue) IsNoUserModification() bool
func (*SchemaValue) IsNoUserModificationWithMigrationDisabled ¶
func (s *SchemaValue) IsNoUserModificationWithMigrationDisabled() bool
func (*SchemaValue) IsSingle ¶
func (s *SchemaValue) IsSingle() bool
func (*SchemaValue) LanguageTag ¶ added in v0.12.2
func (s *SchemaValue) LanguageTag() string
func (*SchemaValue) Name ¶
func (s *SchemaValue) Name() string
func (*SchemaValue) Norm ¶
func (s *SchemaValue) Norm() []interface{}
func (*SchemaValue) NormStr ¶
func (s *SchemaValue) NormStr() []string
func (*SchemaValue) Orig ¶
func (s *SchemaValue) Orig() []string
type SchemaValueMap ¶
type SchemaValueMap struct {
// contains filtered or unexported fields
}
func (SchemaValueMap) Has ¶
func (m SchemaValueMap) Has(val string) bool
func (SchemaValueMap) Put ¶
func (m SchemaValueMap) Put(val string)
type SearchEntry ¶
type SearchEntry struct {
// contains filtered or unexported fields
}
func NewSearchEntry ¶
func NewSearchEntry(schemaMap *SchemaMap, dnOrig string, valuesOrig map[string][]string) *SearchEntry
func (*SearchEntry) DNOrig ¶
func (j *SearchEntry) DNOrig() string
func (*SearchEntry) GetAttrOrig ¶
func (j *SearchEntry) GetAttrOrig(attrName string) (string, []string, bool)
func (*SearchEntry) GetAttrsOrig ¶
func (j *SearchEntry) GetAttrsOrig() map[string][]string
func (*SearchEntry) GetAttrsOrigWithoutOperationalAttrs ¶
func (j *SearchEntry) GetAttrsOrigWithoutOperationalAttrs() map[string][]string
func (*SearchEntry) GetOperationalAttrsOrig ¶
func (j *SearchEntry) GetOperationalAttrsOrig() map[string][]string
type SearchOption ¶
type Server ¶
type Server struct { Suffix *DN // contains filtered or unexported fields }
func NewServer ¶
func NewServer(c *ServerConfig) *Server
func (*Server) LoadSchema ¶
func (s *Server) LoadSchema()
func (*Server) Repo ¶
func (s *Server) Repo() Repository
func (*Server) RequiredAuthz ¶
func (*Server) SuffixNorm ¶
func (*Server) SuffixOrig ¶
func (*Server) SuffixOrigStr ¶
type ServerConfig ¶
type ServerConfig struct { DBHostName string DBPort int DBName string DBSchema string DBUser string DBPassword string DBMaxOpenConns int DBMaxIdleConns int Suffix string RootDN string RootPW string PassThroughConfig *PassThroughConfig BindAddress string LogLevel string PProfServer string GoMaxProcs int MigrationEnabled bool QueryTranslator string SimpleACL []string DefaultPPolicyDN string }
type SimpleACL ¶
type SimpleACL struct {
// contains filtered or unexported fields
}
func NewSimpleACL ¶
func (*SimpleACL) CanRead ¶
func (s *SimpleACL) CanRead(session *AuthSession) bool
func (*SimpleACL) CanVisible ¶
func (s *SimpleACL) CanVisible(session *AuthSession, attrName string) bool
func (*SimpleACL) CanWrite ¶
func (s *SimpleACL) CanWrite(session *AuthSession) bool
type SimpleACLDef ¶
type SimpleACLDef struct { Scope SimpleACLScopeSet InvisibleAttributes StringSet }
type SimpleACLScope ¶
type SimpleACLScope int
const ( ReadScope SimpleACLScope = iota WriteScope )
func (SimpleACLScope) String ¶
func (c SimpleACLScope) String() string
type SimpleACLScopeSet ¶
type SimpleACLScopeSet map[SimpleACLScope]struct{}
func (SimpleACLScopeSet) Add ¶
func (s SimpleACLScopeSet) Add(scope SimpleACLScope)
func (SimpleACLScopeSet) Contains ¶
func (s SimpleACLScopeSet) Contains(scope SimpleACLScope) bool
type StmtCache ¶
type StmtCache struct {
// contains filtered or unexported fields
}
For generic filter
Source Files ¶
- acl.go
- add_entry.go
- dn.go
- error.go
- handler_add.go
- handler_bind.go
- handler_compare.go
- handler_delete.go
- handler_modify.go
- handler_modifydn.go
- handler_search_dse.go
- handler_search_generic.go
- handler_search_rootdn.go
- handler_search_schema.go
- lang_tag.go
- mapper.go
- modify_entry.go
- pass_through.go
- password_hash.go
- ppolicy.go
- repo.go
- repo_hybrid.go
- schema.go
- schema_openldap.go
- search_entry.go
- server.go
- util.go