schema

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemaName   = "ldap"
	MethodPlain  = "ldap"
	MethodSecure = "ldaps"
	PortPlain    = 389
	PortSecure   = 636

	// Time between connection retries
	MinRetryInterval = time.Second * 5
	MaxRetries       = 10

	// Maximum number of entries to return in a single request
	MaxListPaging = 500

	// Maximum list entries to return
	MaxListEntries = 1000

	// Attributes
	AttrObjectClasses  = "objectClasses"
	AttrAttributeTypes = "attributeTypes"
	AttrSubSchemaDN    = "subschemaSubentry"

	// Initial GID/UID allocated when the lastgid/lastuid device entry is first created
	InitialGID = 1000
	InitialUID = 1000
)

Variables

View Source
var DefaultGroupObjectClasses = []string{"groupOfNames"}

DefaultGroupObjectClasses is used when no group object classes are configured.

View Source
var DefaultUserObjectClasses = []string{"inetOrgPerson"}

DefaultUserObjectClasses is used when no user object classes are configured.

View Source
var WellKnownGroupClasses = []string{"group", "posixGroup", "groupOfNames", "groupOfUniqueNames", "groupOfMembers"}

WellKnownGroupClasses is the list of object classes checked during auto-discovery.

View Source
var WellKnownUserAuxiliaryClasses = []string{"posixAccount"}

WellKnownUserAuxiliaryClasses is the list of auxiliary user classes checked during auto-discovery.

View Source
var WellKnownUserClasses = []string{"user", "inetOrgPerson", "organizationalPerson", "person", "account"}

WellKnownUserClasses is the list of structural object classes checked during auto-discovery.

Functions

This section is empty.

Types

type AttributeType

type AttributeType struct {
	*schemadef.AttributeTypeSchema
}

func ParseAttributeType

func ParseAttributeType(v string) (*AttributeType, error)

func (*AttributeType) Identifier

func (o *AttributeType) Identifier() string

func (*AttributeType) Matches

func (AttributeType) String

func (o AttributeType) String() string

type AttributeTypeListRequest

type AttributeTypeListRequest struct {
	pg.OffsetLimit
	Filter             *string         `json:"filter,omitempty" help:"Exact attribute name or OID match (case-insensitive for names)" arg:"" optional:""`
	Usage              *AttributeUsage `json:"usage,omitempty" help:"Attribute usage" enum:"userApplications,directoryOperation,distributedOperation,dSAOperation"`
	Superior           *string         `json:"superior,omitempty" help:"Exact superior attribute type match"`
	Obsolete           *bool           `json:"obsolete,omitempty" help:"Filter obsolete attribute types"`
	SingleValue        *bool           `json:"singleValue,omitempty" help:"Filter single-value attribute types" name:"single-value"`
	Collective         *bool           `json:"collective,omitempty" help:"Filter collective attribute types"`
	NoUserModification *bool           `json:"noUserModification,omitempty" help:"Filter non-user-modifiable attribute types" name:"no-user-modification"`
}

func (AttributeTypeListRequest) Query

func (req AttributeTypeListRequest) Query() url.Values

func (AttributeTypeListRequest) String

func (o AttributeTypeListRequest) String() string

type AttributeTypeListResponse

type AttributeTypeListResponse struct {
	Count uint64           `json:"count" help:"Total number of matching attribute types before pagination"`
	Body  []*AttributeType `json:"body,omitempty" help:"Attribute types returned for the current page"`
}

func (AttributeTypeListResponse) String

func (o AttributeTypeListResponse) String() string

type AttributeUsage

type AttributeUsage string

func (AttributeUsage) String

func (o AttributeUsage) String() string

type DN

type DN ldap.DN

func NewDN

func NewDN(v string) (*DN, error)

func (*DN) AncestorOf

func (dn *DN) AncestorOf(other *DN) bool

func (*DN) Join

func (dn *DN) Join(other *DN) *DN

func (*DN) String

func (dn *DN) String() string

type Group

type Group struct {
	DN          *DN      `json:"dn,omitempty"`
	ObjectClass []string `json:"objectclass,omitempty"`
}

type Object

type Object struct {
	DN         string `json:"dn"`
	url.Values `json:"attrs,omitempty"`
}

func NewObject

func NewObject(v ...string) *Object

func NewObjectFromEntry

func NewObjectFromEntry(entry *ldap.Entry) *Object

func (*Object) Get

func (o *Object) Get(attr string) *string

Returns an attribute value or nil if not found

func (*Object) GetAll

func (o *Object) GetAll(attr string) []string

Returns array or attributes or nil if not found

func (Object) LDIF

func (o Object) LDIF() string

func (Object) String

func (o Object) String() string

func (*Object) WithPassword

func (o *Object) WithPassword(password *string) *PasswordResponse

WithPassword embeds a generated password into the response object using the PasswordResponse wrapper. An empty password leaves the password field unset.

type ObjectClass

type ObjectClass struct {
	*schemadef.ObjectClassSchema
}

func ParseObjectClass

func ParseObjectClass(v string) (*ObjectClass, error)

func (*ObjectClass) Identifier

func (o *ObjectClass) Identifier() string

func (*ObjectClass) Matches

func (o *ObjectClass) Matches(req ObjectClassListRequest) bool

func (ObjectClass) String

func (o ObjectClass) String() string

type ObjectClassKind

type ObjectClassKind string

func (ObjectClassKind) String

func (o ObjectClassKind) String() string

type ObjectClassListRequest

type ObjectClassListRequest struct {
	pg.OffsetLimit
	Filter   *string          `json:"filter,omitempty" help:"Exact class name or OID match (case-insensitive for names)" arg:"" optional:""`
	Kind     *ObjectClassKind `json:"kind,omitempty" help:"Class kind" enum:"ABSTRACT,STRUCTURAL,AUXILIARY"`
	Superior []string         `json:"superior,omitempty" help:"Required superior classes"`
	Must     []string         `json:"must,omitempty" help:"Required MUST attributes"`
	May      []string         `json:"may,omitempty" help:"Required MAY attributes"`
	Obsolete *bool            `json:"obsolete,omitempty" help:"Filter obsolete classes"`
}

func (ObjectClassListRequest) Query

func (req ObjectClassListRequest) Query() url.Values

func (ObjectClassListRequest) String

func (o ObjectClassListRequest) String() string

type ObjectClassListResponse

type ObjectClassListResponse struct {
	Count uint64         `json:"count" help:"Total number of matching object classes before pagination"`
	Body  []*ObjectClass `json:"body,omitempty" help:"Object classes returned for the current page"`
}

func (ObjectClassListResponse) String

func (o ObjectClassListResponse) String() string

type ObjectList

type ObjectList struct {
	Count uint64    `json:"count"`
	Body  []*Object `json:"body,omitempty"`
}

func (ObjectList) LDIF

func (o ObjectList) LDIF() string

func (ObjectList) String

func (o ObjectList) String() string

type ObjectListRequest

type ObjectListRequest struct {
	pg.OffsetLimit
	Filter *string  `json:"filter,omitempty" help:"Filter"`
	Attr   []string `json:"attr,omitempty" help:"Attributes to return"`
}

func (ObjectListRequest) Query

func (req ObjectListRequest) Query() url.Values

func (ObjectListRequest) String

func (o ObjectListRequest) String() string

type ObjectPasswordRequest

type ObjectPasswordRequest struct {
	Old string  `json:"old,omitempty"`
	New *string `json:"new,omitempty"`
}

func (ObjectPasswordRequest) String

func (o ObjectPasswordRequest) String() string

type ObjectPutRequest

type ObjectPutRequest struct {
	Attrs url.Values `json:"attrs"`
}

func (ObjectPutRequest) String

func (o ObjectPutRequest) String() string

func (ObjectPutRequest) ValidateCreate

func (req ObjectPutRequest) ValidateCreate() (url.Values, error)

func (ObjectPutRequest) ValidateUpdate

func (req ObjectPutRequest) ValidateUpdate() (url.Values, error)

type PasswordResponse

type PasswordResponse struct {
	Object
	GeneratedPassword string `json:"generated-password,omitempty"`
}

func (PasswordResponse) LDIF

func (o PasswordResponse) LDIF() string

func (PasswordResponse) String

func (o PasswordResponse) String() string

Jump to

Keyboard shortcuts

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