Skip to content

Commit

Permalink
actually passing the email this time
Browse files Browse the repository at this point in the history
  • Loading branch information
jprobinson committed Nov 5, 2018
1 parent b8c7c8e commit ca1565f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions auth/gcp/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ type IAMClaimSet struct {
// the server running this verifier.
func NewDefaultIAMVerifier(ctx context.Context, cfg IAMConfig, clientFunc func(context.Context) *http.Client) (*auth.Verifier, error) {
var err error
eml := cfg.ServiceAccountEmail
if eml == "" {
eml, err = GetDefaultEmail(ctx, "", clientFunc(ctx))
if cfg.ServiceAccountEmail == "" {
cfg.ServiceAccountEmail, err = GetDefaultEmail(ctx, "", clientFunc(ctx))
if err != nil {
return nil, errors.Wrap(err, "unable to get default email")
}
Expand All @@ -55,7 +54,8 @@ func NewDefaultIAMVerifier(ctx context.Context, cfg IAMConfig, clientFunc func(c
}

return auth.NewVerifier(ks,
IAMClaimsDecoderFunc, VerifyIAMEmails(ctx, []string{eml}, cfg.Audience)), nil
IAMClaimsDecoderFunc,
VerifyIAMEmails(ctx, []string{cfg.ServiceAccountEmail}, cfg.Audience)), nil
}

// BaseClaims implements the auth.ClaimSetter interface.
Expand Down

0 comments on commit ca1565f

Please sign in to comment.