Documentation ¶
Index ¶
- Constants
- Variables
- type AttributeType
- func (s *AttributeType) IsAssociationAttribute() bool
- func (s *AttributeType) IsCaseIgnore() bool
- func (s *AttributeType) IsCaseIgnoreSubstr() bool
- func (s *AttributeType) IsNanoFormat() bool
- func (s *AttributeType) IsNumberOrdering() bool
- func (s *AttributeType) IsObjectClass() bool
- func (s *AttributeType) IsOperationalAttribute() bool
- func (s *AttributeType) IsReverseAssociationAttribute() bool
- func (s *AttributeType) NewSchemaValueMap(size int) SchemaValueMap
- func (a *AttributeType) Schema() *SchemaRegistry
- type AttributeTypeAndValue
- 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) IsSuffix(suffix *DN) bool
- func (d *DN) Level() int
- func (d *DN) LevelWithoutSuffix(suffix *DN) int
- func (d *DN) ModifyRDN(sr *SchemaRegistry, newRDN string, deleteOld bool) (*DN, *RelativeDN, bool, 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 DNCache
- type NormString
- type ObjectClass
- type PPolicy
- type RelativeDN
- type SchemaConfig
- type SchemaRegistry
- func (s *SchemaRegistry) AttributeType(k string) (*AttributeType, bool)
- func (s *SchemaRegistry) Dump() string
- func (s *SchemaRegistry) NormalizeDN(dn string) (*DN, error)
- func (s *SchemaRegistry) ObjectClass(k string) (*ObjectClass, bool)
- func (s *SchemaRegistry) PutAttributeType(k string, attributeType *AttributeType)
- func (s *SchemaRegistry) PutObjectClass(k string, objectClass *ObjectClass)
- func (s *SchemaRegistry) ValidateObjectClass(ocs []string, attrs map[string]*SchemaValue) *util.LDAPError
- type SchemaValue
- func (s *SchemaValue) Add(value *SchemaValue) error
- func (s *SchemaValue) Clear()
- func (s *SchemaValue) Clone() *SchemaValue
- func (s *SchemaValue) Contains(valueNorm string) bool
- func (s *SchemaValue) Delete(value *SchemaValue) error
- func (s *SchemaValue) Diff(base *SchemaValue) ([]string, []string, []string)
- func (s *SchemaValue) Equal(value *SchemaValue) bool
- func (s *SchemaValue) HasDuplicate(value *SchemaValue) (bool, int)
- func (s *SchemaValue) IsAssociationAttribute() bool
- func (s *SchemaValue) IsEmpty() bool
- func (s *SchemaValue) IsNoUserModification() bool
- func (s *SchemaValue) IsNoUserModificationWithMigrationDisabled() bool
- func (s *SchemaValue) IsReverseAssociationAttribute() bool
- func (s *SchemaValue) IsSingle() bool
- func (s *SchemaValue) Name() string
- func (s *SchemaValue) Norm() []interface{}
- func (s *SchemaValue) NormStr() []string
- func (s *SchemaValue) Normalize() error
- func (s *SchemaValue) Orig() []string
- func (s *SchemaValue) Schema() *AttributeType
- type SchemaValueMap
Constants ¶
View Source
const DNCacheContextKey = "dn"
View Source
const TIMESTAMP_FORMAT string = "20060102150405Z"
View Source
const TIMESTAMP_NANO_FORMAT string = "20060102150405.000000Z"
Variables ¶
View Source
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
View Source
var LASTBIND_OPERATION_SCHEMA_OPENLDAP24 = `` /* 284-byte string literal not displayed */
View Source
var PPOLICY_OPERATION_SCHEMA_OPENLDAP24 = `` /* 573-byte string literal not displayed */
View Source
var SCHEMA_OPENLDAP24 = BASE_SCHEMA_OPENLDAP24 + PPOLICY_OPERATION_SCHEMA_OPENLDAP24 + LASTBIND_OPERATION_SCHEMA_OPENLDAP24
View Source
var SPACE_PATTERN = regexp.MustCompile(`\s+`)
Functions ¶
This section is empty.
Types ¶
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 // 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) IsNanoFormat ¶
func (s *AttributeType) IsNanoFormat() bool
func (*AttributeType) IsNumberOrdering ¶
func (s *AttributeType) IsNumberOrdering() bool
func (*AttributeType) IsObjectClass ¶
func (s *AttributeType) IsObjectClass() 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
func (*AttributeType) Schema ¶
func (a *AttributeType) Schema() *SchemaRegistry
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 DN ¶
type DN struct { RDNs []*RelativeDN RDNIndex map[string]NormString }
func NormalizeDN ¶
func NormalizeDN(sr *SchemaRegistry, dn string) (*DN, error)
func ParseDN ¶
func ParseDN(sr *SchemaRegistry, str string) (*DN, error)
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) LevelWithoutSuffix ¶
func (*DN) ModifyRDN ¶
func (d *DN) ModifyRDN(sr *SchemaRegistry, newRDN string, deleteOld bool) (*DN, *RelativeDN, bool, error)
func (*DN) RDN ¶
func (d *DN) RDN() map[string]NormString
func (*DN) RDNNormStr ¶
func (*DN) RDNOrigEncodedStr ¶
type DNCache ¶
type DNCache struct { Itoa map[int64]*DN Itoao map[int64]string // id => dnOrig Atoi map[string]int64 }
func NewDnCache ¶
func NewDnCache() *DNCache
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 NewDefaultPPolicy ¶
func NewDefaultPPolicy() *PPolicy
func (*PPolicy) IsLockoutEnabled ¶
func (*PPolicy) LockoutDuration ¶
func (*PPolicy) MaxFailure ¶
func (*PPolicy) ShouldLockout ¶
type RelativeDN ¶
type RelativeDN struct {
Attributes []*AttributeTypeAndValue
}
func (*RelativeDN) NormStr ¶
func (r *RelativeDN) NormStr() string
func (*RelativeDN) OrigEncodedStr ¶
func (r *RelativeDN) OrigEncodedStr() string
type SchemaConfig ¶
type SchemaRegistry ¶
type SchemaRegistry struct { Config *SchemaConfig ObjectClasses map[string]*ObjectClass AttributeTypes map[string]*AttributeType SuffixDN *DN RootDN *DN DefaultPPolicyDN *DN }
func NewSchema ¶
func NewSchema(config *SchemaConfig) *SchemaRegistry
func NewSchemaRegistry ¶
func NewSchemaRegistry(config *SchemaConfig) *SchemaRegistry
func (*SchemaRegistry) AttributeType ¶
func (s *SchemaRegistry) AttributeType(k string) (*AttributeType, bool)
func (*SchemaRegistry) Dump ¶
func (s *SchemaRegistry) Dump() string
func (*SchemaRegistry) NormalizeDN ¶
func (s *SchemaRegistry) NormalizeDN(dn string) (*DN, error)
func (*SchemaRegistry) ObjectClass ¶
func (s *SchemaRegistry) ObjectClass(k string) (*ObjectClass, bool)
func (*SchemaRegistry) PutAttributeType ¶
func (s *SchemaRegistry) PutAttributeType(k string, attributeType *AttributeType)
func (*SchemaRegistry) PutObjectClass ¶
func (s *SchemaRegistry) PutObjectClass(k string, objectClass *ObjectClass)
func (*SchemaRegistry) ValidateObjectClass ¶
func (s *SchemaRegistry) ValidateObjectClass(ocs []string, attrs map[string]*SchemaValue) *util.LDAPError
type SchemaValue ¶
type SchemaValue struct {
// contains filtered or unexported fields
}
func NewSchemaValue ¶
func NewSchemaValue(sr *SchemaRegistry, attrName string, attrValue []string) (*SchemaValue, error)
func (*SchemaValue) Add ¶
func (s *SchemaValue) Add(value *SchemaValue) error
func (*SchemaValue) Clear ¶
func (s *SchemaValue) Clear()
func (*SchemaValue) Clone ¶
func (s *SchemaValue) Clone() *SchemaValue
func (*SchemaValue) Contains ¶
func (s *SchemaValue) Contains(valueNorm string) bool
func (*SchemaValue) Delete ¶
func (s *SchemaValue) Delete(value *SchemaValue) error
func (*SchemaValue) Diff ¶
func (s *SchemaValue) Diff(base *SchemaValue) ([]string, []string, []string)
func (*SchemaValue) Equal ¶
func (s *SchemaValue) Equal(value *SchemaValue) bool
func (*SchemaValue) HasDuplicate ¶
func (s *SchemaValue) HasDuplicate(value *SchemaValue) (bool, int)
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) IsReverseAssociationAttribute ¶
func (s *SchemaValue) IsReverseAssociationAttribute() bool
func (*SchemaValue) IsSingle ¶
func (s *SchemaValue) IsSingle() bool
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) Normalize ¶
func (s *SchemaValue) Normalize() error
normalize the value using schema definition. The value is expected as a valid value. It means you need to validte the value in advance.
func (*SchemaValue) Orig ¶
func (s *SchemaValue) Orig() []string
func (*SchemaValue) Schema ¶
func (s *SchemaValue) Schema() *AttributeType
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)
Click to show internal directories.
Click to hide internal directories.