Skip to content

Add simpler credentials header accessor #3362

Closed

Description

@coryan

The current API is correct, and powerful, but a bit hard to use. We should offer a simpler version...

I've been using, but been quite nervous about, using unreachable!() for this code path. Could you also add some explicit clarification/guarantees on under what conditions a NotModified won't be returned?

Yes. In addition, I think we should provide an extension trait that simplifies the API and makes this clear via the type system. Something like:

pub trait CredentialsExt {
    async fn cached_headers(&self) -> Result<HeaderMap> { .... }

(and I'm also very very happy this exists, to replace the hacky code we had to use before now - also appreciate the huge amount of work that's obviously gone into it)

Thanks for saying that.

Originally posted by @coryan in #3361

Activity

  1. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    authIssues related to the auth library
    on Sep 19, 2025
  2. self-assigned this
    on Sep 23, 2025
  3. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Sep 23, 2025
  4. alvarowolfx commented on Sep 23, 2025

    @alvarowolfx
    Contributor

    related to #2929 and potentially duplication.

  5. added this to the Q4 Auth Features milestone on Oct 29, 2025
  6. alvarowolfx commented on Dec 10, 2025

    @alvarowolfx
    Contributor

    solved by #3642

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

authIssues related to the auth librarypriority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions