File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ func TestAccBundleInitHelpers(t *testing.T) {
138138 },
139139 {
140140 funcName : "{{is_service_principal}}" ,
141- expected : strconv .FormatBool (auth .IsServicePrincipal (me .Id )),
141+ expected : strconv .FormatBool (auth .IsServicePrincipal (me .UserName )),
142142 },
143143 {
144144 funcName : "{{smallest_node_type}}" ,
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ import (
44 "github.com/google/uuid"
55)
66
7- // Determines whether a given user id is a service principal.
8- // This function uses a heuristic: if the user id is a UUID, then we assume
7+ // Determines whether a given user name is a service principal.
8+ // This function uses a heuristic: if the user name is a UUID, then we assume
99// it's a service principal. Unfortunately, the service principal listing API is too
1010// slow for our purposes. And the "users" and "service principals get" APIs
1111// only allow access by workspace admins.
12- func IsServicePrincipal (userId string ) bool {
13- _ , err := uuid .Parse (userId )
12+ func IsServicePrincipal (userName string ) bool {
13+ _ , err := uuid .Parse (userName )
1414 return err == nil
1515}
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ func loadHelpers(ctx context.Context) template.FuncMap {
140140 return false , err
141141 }
142142 }
143- result := auth .IsServicePrincipal (cachedUser .Id )
143+ result := auth .IsServicePrincipal (cachedUser .UserName )
144144 cachedIsServicePrincipal = & result
145145 return result , nil
146146 },
You can’t perform that action at this time.
0 commit comments