Skip to content

[suggestion] Provide clearer error messages for client-side authentication failures (4xx) #370

@LeoCBS

Description

@LeoCBS

Hello,

It seems that the auth crate doesn't properly parse response errors when the authentication configuration is invalid.
I was trying to use GKE Workload Identity as the auth method behind the with_auth() function, and the crate just returned a decode error (probably because the response wasn't what the decoder expected), which made debugging my configuration more difficult.

What do you think about returning a clearer error message for client auth errors? Does that make sense?
I’d be happy to open a PR with this suggestion if you're open to it.

HttpError(reqwest::Error { kind: Decode, source: Error("expected value", line: 1, column: 1) })

Just to clarify, Workload Identity on GKE works fine, this suggestion is only about improving the clarity of error messages in such cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions