schema

package
v1.4.15 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/11972272-09ec-4a42-bf5e-3e99b321cf55
	GROUP_TYPE_BUILTIN_LOCAL_GROUP = 0x00000001
	GROUP_TYPE_ACCOUNT_GROUP       = 0x00000002
	GROUP_TYPE_RESOURCE_GROUP      = 0x00000004
	GROUP_TYPE_UNIVERSAL_GROUP     = 0x00000008
	GROUP_TYPE_APP_BASIC_GROUP     = 0x00000010
	GROUP_TYPE_APP_QUERY_GROUP     = 0x00000020
	GROUP_TYPE_SECURITY_ENABLED    = 0x80000000
)
View Source
const (
	// https://learn.microsoft.com/en-us/troubleshoot/windows-server/active-directory/useraccountcontrol-manipulate-account-properties
	USER_SCRIPT                         = 0x00000001
	USER_ACCOUNTDISABLE                 = 0x00000002
	USER_HOMEDIR_REQUIRED               = 0x00000008
	USER_LOCKOUT                        = 0x00000010
	USER_PASSWD_NOTREQD                 = 0x00000020
	USER_PASSWD_CANT_CHANGE             = 0x00000040
	USER_ENCRYPTED_TEXT_PWD_ALLOWED     = 0x00000080
	USER_TEMP_DUPLICATE_ACCOUNT         = 0x00000100
	USER_NORMAL_ACCOUNT                 = 0x00000200
	USER_INTERDOMAIN_TRUST_ACCOUNT      = 0x00000800
	USER_WORKSTATION_TRUST_ACCOUNT      = 0x00001000
	USER_SERVER_TRUST_ACCOUNT           = 0x00002000
	USER_DONT_EXPIRE_PASSWORD           = 0x00010000
	USER_MNS_LOGON_ACCOUNT              = 0x00020000
	USER_SMARTCARD_REQUIRED             = 0x00040000
	USER_TRUSTED_FOR_DELEGATION         = 0x00080000
	USER_NOT_DELEGATED                  = 0x00100000
	USER_USE_DES_KEY_ONLY               = 0x00200000
	USER_DONT_REQ_PREAUTH               = 0x00400000
	USER_PASSWORD_EXPIRED               = 0x00800000
	USER_TRUSTED_TO_AUTH_FOR_DELEGATION = 0x01000000
	USER_PARTIAL_SECRETS_ACCOUNT        = 0x04000000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr func(*Object) error

func OptDescription

func OptDescription(v string) Attr

Set description

func OptGroupId

func OptGroupId(v int) Attr

Set Group ID

func OptHomeDirectory

func OptHomeDirectory(v string) Attr

Set Home Directory

func OptLoginShell

func OptLoginShell(v string) Attr

Set Login Shell

func OptMail

func OptMail(v string) Attr

Set Mail

func OptName

func OptName(givenName, surname string) Attr

Set Name

func OptUserId

func OptUserId(v int) Attr

Set User ID

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 *goldap.Entry) *Object

func (*Object) GroupId

func (o *Object) GroupId() int

Return gidNumber as an integer, returning -1 if not set

func (*Object) Set

func (o *Object) Set(attr string, values ...string)

func (*Object) String

func (o *Object) String() string

func (*Object) UserId

func (o *Object) UserId() int

Return uidNumber as an integer, returning -1 if not set

type Schema

type Schema struct {
	UserOU           string   `hcl:"user-ou,optional" description:"User Organisational Unit"`
	GroupOU          string   `hcl:"group-ou,optional" description:"Group Organisational Unit"`
	UserObjectClass  []string `hcl:"user-object-class,optional" description:"User object class"`
	GroupObjectClass []string `hcl:"group-object-class,optional" description:"Group object class"`
}

Schema is the schema for the LDAP server

func (Schema) NewGroup

func (s Schema) NewGroup(dn, name string, attrs ...Attr) (*Object, error)

Returns a new group object

func (Schema) NewUser

func (s Schema) NewUser(dn, name string, attrs ...Attr) (*Object, error)

Returns a new user object

Jump to

Keyboard shortcuts

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