mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 20:36:26 +02:00
Update LDAP "groups" parameter to use TypeCommaStringSlice (#6942)
No functional change, but the updated type plays nicer with the OpenAPI-driven UI.
This commit is contained in:
parent
a5e33f0e75
commit
8411a3e4a5
@ -27,17 +27,17 @@ func pathUsers(b *backend) *framework.Path {
|
||||
return &framework.Path{
|
||||
Pattern: `users/(?P<name>.+)`,
|
||||
Fields: map[string]*framework.FieldSchema{
|
||||
"name": &framework.FieldSchema{
|
||||
"name": {
|
||||
Type: framework.TypeString,
|
||||
Description: "Name of the LDAP user.",
|
||||
},
|
||||
|
||||
"groups": &framework.FieldSchema{
|
||||
Type: framework.TypeString,
|
||||
"groups": {
|
||||
Type: framework.TypeCommaStringSlice,
|
||||
Description: "Comma-separated list of additional groups associated with the user.",
|
||||
},
|
||||
|
||||
"policies": &framework.FieldSchema{
|
||||
"policies": {
|
||||
Type: framework.TypeCommaStringSlice,
|
||||
Description: "Comma-separated list of policies associated with the user.",
|
||||
},
|
||||
@ -126,7 +126,7 @@ func (b *backend) pathUserWrite(ctx context.Context, req *logical.Request, d *fr
|
||||
lowercaseGroups = true
|
||||
}
|
||||
|
||||
groups := strutil.RemoveDuplicates(strutil.ParseStringSlice(d.Get("groups").(string), ","), lowercaseGroups)
|
||||
groups := strutil.RemoveDuplicates(d.Get("groups").([]string), lowercaseGroups)
|
||||
policies := policyutil.ParsePolicies(d.Get("policies"))
|
||||
for i, g := range groups {
|
||||
groups[i] = strings.TrimSpace(g)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user