vendor: update all dependencies to latest versions

This commit is contained in:
Nick Craig-Wood
2017-09-30 15:27:27 +01:00
parent 911d121bb9
commit b017fcfe9a
3048 changed files with 537055 additions and 189679 deletions
+16 -10
View File
@@ -40,19 +40,25 @@ func (w withTokenSource) Apply(o *internal.DialSettings) {
o.TokenSource = w.ts
}
// WithServiceAccountFile returns a ClientOption that uses a Google service
// account credentials file to authenticate.
// Use WithTokenSource with a token source created from
// golang.org/x/oauth2/google.JWTConfigFromJSON
// if reading the file from disk is not an option.
func WithServiceAccountFile(filename string) ClientOption {
return withServiceAccountFile(filename)
type withCredFile string
func (w withCredFile) Apply(o *internal.DialSettings) {
o.CredentialsFile = string(w)
}
type withServiceAccountFile string
// WithCredentialsFile returns a ClientOption that authenticates
// API calls with the given service account or refresh token JSON
// credentials file.
func WithCredentialsFile(filename string) ClientOption {
return withCredFile(filename)
}
func (w withServiceAccountFile) Apply(o *internal.DialSettings) {
o.ServiceAccountJSONFilename = string(w)
// WithServiceAccountFile returns a ClientOption that uses a Google service
// account credentials file to authenticate.
//
// Deprecated: Use WithCredentialsFile instead.
func WithServiceAccountFile(filename string) ClientOption {
return WithCredentialsFile(filename)
}
// WithEndpoint returns a ClientOption that overrides the default endpoint
+7 -7
View File
@@ -45,7 +45,7 @@ func TestApply(t *testing.T) {
WithScopes("https://example.com/auth/helloworld", "https://example.com/auth/otherthing"),
WithGRPCConn(conn),
WithUserAgent("ua"),
WithServiceAccountFile("service-account.json"),
WithCredentialsFile("service-account.json"),
WithAPIKey("api-key"),
}
var got internal.DialSettings
@@ -53,12 +53,12 @@ func TestApply(t *testing.T) {
opt.Apply(&got)
}
want := internal.DialSettings{
Scopes: []string{"https://example.com/auth/helloworld", "https://example.com/auth/otherthing"},
UserAgent: "ua",
Endpoint: "https://example.com:443",
GRPCConn: conn,
ServiceAccountJSONFilename: "service-account.json",
APIKey: "api-key",
Scopes: []string{"https://example.com/auth/helloworld", "https://example.com/auth/otherthing"},
UserAgent: "ua",
Endpoint: "https://example.com:443",
GRPCConn: conn,
CredentialsFile: "service-account.json",
APIKey: "api-key",
}
if !reflect.DeepEqual(got, want) {
t.Errorf("\ngot %#v\nwant %#v", got, want)