Bumps the go-deps group with 6 updates: | Package | From | To | | --- | --- | --- | | [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) | `1.45.10` | `1.45.16` | | [github.com/gophercloud/gophercloud](https://github.com/gophercloud/gophercloud) | `1.6.0` | `1.7.0` | | [github.com/openshift-online/ocm-sdk-go](https://github.com/openshift-online/ocm-sdk-go) | `0.1.364` | `0.1.371` | | [github.com/osbuild/images](https://github.com/osbuild/images) | `0.5.1-0.20230915095808-dd48a38be218` | `0.7.0` | | [github.com/vmware/govmomi](https://github.com/vmware/govmomi) | `0.30.7` | `0.31.0` | | [google.golang.org/api](https://github.com/googleapis/google-api-go-client) | `0.142.0` | `0.143.0` | Updates `github.com/aws/aws-sdk-go` from 1.45.10 to 1.45.16 - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.45.10...v1.45.16) Updates `github.com/gophercloud/gophercloud` from 1.6.0 to 1.7.0 - [Release notes](https://github.com/gophercloud/gophercloud/releases) - [Changelog](https://github.com/gophercloud/gophercloud/blob/v1.7.0/CHANGELOG.md) - [Commits](https://github.com/gophercloud/gophercloud/compare/v1.6.0...v1.7.0) Updates `github.com/openshift-online/ocm-sdk-go` from 0.1.364 to 0.1.371 - [Release notes](https://github.com/openshift-online/ocm-sdk-go/releases) - [Changelog](https://github.com/openshift-online/ocm-sdk-go/blob/main/CHANGES.md) - [Commits](https://github.com/openshift-online/ocm-sdk-go/compare/v0.1.364...v0.1.371) Updates `github.com/osbuild/images` from 0.5.1-0.20230915095808-dd48a38be218 to 0.7.0 - [Release notes](https://github.com/osbuild/images/releases) - [Commits](https://github.com/osbuild/images/commits/v0.7.0) Updates `github.com/vmware/govmomi` from 0.30.7 to 0.31.0 - [Release notes](https://github.com/vmware/govmomi/releases) - [Changelog](https://github.com/vmware/govmomi/blob/main/CHANGELOG.md) - [Commits](https://github.com/vmware/govmomi/compare/v0.30.7...v0.31.0) Updates `google.golang.org/api` from 0.142.0 to 0.143.0 - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.142.0...v0.143.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-deps - dependency-name: github.com/gophercloud/gophercloud dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps - dependency-name: github.com/openshift-online/ocm-sdk-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-deps - dependency-name: github.com/osbuild/images dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps - dependency-name: github.com/vmware/govmomi dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps - dependency-name: google.golang.org/api dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps ... Signed-off-by: dependabot[bot] <support@github.com>
171 lines
5.4 KiB
Go
171 lines
5.4 KiB
Go
// Copyright 2020 Google LLC.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Package internaloption contains options used internally by Google client code.
|
|
package internaloption
|
|
|
|
import (
|
|
"golang.org/x/oauth2/google"
|
|
"google.golang.org/api/internal"
|
|
"google.golang.org/api/option"
|
|
)
|
|
|
|
type defaultEndpointOption string
|
|
|
|
func (o defaultEndpointOption) Apply(settings *internal.DialSettings) {
|
|
settings.DefaultEndpoint = string(o)
|
|
}
|
|
|
|
// WithDefaultEndpoint is an option that indicates the default endpoint.
|
|
//
|
|
// It should only be used internally by generated clients.
|
|
//
|
|
// This is similar to WithEndpoint, but allows us to determine whether the user has overridden the default endpoint.
|
|
func WithDefaultEndpoint(url string) option.ClientOption {
|
|
return defaultEndpointOption(url)
|
|
}
|
|
|
|
type defaultMTLSEndpointOption string
|
|
|
|
func (o defaultMTLSEndpointOption) Apply(settings *internal.DialSettings) {
|
|
settings.DefaultMTLSEndpoint = string(o)
|
|
}
|
|
|
|
// WithDefaultMTLSEndpoint is an option that indicates the default mTLS endpoint.
|
|
//
|
|
// It should only be used internally by generated clients.
|
|
func WithDefaultMTLSEndpoint(url string) option.ClientOption {
|
|
return defaultMTLSEndpointOption(url)
|
|
}
|
|
|
|
// SkipDialSettingsValidation bypasses validation on ClientOptions.
|
|
//
|
|
// It should only be used internally.
|
|
func SkipDialSettingsValidation() option.ClientOption {
|
|
return skipDialSettingsValidation{}
|
|
}
|
|
|
|
type skipDialSettingsValidation struct{}
|
|
|
|
func (s skipDialSettingsValidation) Apply(settings *internal.DialSettings) {
|
|
settings.SkipValidation = true
|
|
}
|
|
|
|
// EnableDirectPath returns a ClientOption that overrides the default
|
|
// attempt to use 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 EnableDirectPath(dp bool) option.ClientOption {
|
|
return enableDirectPath(dp)
|
|
}
|
|
|
|
type enableDirectPath bool
|
|
|
|
func (e enableDirectPath) Apply(o *internal.DialSettings) {
|
|
o.EnableDirectPath = bool(e)
|
|
}
|
|
|
|
// EnableDirectPathXds returns a ClientOption that overrides the default
|
|
// DirectPath type. It is only valid when DirectPath is enabled.
|
|
//
|
|
// It should only be used internally by generated clients.
|
|
// This is an EXPERIMENTAL API and may be changed or removed in the future.
|
|
func EnableDirectPathXds() option.ClientOption {
|
|
return enableDirectPathXds(true)
|
|
}
|
|
|
|
type enableDirectPathXds bool
|
|
|
|
func (x enableDirectPathXds) Apply(o *internal.DialSettings) {
|
|
o.EnableDirectPathXds = bool(x)
|
|
}
|
|
|
|
// 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.
|
|
//
|
|
// It should only be used internally by generated clients.
|
|
func WithDefaultAudience(audience string) option.ClientOption {
|
|
return withDefaultAudience(audience)
|
|
}
|
|
|
|
type withDefaultAudience string
|
|
|
|
func (w withDefaultAudience) Apply(o *internal.DialSettings) {
|
|
o.DefaultAudience = string(w)
|
|
}
|
|
|
|
// WithDefaultScopes returns a ClientOption that overrides the default OAuth2
|
|
// scopes to be used for a service.
|
|
//
|
|
// It should only be used internally by generated clients.
|
|
func WithDefaultScopes(scope ...string) option.ClientOption {
|
|
return withDefaultScopes(scope)
|
|
}
|
|
|
|
type withDefaultScopes []string
|
|
|
|
func (w withDefaultScopes) Apply(o *internal.DialSettings) {
|
|
o.DefaultScopes = make([]string, len(w))
|
|
copy(o.DefaultScopes, w)
|
|
}
|
|
|
|
// EnableJwtWithScope returns a ClientOption that specifies if scope can be used
|
|
// with self-signed JWT.
|
|
func EnableJwtWithScope() option.ClientOption {
|
|
return enableJwtWithScope(true)
|
|
}
|
|
|
|
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)
|
|
}
|
|
|
|
// EnableNewAuthLibrary returns a ClientOption that specifies if libraries in this
|
|
// module to delegate auth to our new library. This option will be removed in
|
|
// the future once all clients have been moved to the new auth layer.
|
|
func EnableNewAuthLibrary() option.ClientOption {
|
|
return enableNewAuthLibrary(true)
|
|
}
|
|
|
|
type enableNewAuthLibrary bool
|
|
|
|
func (w enableNewAuthLibrary) Apply(o *internal.DialSettings) {
|
|
o.EnableNewAuthLibrary = bool(w)
|
|
}
|
|
|
|
// EmbeddableAdapter is a no-op option.ClientOption that allow libraries to
|
|
// create their own client options by embedding this type into their own
|
|
// client-specific option wrapper. See example for usage.
|
|
type EmbeddableAdapter struct{}
|
|
|
|
func (*EmbeddableAdapter) Apply(_ *internal.DialSettings) {}
|