Skip to content

Commit bab0be5

Browse files
authored
Added all Microsoft LDAP OIDs (#559)
* Added all Microsoft LDAP OIDs * Fixed unit tests mismatch in expected strings * Reverted name changes of existing OIDs to allow backwards compatibility * Reverted name changes of existing OIDs to allow backwards compatibility
1 parent 109b1fc commit bab0be5

File tree

2 files changed

+152
-24
lines changed

2 files changed

+152
-24
lines changed

v3/control.go

Lines changed: 151 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,86 @@ const (
2929
// ControlTypeServerSideSorting - https://www.ietf.org/rfc/rfc2891.txt
3030
ControlTypeServerSideSortingResult = "1.2.840.113556.1.4.474"
3131

32-
// ControlTypeMicrosoftNotification - https://msdn.microsoft.com/en-us/library/aa366983(v=vs.85).aspx
32+
// ControlTypeMicrosoftPagedResults - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
33+
ControlTypeMicrosoftPagedResults = "1.2.840.113556.1.4.319"
34+
// ControlTypeMicrosoftCrossDomainMoveTarget - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
35+
ControlTypeMicrosoftCrossDomainMoveTarget = "1.2.840.113556.1.4.521"
36+
// ControlTypeDirSync - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
37+
ControlTypeDirSync = "1.2.840.113556.1.4.841"
38+
// ControlTypeMicrosoftDomainScope - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
39+
ControlTypeMicrosoftDomainScope = "1.2.840.113556.1.4.1339"
40+
// ControlTypeMicrosoftExtendedDN - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
41+
ControlTypeMicrosoftExtendedDN = "1.2.840.113556.1.4.529"
42+
// ControlTypeMicrosoftGetStats - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
43+
ControlTypeMicrosoftGetStats = "1.2.840.113556.1.4.970"
44+
// ControlTypeMicrosoftLazyCommit - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
45+
ControlTypeMicrosoftLazyCommit = "1.2.840.113556.1.4.619"
46+
// ControlTypeMicrosoftPermissiveModify - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
47+
ControlTypeMicrosoftPermissiveModify = "1.2.840.113556.1.4.1413"
48+
// ControlTypeMicrosoftNotification - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
3349
ControlTypeMicrosoftNotification = "1.2.840.113556.1.4.528"
34-
// ControlTypeMicrosoftShowDeleted - https://msdn.microsoft.com/en-us/library/aa366989(v=vs.85).aspx
50+
// ControlTypeMicrosoftRespSort - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
51+
ControlTypeMicrosoftRespSort = "1.2.840.113556.1.4.474"
52+
// ControlTypeMicrosoftSDFlags - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
53+
ControlTypeMicrosoftSDFlags = "1.2.840.113556.1.4.801"
54+
// ControlTypeMicrosoftSearchOptions - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
55+
ControlTypeMicrosoftSearchOptions = "1.2.840.113556.1.4.1340"
56+
// ControlTypeMicrosoftSort - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
57+
ControlTypeMicrosoftSort = "1.2.840.113556.1.4.473"
58+
// ControlTypeMicrosoftShowDeleted - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
3559
ControlTypeMicrosoftShowDeleted = "1.2.840.113556.1.4.417"
36-
// ControlTypeMicrosoftServerLinkTTL - https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/f4f523a8-abc0-4b3a-a471-6b2fef135481?redirectedfrom=MSDN
60+
// ControlTypeMicrosoftTreeDelete - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
61+
ControlTypeMicrosoftTreeDelete = "1.2.840.113556.1.4.805"
62+
// ControlTypeMicrosoftVerifyName - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
63+
ControlTypeMicrosoftVerifyName = "1.2.840.113556.1.4.1338"
64+
// ControlTypeVLVRequest - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
65+
ControlTypeVLVRequest = "2.16.840.1.113730.3.4.9"
66+
// ControlTypeVLVResponse - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
67+
ControlTypeVLVResponse = "2.16.840.1.113730.3.4.10"
68+
// ControlTypeMicrosoftASQ - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
69+
ControlTypeMicrosoftASQ = "1.2.840.113556.1.4.1504"
70+
// ControlTypeMicrosoftQuotaControl - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
71+
ControlTypeMicrosoftQuotaControl = "1.2.840.113556.1.4.1852"
72+
// ControlTypeMicrosoftRangeOption - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
73+
ControlTypeMicrosoftRangeOption = "1.2.840.113556.1.4.802"
74+
// ControlTypeMicrosoftShutdownNotify - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
75+
ControlTypeMicrosoftShutdownNotify = "1.2.840.113556.1.4.1907"
76+
// ControlTypeMicrosoftForceUpdate - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
77+
ControlTypeMicrosoftForceUpdate = "1.2.840.113556.1.4.1974"
78+
// ControlTypeMicrosoftRangeRetrievalNoErr - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
79+
ControlTypeMicrosoftRangeRetrievalNoErr = "1.2.840.113556.1.4.1948"
80+
// ControlTypeMicrosoftRODCDCPromo - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
81+
ControlTypeMicrosoftRODCDCPromo = "1.2.840.113556.1.4.1341"
82+
// ControlTypeMicrosoftDNInput - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
83+
ControlTypeMicrosoftDNInput = "1.2.840.113556.1.4.2026"
84+
// ControlTypeMicrosoftShowDeactivatedLink - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
85+
ControlTypeMicrosoftShowDeactivatedLink = "1.2.840.113556.1.4.2065"
86+
// ControlTypeMicrosoftShowRecycled - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
87+
ControlTypeMicrosoftShowRecycled = "1.2.840.113556.1.4.2064"
88+
// ControlTypeMicrosoftPolicyHintsDeprecated - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
89+
ControlTypeMicrosoftPolicyHintsDeprecated = "1.2.840.113556.1.4.2066"
90+
// ControlTypeMicrosoftDirSyncEX - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
91+
ControlTypeMicrosoftDirSyncEX = "1.2.840.113556.1.4.2090"
92+
// ControlTypeMicrosoftUpdateStats - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
93+
ControlTypeMicrosoftUpdateStats = "1.2.840.113556.1.4.2205"
94+
// ControlTypeMicrosoftTreeDeleteEX - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
95+
ControlTypeMicrosoftTreeDeleteEX = "1.2.840.113556.1.4.2204"
96+
// ControlTypeMicrosoftSearchHints - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
97+
ControlTypeMicrosoftSearchHints = "1.2.840.113556.1.4.2206"
98+
// ControlTypeMicrosoftExpectedEntryCount - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
99+
ControlTypeMicrosoftExpectedEntryCount = "1.2.840.113556.1.4.2211"
100+
// ControlTypeMicrosoftPolicyHints - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
101+
ControlTypeMicrosoftPolicyHints = "1.2.840.113556.1.4.2239"
102+
// ControlTypeMicrosoftSetOwner - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
103+
ControlTypeMicrosoftSetOwner = "1.2.840.113556.1.4.2255"
104+
// ControlTypeMicrosoftBypassQuota - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
105+
ControlTypeMicrosoftBypassQuota = "1.2.840.113556.1.4.2256"
106+
// ControlTypeMicrosoftServerLinkTTL - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
37107
ControlTypeMicrosoftServerLinkTTL = "1.2.840.113556.1.4.2309"
38-
// ControlTypeDirSync - Active Directory DirSync - https://msdn.microsoft.com/en-us/library/aa366978(v=vs.85).aspx
39-
ControlTypeDirSync = "1.2.840.113556.1.4.841"
108+
// ControlTypeMicrosoftSetCorrelationID - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
109+
ControlTypeMicrosoftSetCorrelationID = "1.2.840.113556.1.4.2330"
110+
// ControlTypeMicrosoftThreadTraceOverride - https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea
111+
ControlTypeMicrosoftThreadTraceOverride = "1.2.840.113556.1.4.2354"
40112

41113
// ControlTypeSyncRequest - https://www.ietf.org/rfc/rfc4533.txt
42114
ControlTypeSyncRequest = "1.3.6.1.4.1.4203.1.9.1.1"
@@ -49,29 +121,85 @@ const (
49121
)
50122

51123
// Flags for DirSync control
124+
// Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/2213a7f2-0a36-483c-b2a4-8574d53aa1e3
52125
const (
53-
DirSyncIncrementalValues int64 = 2147483648
54-
DirSyncPublicDataOnly int64 = 8192
55-
DirSyncAncestorsFirstOrder int64 = 2048
56-
DirSyncObjectSecurity int64 = 1
126+
// Windows Server 2003 and later: If this flag is not present, all of the values,
127+
// up to a server-specified limit, in a multivalued attribute are returned when
128+
// any value changes. If this flag is present, only the changed values are
129+
// returned, provided the attribute is a forward link value.
130+
// Windows 2000: Not supported.
131+
DirSyncIncrementalValues int64 = 0x80000000
132+
133+
// Do not return private data in the search results.
134+
// Windows Server 2003 and later: This flag can optionally be passed to the DC,
135+
// but it has no effect.
136+
// Windows 2000: Not supported.
137+
DirSyncPublicDataOnly int64 = 0x00002000
138+
139+
// Return parent objects before child objects, otherwise parent
140+
// objects would appear later in the replication stream.
141+
DirSyncAncestorsFirstOrder int64 = 0x00000800
142+
143+
// Windows Server 2003 operating system and later: If this flag is present,
144+
// the client can only view objects and attributes that are otherwise accessible
145+
// to the client. If this flag is not present, the server checks if the client
146+
// has access rights to read the changes in the NC.
147+
// Windows 2000 operating system: Not supported.
148+
DirSyncObjectSecurity int64 = 0x00000001
57149
)
58150

59151
// ControlTypeMap maps controls to text descriptions
60152
var ControlTypeMap = map[string]string{
61-
ControlTypePaging: "Paging",
62-
ControlTypeBeheraPasswordPolicy: "Password Policy - Behera Draft",
63-
ControlTypeManageDsaIT: "Manage DSA IT",
64-
ControlTypeSubtreeDelete: "Subtree Delete Control",
65-
ControlTypeMicrosoftNotification: "Change Notification - Microsoft",
66-
ControlTypeMicrosoftShowDeleted: "Show Deleted Objects - Microsoft",
67-
ControlTypeMicrosoftServerLinkTTL: "Return TTL-DNs for link values with associated expiry times - Microsoft",
68-
ControlTypeServerSideSorting: "Server Side Sorting Request - LDAP Control Extension for Server Side Sorting of Search Results (RFC2891)",
69-
ControlTypeServerSideSortingResult: "Server Side Sorting Results - LDAP Control Extension for Server Side Sorting of Search Results (RFC2891)",
70-
ControlTypeDirSync: "DirSync",
71-
ControlTypeSyncRequest: "Sync Request",
72-
ControlTypeSyncState: "Sync State",
73-
ControlTypeSyncDone: "Sync Done",
74-
ControlTypeSyncInfo: "Sync Info",
153+
ControlTypePaging: "Paging",
154+
ControlTypeBeheraPasswordPolicy: "Password Policy - Behera Draft",
155+
ControlTypeVChuPasswordMustChange: "Password Must Change - VChu Draft",
156+
ControlTypeVChuPasswordWarning: "Password Warning - VChu Draft",
157+
ControlTypeManageDsaIT: "Manage DSA IT",
158+
ControlTypeWhoAmI: "Who Am I",
159+
ControlTypeSubtreeDelete: "Subtree Delete Control",
160+
161+
ControlTypeServerSideSorting: "Server Side Sorting",
162+
ControlTypeServerSideSortingResult: "Server Side Sorting Result",
163+
164+
ControlTypeMicrosoftCrossDomainMoveTarget: "Cross Domain Move Target - Microsoft",
165+
ControlTypeDirSync: "DirSync",
166+
ControlTypeMicrosoftDomainScope: "Domain Scope - Microsoft",
167+
ControlTypeMicrosoftExtendedDN: "Extended DN - Microsoft",
168+
ControlTypeMicrosoftGetStats: "Get Stats - Microsoft",
169+
ControlTypeMicrosoftLazyCommit: "Lazy Commit - Microsoft",
170+
ControlTypeMicrosoftPermissiveModify: "Permissive Modify - Microsoft",
171+
ControlTypeMicrosoftNotification: "Change Notification - Microsoft",
172+
ControlTypeMicrosoftSDFlags: "SD Flags - Microsoft",
173+
ControlTypeMicrosoftSearchOptions: "Search Options - Microsoft",
174+
ControlTypeMicrosoftShowDeleted: "Show Deleted Objects - Microsoft",
175+
ControlTypeMicrosoftVerifyName: "Verify Name - Microsoft",
176+
ControlTypeMicrosoftASQ: "ASQ - Microsoft",
177+
ControlTypeMicrosoftQuotaControl: "Quota Control - Microsoft",
178+
ControlTypeMicrosoftRangeOption: "Range Option - Microsoft",
179+
ControlTypeMicrosoftShutdownNotify: "Shutdown Notify - Microsoft",
180+
ControlTypeMicrosoftForceUpdate: "Force Update - Microsoft",
181+
ControlTypeMicrosoftRangeRetrievalNoErr: "Range Retrieval No Error - Microsoft",
182+
ControlTypeMicrosoftRODCDCPromo: "RODC DC Promo - Microsoft",
183+
ControlTypeMicrosoftDNInput: "DN Input - Microsoft",
184+
ControlTypeMicrosoftShowDeactivatedLink: "Show Deactivated Link - Microsoft",
185+
ControlTypeMicrosoftShowRecycled: "Show Recycled - Microsoft",
186+
ControlTypeMicrosoftPolicyHintsDeprecated: "Policy Hints Deprecated - Microsoft",
187+
ControlTypeMicrosoftDirSyncEX: "DirSync EX - Microsoft",
188+
ControlTypeMicrosoftUpdateStats: "Update Stats - Microsoft",
189+
ControlTypeMicrosoftTreeDeleteEX: "Tree Delete EX - Microsoft",
190+
ControlTypeMicrosoftSearchHints: "Search Hints - Microsoft",
191+
ControlTypeMicrosoftExpectedEntryCount: "Expected Entry Count - Microsoft",
192+
ControlTypeMicrosoftPolicyHints: "Policy Hints - Microsoft",
193+
ControlTypeMicrosoftSetOwner: "Set Owner - Microsoft",
194+
ControlTypeMicrosoftBypassQuota: "Bypass Quota - Microsoft",
195+
ControlTypeMicrosoftServerLinkTTL: "Return TTL-DNs for link values with associated expiry times - Microsoft",
196+
ControlTypeMicrosoftSetCorrelationID: "Set Correlation ID - Microsoft",
197+
ControlTypeMicrosoftThreadTraceOverride: "Thread Trace Override - Microsoft",
198+
199+
ControlTypeSyncRequest: "Sync Request",
200+
ControlTypeSyncState: "Sync State",
201+
ControlTypeSyncDone: "Sync Done",
202+
ControlTypeSyncInfo: "Sync Info",
75203
}
76204

77205
// Control defines an interface controls provide to encode and describe themselves

v3/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func (e *Entry) Unmarshal(i interface{}) (err error) {
305305
})
306306
}
307307

308-
// UnmarshalFunc allows you to define a custom unmarshaler to parse an Entry values.
308+
// UnmarshalFunc allows you to define a custom unmarshaler to parse an Entry values.
309309
// A custom unmarshaler can be found in the Unmarshal function or in the test files.
310310
func (e *Entry) UnmarshalFunc(i interface{},
311311
fn func(entry *Entry, fieldType reflect.StructField, fieldValue reflect.Value) error) error {

0 commit comments

Comments
 (0)