Skip to content

Add support for optional header_value_prefix in Generic credential injector #42703

@chuangw6

Description

@chuangw6

Title: Support prefix specification in generic credential injector

Current behaviour

The generic credential injector injects the raw value from a SdsSecretConfig directly into a specified header. (note: When only name is specified in SdsSecretConfig, it loads credential from secret in static resource.)

Currently, there is no native way to append a scheme or prefix (like Bearer ) to the credential during injection. Users are forced to add an extra header-mutation filter to prepend the prefix (#37001), which adds complexity and overhead to the filter chain.

The Problem: Dynamic Secrets

While a user can theoretically hardcode a prefix if using an inline_string, this is not possible when the secret is loaded dynamically via filename for example - no way to transform xyz123 into Bearer xyz123 without an additional mutation step.

Example proposed config (Simplified):

generic:
  header: "Authorization"
  header_value_prefix: "Bearer "
  credential:
    sds_secret_config:
      name: "my_token"

Metadata

Metadata

Assignees

Labels

enhancementFeature requests. Not bugs or questions.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions