mirror of https://github.com/grpc/grpc-go.git
minor changes
This commit is contained in:
parent
41ee26a353
commit
32444cd24d
|
|
@ -61,7 +61,6 @@ func (ts TokenSource) GetRequestMetadata(ctx context.Context) (map[string]string
|
|||
}, nil
|
||||
}
|
||||
|
||||
// jwtAccess creates a JWT and send as the access token.
|
||||
type jwtAccess struct {
|
||||
ts oauth2.TokenSource
|
||||
}
|
||||
|
|
@ -71,11 +70,7 @@ func NewJWTAccessFromFile(keyFile string, audience string) (credentials.Credenti
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("credentials: failed to read the service account key file: %v", err)
|
||||
}
|
||||
ts, err := google.JWTAccessTokenSourceFromJSON(jsonKey, audience)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return jwtAccess{ts: ts}, nil
|
||||
return NewJWTAccessFromKey(jsonKey, audience)
|
||||
}
|
||||
|
||||
func NewJWTAccessFromKey(jsonKey []byte, audience string) (credentials.Credentials, error) {
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ func main() {
|
|||
doServiceAccountCreds(tc)
|
||||
case "jwt_token_creds":
|
||||
if !*useTLS {
|
||||
grpclog.Fatalf("TLS is not enabled. TLS is required to execute service_account_creds test case.")
|
||||
grpclog.Fatalf("TLS is not enabled. TLS is required to execute jwt_token_creds test case.")
|
||||
}
|
||||
doJWTTokenCreds(tc)
|
||||
case "cancel_after_begin":
|
||||
|
|
|
|||
Loading…
Reference in New Issue