Skip to content

Commit

Permalink
restore option
Browse files Browse the repository at this point in the history
  • Loading branch information
quartzmo committed Jan 17, 2024
1 parent c59f588 commit 56e635c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
11 changes: 1 addition & 10 deletions option/internaloption/internaloption.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,9 @@ func (o defaultEndpointTemplateOption) Apply(settings *internal.DialSettings) {

// WithDefaultEndpointTemplate provides a template for creating the endpoint
// using a universe domain. See also WithDefaultUniverseDomain and
// option.WithUniverseDomain. The placeholder UNIVERSE_DOMAIN should be used
// instead of a concrete universe domain such as "googleapis.com".
//
// Example: WithDefaultEndpointTemplate("https://logging.UNIVERSE_DOMAIN/")
// option.WithUniverseDomain.
//
// It should only be used internally by generated clients.
//
// TODO(chrisdsmith): Refs: CL-R3 (remove this note before publication)
func WithDefaultEndpointTemplate(url string) option.ClientOption {
return defaultEndpointTemplateOption(url)
}
Expand Down Expand Up @@ -168,10 +163,6 @@ func (w withDefaultUniverseDomain) Apply(o *internal.DialSettings) {

// EnableJwtWithScope returns a ClientOption that specifies if scope can be used
// with self-signed JWT.
//
// EnableJwtWithScope is ignored when option.WithUniverseDomain is set
// to a non-GDU universe domain. For non-GDU universe domains, token exchange is
// impossible and services must support self-signed JWTs with scopes.
func EnableJwtWithScope() option.ClientOption {
return enableJwtWithScope(true)
}
Expand Down
4 changes: 2 additions & 2 deletions option/internaloption/internaloption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestWithCredentials(t *testing.T) {
func TestDefaultApply(t *testing.T) {
opts := []option.ClientOption{
WithDefaultEndpoint("https://example.com:443"),
WithDefaultEndpointTemplate("https://foo.UNIVERSE_DOMAIN/"),
WithDefaultEndpointTemplate("https://foo.%s/"),
WithDefaultMTLSEndpoint("http://mtls.example.com:445"),
WithDefaultScopes("a"),
WithDefaultUniverseDomain("foo.com"),
Expand All @@ -48,7 +48,7 @@ func TestDefaultApply(t *testing.T) {
want := internal.DialSettings{
DefaultScopes: []string{"a"},
DefaultEndpoint: "https://example.com:443",
DefaultEndpointTemplate: "https://foo.UNIVERSE_DOMAIN/",
DefaultEndpointTemplate: "https://foo.%s/",
DefaultUniverseDomain: "foo.com",
DefaultAudience: "audience",
DefaultMTLSEndpoint: "http://mtls.example.com:445",
Expand Down
5 changes: 0 additions & 5 deletions option/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ type ClientOption interface {

// WithTokenSource returns a ClientOption that specifies an OAuth2 token
// source to be used as the basis for authentication.
//
// TODO(chrisdsmith): Refs: CL-R8 (remove this note before publication)
func WithTokenSource(s oauth2.TokenSource) ClientOption {
return withTokenSource{s}
}
Expand Down Expand Up @@ -167,8 +165,6 @@ func (w withGRPCConnectionPool) Apply(o *internal.DialSettings) {
//
// API Keys can only be used for JSON-over-HTTP APIs, including those under
// the import path google.golang.org/api/....
//
// TODO(chrisdsmith): Refs: CL-R8 (remove this note before publication)
func WithAPIKey(apiKey string) ClientOption {
return withAPIKey(apiKey)
}
Expand Down Expand Up @@ -351,7 +347,6 @@ func WithCredentials(creds *google.Credentials) ClientOption {
// WithUniverseDomain returns a ClientOption that sets the universe domain.
//
// This is an EXPERIMENTAL API and may be changed or removed in the future.
// TODO(chrisdsmith): Closes: CL-R7 (remove this note before publication)
func WithUniverseDomain(ud string) ClientOption {
return withUniverseDomain(ud)
}
Expand Down

0 comments on commit 56e635c

Please sign in to comment.