Skip to content

auth/credentials: improve error message when json credential is valid but empty or untyped #12672

@peczenyj

Description

@peczenyj

Is your feature request related to a problem? Please describe.

In case of a valid but empty json credential, the error message is not really easy to read. For instance, if I use an option like this

option.WithCredentialsJSON([]byte({})

until cloud.google.com/go/[email protected] it returns an error message like this:

storage.NewClient(ctx): dialing: missing 'type' field in credentials

however, newer versions return an error message like this:

storage.NewClient(ctx): dialing: credentials: unsupported filetype '\x00'

what is this byte 00 ? unclear

Describe the solution you'd like

A better error message

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions