Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync #12

Merged
merged 1 commit into from
Nov 12, 2024
Merged

Sync #12

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading