Skip to content

Commit ea5d4ae

Browse files
committed
Provide role scopes as csv to align with config
Config already provides its scopes as csv. Use-case: I want to set `allowed_parameters` in the policy for `scopes`. However, this is only string based. When using this with terraform and supplying the scopes string based, there will be a constant state drift as the response is different (an array vs a string).
1 parent b675d08 commit ea5d4ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

entry_role.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package gitlab
33
import (
44
"context"
55
"fmt"
6+
"strings"
67
"time"
78

89
"github.com/hashicorp/vault/sdk/logical"
@@ -35,7 +36,7 @@ func (e EntryRole) LogicalResponseData() map[string]any {
3536
"role_name": e.RoleName,
3637
"path": e.Path,
3738
"name": e.Name,
38-
"scopes": e.Scopes,
39+
"scopes": strings.Join(e.Scopes, ", "),
3940
"access_level": e.AccessLevel.String(),
4041
"ttl": int64(e.TTL / time.Second),
4142
"token_type": e.TokenType.String(),
@@ -54,5 +55,4 @@ func getRole(ctx context.Context, name string, s logical.Storage) (role *EntryRo
5455
_ = entry.DecodeJSON(role)
5556
}
5657
return role, err
57-
5858
}

0 commit comments

Comments
 (0)