Skip to content

Commit

Permalink
Sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mbilski committed Nov 8, 2024
1 parent 9e1678c commit 012ae19
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
15 changes: 15 additions & 0 deletions google/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ type Credentials struct {
// environment and not with a credentials file, e.g. when code is
// running on Google Cloud Platform.
JSON []byte

// UniverseDomainProvider returns the default service domain for a given
// Cloud universe. Optional.
//
// On GCE, UniverseDomainProvider should return the universe domain value
// from Google Compute Engine (GCE)'s metadata server. See also [The attached service
// account](https://cloud.google.com/docs/authentication/application-default-credentials#attached-sa).
// If the GCE metadata server returns a 404 error, the default universe
// domain value should be returned. If the GCE metadata server returns an
// error other than 404, the error should be returned.
UniverseDomainProvider func() (string, error)
}

func (c *Credentials) GetUniverseDomain() (string, error) {
return "", nil
}

// DefaultCredentials is the old name of Credentials.
Expand Down
7 changes: 5 additions & 2 deletions internal/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,11 @@ func doTokenRoundTrip(ctx context.Context, req *http.Request) (*Token, error) {
}

type RetrieveError struct {
Response *http.Response
Body []byte
Response *http.Response
Body []byte
ErrorCode string
ErrorDescription string
ErrorURI string
}

func (r *RetrieveError) Error() string {
Expand Down
6 changes: 6 additions & 0 deletions token.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ type RetrieveError struct {
// Body is the body that was consumed by reading Response.Body.
// It may be truncated.
Body []byte
// ErrorCode is RFC 6749's 'error' parameter.
ErrorCode string
// ErrorDescription is RFC 6749's 'error_description' parameter.
ErrorDescription string
// ErrorURI is RFC 6749's 'error_uri' parameter.
ErrorURI string
}

func (r *RetrieveError) Error() string {
Expand Down

0 comments on commit 012ae19

Please sign in to comment.