summaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/api/option/internaloption/internaloption.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/google.golang.org/api/option/internaloption/internaloption.go')
-rw-r--r--vendor/google.golang.org/api/option/internaloption/internaloption.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/google.golang.org/api/option/internaloption/internaloption.go b/vendor/google.golang.org/api/option/internaloption/internaloption.go
index ed0b7aaf13..343a5a965e 100644
--- a/vendor/google.golang.org/api/option/internaloption/internaloption.go
+++ b/vendor/google.golang.org/api/option/internaloption/internaloption.go
@@ -6,6 +6,7 @@
package internaloption
import (
+ "golang.org/x/oauth2/google"
"google.golang.org/api/internal"
"google.golang.org/api/option"
)
@@ -66,6 +67,21 @@ func (e enableDirectPath) Apply(o *internal.DialSettings) {
o.EnableDirectPath = bool(e)
}
+// AllowNonDefaultServiceAccount returns a ClientOption that overrides the default
+// requirement for using the default service account for DirectPath.
+//
+// It should only be used internally by generated clients.
+// This is an EXPERIMENTAL API and may be changed or removed in the future.
+func AllowNonDefaultServiceAccount(nd bool) option.ClientOption {
+ return allowNonDefaultServiceAccount(nd)
+}
+
+type allowNonDefaultServiceAccount bool
+
+func (a allowNonDefaultServiceAccount) Apply(o *internal.DialSettings) {
+ o.AllowNonDefaultServiceAccount = bool(a)
+}
+
// WithDefaultAudience returns a ClientOption that specifies a default audience
// to be used as the audience field ("aud") for the JWT token authentication.
//
@@ -106,3 +122,15 @@ type enableJwtWithScope bool
func (w enableJwtWithScope) Apply(o *internal.DialSettings) {
o.EnableJwtWithScope = bool(w)
}
+
+// WithCredentials returns a client option to specify credentials which will be used to authenticate API calls.
+// This credential takes precedence over all other credential options.
+func WithCredentials(creds *google.Credentials) option.ClientOption {
+ return (*withCreds)(creds)
+}
+
+type withCreds google.Credentials
+
+func (w *withCreds) Apply(o *internal.DialSettings) {
+ o.InternalCredentials = (*google.Credentials)(w)
+}