Skip to content

Commit

Permalink
fixup! Rename TokenCredential variables to indicate credential used
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarnes committed Jun 14, 2023
1 parent 4ec977e commit 15d85fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/env/armhelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ func newARMHelper(ctx context.Context, log *logrus.Entry, env Interface) (ARMHel
}

options := env.Environment().ClientCertificateCredentialOptions()
spTokenCredential, err := azidentity.NewClientCertificateCredential(env.TenantID(), os.Getenv("AZURE_ARM_CLIENT_ID"), certs, key, options)
armHelperTokenCredential, err := azidentity.NewClientCertificateCredential(env.TenantID(), os.Getenv("AZURE_ARM_CLIENT_ID"), certs, key, options)
if err != nil {
return nil, err
}

scopes := []string{env.Environment().ResourceManagerScope}
armAuthorizer := azidext.NewTokenCredentialAdapter(spTokenCredential, scopes)
armHelperAuthorizer := azidext.NewTokenCredentialAdapter(armHelperTokenCredential, scopes)

// Graph service client uses the first party service principal.
fpTokenCredential, err := env.FPNewClientCertificateCredential(env.TenantID())
Expand All @@ -105,7 +105,7 @@ func newARMHelper(ctx context.Context, log *logrus.Entry, env Interface) (ARMHel
env: env,

fpGraphClient: fpGraphClient,
roleassignments: authorization.NewRoleAssignmentsClient(env.Environment(), env.SubscriptionID(), armAuthorizer),
roleassignments: authorization.NewRoleAssignmentsClient(env.Environment(), env.SubscriptionID(), armHelperAuthorizer),
}, nil
}

Expand Down

0 comments on commit 15d85fb

Please sign in to comment.