Skip to content

Conversation

@nick-benoit
Copy link
Contributor

@nick-benoit nick-benoit commented Oct 25, 2025

Fixes: #1393

Before this PR we were using the ES Config as a starting point and applying Kibana provider block and environment configs on top of that. This can lead to invalid Configs where both Username / Password and ApiKey are both configured.

This PR starts with an empty Kibana / Fleet config, then applies provider settings, environment overrides, then only applies defaults for unknown values (while respecting mutually exclusive values like Username / ApiKey)

Additionally we add fleetConfigKeys and kibanaConfigKeys which allows us to track explicitly set fields. This adds a bit of overhead to maintain state, but allows us to correctly differentiate between explicit empty values and unset values in a way that supports both the sdkv2 and plugin framework implementations. Technically the Kibana config doesn't require tracking the keys because it only inherits string values from ES, but I thought it was more straightforward for Fleet and Kibana to use a similar pattern.

Instead of using the defaults as a starting point we apply them after building the config object to any fields that are not set. In doing so we respect fields that are mutually exclusive like api_key and username. Applying defaults at the end makes it easier to check we aren't accidentally building an invalid config.
@nick-benoit nick-benoit requested a review from tobio October 25, 2025 01:46
@nick-benoit
Copy link
Contributor Author

Woops, not sure why this doesn't seem to be playing nice with the SLO test. I'll switch back to a draft while I sort that out.

@nick-benoit nick-benoit marked this pull request as draft October 25, 2025 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Multiple Authorization headers sent in some cases

1 participant