open-feature / open-feature/java-sdk-contrib

Feature Request: Support for Dynamic Header Suppliers in HttpConnectorOptions

Open
#1,703 0 comments 0 reactions 0 assignees View on GitHub

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.