minor changes

This commit is contained in:
yangzhouhan
2015-08-14 11:35:15 -07:00
parent 41ee26a353
commit 32444cd24d
2 changed files with 2 additions and 7 deletions

View File

@ -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) {

View File

@ -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":