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
@@ -34,6 +34,8 @@ type LdapAuthMethodAttributes struct {
|
||||
BindPasswordHmac string `json:"bind_password_hmac,omitempty"`
|
||||
UseTokenGroups bool `json:"use_token_groups,omitempty"`
|
||||
AccountAttributeMaps []string `json:"account_attribute_maps,omitempty"`
|
||||
MaximumPageSize uint32 `json:"maximum_page_size,omitempty"`
|
||||
DereferenceAliases string `json:"dereference_aliases,omitempty"`
|
||||
}
|
||||
|
||||
func AttributesMapToLdapAuthMethodAttributes(in map[string]interface{}) (*LdapAuthMethodAttributes, error) {
|
||||
|
||||
@@ -415,6 +415,30 @@ func DefaultOidcAuthMethodClientSecret() Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithLdapAuthMethodDereferenceAliases(inDereferenceAliases string) Option {
|
||||
return func(o *options) {
|
||||
raw, ok := o.postMap["attributes"]
|
||||
if !ok {
|
||||
raw = interface{}(map[string]interface{}{})
|
||||
}
|
||||
val := raw.(map[string]interface{})
|
||||
val["dereference_aliases"] = inDereferenceAliases
|
||||
o.postMap["attributes"] = val
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultLdapAuthMethodDereferenceAliases() Option {
|
||||
return func(o *options) {
|
||||
raw, ok := o.postMap["attributes"]
|
||||
if !ok {
|
||||
raw = interface{}(map[string]interface{}{})
|
||||
}
|
||||
val := raw.(map[string]interface{})
|
||||
val["dereference_aliases"] = nil
|
||||
o.postMap["attributes"] = val
|
||||
}
|
||||
}
|
||||
|
||||
func WithDescription(inDescription string) Option {
|
||||
return func(o *options) {
|
||||
o.postMap["description"] = inDescription
|
||||
@@ -691,6 +715,30 @@ func DefaultOidcAuthMethodMaxAge() Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithLdapAuthMethodMaximumPageSize(inMaximumPageSize uint32) Option {
|
||||
return func(o *options) {
|
||||
raw, ok := o.postMap["attributes"]
|
||||
if !ok {
|
||||
raw = interface{}(map[string]interface{}{})
|
||||
}
|
||||
val := raw.(map[string]interface{})
|
||||
val["maximum_page_size"] = inMaximumPageSize
|
||||
o.postMap["attributes"] = val
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultLdapAuthMethodMaximumPageSize() Option {
|
||||
return func(o *options) {
|
||||
raw, ok := o.postMap["attributes"]
|
||||
if !ok {
|
||||
raw = interface{}(map[string]interface{}{})
|
||||
}
|
||||
val := raw.(map[string]interface{})
|
||||
val["maximum_page_size"] = nil
|
||||
o.postMap["attributes"] = val
|
||||
}
|
||||
}
|
||||
|
||||
func WithPasswordAuthMethodMinLoginNameLength(inMinLoginNameLength uint32) Option {
|
||||
return func(o *options) {
|
||||
raw, ok := o.postMap["attributes"]
|
||||
|
||||
Reference in new issue
Block a user