Skip to content

Commit

Permalink
return empty map rather than nil
Browse files Browse the repository at this point in the history
  • Loading branch information
kian99 committed Aug 29, 2024
1 parent f594b5f commit 896f58d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions internal/jimm/cloudcredential.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ func (j *JIMM) GetCloudCredentialAttributes(ctx context.Context, user *openfga.U
err = errors.E(op, err)
return
}
if len(attrs) == 0 {
return map[string]string{}, nil, nil
}

if hidden {
return
Expand Down
2 changes: 1 addition & 1 deletion internal/jimm/cloudcredential_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ var getCloudCredentialAttributesTests = []struct {
username: "[email protected]",
jimmAdmin: true,
cred: "cred-2",
expectAttributes: nil,
expectAttributes: map[string]string{},
expectRedacted: nil,
}, {
name: "OwnerWithHidden",
Expand Down

0 comments on commit 896f58d

Please sign in to comment.