feat: add API support for additional LDAP auth method fields. (#3679)
* feat (auth/ldap): add Repo support for max page size and deref aliases (#3670) * chore: update cap/ldap dependency This latest version of cap/ldap adds support for MaxPageSize and DerefAliases * feat (auth/ldap): add MaxPageSize and DerefAliases to storage proto * feat (api/authmethods): add new ldap fields. Add support for maximum_page_size and dereference_aliases * feat (auth/ldap): schema changes to support new LDAP attributes * feat (auth/ldap): add Repo support for max page size and deref aliases * feat (handlers/ldap): add support for new fields (#3674) Added API support for new ldap fields: MaximumPageSize and DereferenceAliases * chore: add CHANGELOG entry for new api auth ldap fields
This commit is contained in:
28 files changed
+1166
-237
No files matched your search
@@ -87,6 +87,8 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
"displayName": ToFullNameAttribute,
|
||||
"mail": ToEmailAttribute,
|
||||
}),
|
||||
WithDerefAliases(testCtx, DerefAlways),
|
||||
WithMaximumPageSize(testCtx, 10),
|
||||
)
|
||||
},
|
||||
updateWith: func(orig *AuthMethod) *AuthMethod {
|
||||
@@ -117,6 +119,8 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
am.AccountAttributeMaps = []string{
|
||||
fmt.Sprintf("%s=%s", "cn", ToFullNameAttribute),
|
||||
}
|
||||
am.DereferenceAliases = string(NeverDerefAliases)
|
||||
am.MaximumPageSize = 100
|
||||
return &am
|
||||
},
|
||||
fieldMasks: []string{
|
||||
@@ -143,6 +147,8 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
ClientCertificateField,
|
||||
ClientCertificateKeyField,
|
||||
AccountAttributeMapsField,
|
||||
DerefAliasesField,
|
||||
MaximumPageSizeField,
|
||||
},
|
||||
version: 1,
|
||||
want: func(orig, updateWith *AuthMethod) *AuthMethod {
|
||||
@@ -172,6 +178,8 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
am.ClientCertificate = updateWith.ClientCertificate
|
||||
am.ClientCertificateKeyHmac = updateWith.ClientCertificateKeyHmac
|
||||
am.AccountAttributeMaps = updateWith.AccountAttributeMaps
|
||||
am.DereferenceAliases = string(NeverDerefAliases)
|
||||
am.MaximumPageSize = 100
|
||||
return am
|
||||
},
|
||||
},
|
||||
@@ -318,6 +326,8 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
WithBindCredential(testCtx, "orig-bind-dn", "orig-bind-password"),
|
||||
WithCertificates(testCtx, testCert),
|
||||
WithClientCertificate(testCtx, derPrivKey, testCert), // not a client cert but good enough for this test.
|
||||
WithDerefAliases(testCtx, DerefAlways),
|
||||
WithMaximumPageSize(testCtx, 10),
|
||||
)
|
||||
},
|
||||
updateWith: func(orig *AuthMethod) *AuthMethod {
|
||||
@@ -335,6 +345,8 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
UpnDomainField,
|
||||
EnableGroupsField,
|
||||
UseTokenGroupsField,
|
||||
DerefAliasesField,
|
||||
MaximumPageSizeField,
|
||||
},
|
||||
version: 1,
|
||||
want: func(orig, updateWith *AuthMethod) *AuthMethod {
|
||||
@@ -348,6 +360,8 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
am.UpnDomain = updateWith.UpnDomain
|
||||
am.EnableGroups = updateWith.EnableGroups
|
||||
am.UseTokenGroups = updateWith.UseTokenGroups
|
||||
am.MaximumPageSize = updateWith.MaximumPageSize
|
||||
am.DereferenceAliases = updateWith.DereferenceAliases
|
||||
return am
|
||||
},
|
||||
},
|
||||
@@ -376,6 +390,7 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
"mail": ToEmailAttribute,
|
||||
"cn": ToFullNameAttribute,
|
||||
}),
|
||||
WithDerefAliases(testCtx, NeverDerefAliases),
|
||||
)
|
||||
},
|
||||
updateWith: func(orig *AuthMethod) *AuthMethod {
|
||||
@@ -394,6 +409,7 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
am.ClientCertificate = testCertEncoded
|
||||
am.ClientCertificateKey = derPrivKey
|
||||
am.AccountAttributeMaps = []string{"cn=fullName"}
|
||||
am.DereferenceAliases = string(DerefAlways)
|
||||
return &am
|
||||
},
|
||||
fieldMasks: []string{
|
||||
@@ -410,6 +426,7 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
ClientCertificateField,
|
||||
ClientCertificateKeyField,
|
||||
AccountAttributeMapsField,
|
||||
DerefAliasesField,
|
||||
},
|
||||
version: 1,
|
||||
want: func(orig, updateWith *AuthMethod) *AuthMethod {
|
||||
@@ -428,6 +445,7 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
am.ClientCertificate = updateWith.ClientCertificate
|
||||
am.ClientCertificateKeyHmac = updateWith.ClientCertificateKeyHmac
|
||||
am.AccountAttributeMaps = updateWith.AccountAttributeMaps
|
||||
am.DereferenceAliases = updateWith.DereferenceAliases
|
||||
return am
|
||||
},
|
||||
},
|
||||
@@ -453,6 +471,7 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
"mail": ToEmailAttribute,
|
||||
"cn": ToFullNameAttribute,
|
||||
}),
|
||||
WithDerefAliases(testCtx, DerefAlways),
|
||||
)
|
||||
},
|
||||
updateWith: func(orig *AuthMethod) *AuthMethod {
|
||||
@@ -473,6 +492,7 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
ClientCertificateField,
|
||||
ClientCertificateKeyField,
|
||||
AccountAttributeMapsField,
|
||||
DerefAliasesField,
|
||||
},
|
||||
version: 1,
|
||||
want: func(orig, updateWith *AuthMethod) *AuthMethod {
|
||||
@@ -491,6 +511,7 @@ func TestRepository_UpdateAuthMethod(t *testing.T) {
|
||||
am.ClientCertificate = updateWith.ClientCertificate
|
||||
am.ClientCertificateKeyHmac = updateWith.ClientCertificateKeyHmac
|
||||
am.AccountAttributeMaps = updateWith.AccountAttributeMaps
|
||||
am.DereferenceAliases = updateWith.DereferenceAliases
|
||||
return am
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user