OpenAPITools / OpenAPITools/openapi-generator

[REQ] [Rust] [Client] Better integration with token source providers

Open
#19,648 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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

Currently the only way to provide authentication tokens are by providing it directly with an option.
This is not super friendly as it forces us to deal with the token management specifically outside the client, and recreate a new configuration every time a token get renewed.

Of course, it is not the responsibility of the generated client to deal with this, but we can offer a better integration between the two, so that developers does not necessarily need to DIY it.

Describe the solution you'd like

To improve the integration with token source providers in rust:

  • add a new option to activate this mode (as a replacement of the current token attributes in the configuration)
  • use that when setting the authorization header in requests

Important: A token source MUST be async, which restrict this mode to async clients. For sync client, the current configuration way will be kept.

Describe alternatives you've considered

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the generated Rust client authentication configuration and the request paths for async and sync clients. Compare how authorization headers are currently set, then determine where an async token source option would fit while preserving the existing sync configuration. Done means async clients can obtain renewed tokens through the provider and sync clients retain their current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, authentication, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.