open-feature / open-feature/java-sdk-contrib
Feature Request: Support for Dynamic Header Suppliers in HttpConnectorOptions
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 49
- Forks
- 81
- Avg merge
- 20h 3m
- Merged PRs (30d)
- 6
Description
Currently, HttpConnectorOptions.java allows for a static Map<String, String> of headers. While this works for fixed metadata, it is insufficient for headers that change over time or expire, such as bearer tokens or short-lived security signatures.
I would like to propose adding an option to provide a dynamic callback (e.g., a Supplier or a Functional Interface) that is evaluated just before each request is dispatched.
Maybe, in addition to the static map, we could have a method like the following:
public void addHeaderProvider(String headerName, Supplier<String> valueSupplier)
to add dynamic headers when building the request?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with HttpConnectorOptions.java, especially the existing static header configuration, then trace where the HTTP request is dispatched. Define how a dynamic header provider is configured and evaluated immediately before each request while preserving static headers. Done means changing headers such as expiring bearer tokens can be supplied per request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100