Skip to content

Pass only the needed config values instead of OpenApiConfig - #359

Merged
nineinchnick merged 5 commits into
mainfrom
pass-config-values
Oct 24, 2026
Merged

nineinchnick merged 5 commits into
mainfrom
pass-config-values

Conversation

@nineinchnick

Copy link
Copy Markdown
Owner

Airlift config objects are mutable, so classes and helpers should only get the property values they use, read in their @Inject constructors, instead of the whole OpenApiConfig, as discussed in the review of #343. Several helpers still got the config during construction, and Authentication kept it in a field and passed it to its static credential resolvers (#345, #352).

The catalog credentials are now resolved once into an immutable CatalogCredentials value, used by authentication, fetching the spec from spec-location, and naming the HTTP cache directory. Like UserCredentials, it has no JSON form and doesn't print its values, so it can't leak into logs, handles, or splits. Retries get a small RetryOptions record, and the spec fetcher gets the credentials only when spec-location-authentication requires them.

This doesn't change the behavior.

Fixes #348

Airlift config objects are mutable, so the retry policy shouldn't get the
whole config, only the values it uses, read when the client and the spec
are created.
Airlift config objects are mutable, so checking whether credentials can be
sent to the declared servers shouldn't get the whole config, only the
values it uses, read when the servers are resolved.
Airlift config objects are mutable, so naming the HTTP cache directory
shouldn't get the whole config. The catalog credentials are resolved once
into an immutable value instead, which authentication and fetching the
spec can use too. Like the credentials of users, they have no JSON form
and are not printed, so they can't leak into logs, handles, or splits.
Airlift config objects are mutable, so Authentication shouldn't keep the
whole config, and pass it to the helpers resolving credentials. It uses
the credentials resolved once when the catalog is created instead.
Airlift config objects are mutable, so loading the spec shouldn't pass the
whole config to the parser and the fetcher. They get the spec location, the
retry options, and the catalog credentials, only when the spec location
requires them, read when the spec is created.
@nineinchnick
nineinchnick merged commit 4ec99f0 into main Oct 24, 2026
1 check passed
@nineinchnick
nineinchnick deleted the pass-config-values branch October 24, 2026 16:34
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.

Pass only the needed config values instead of OpenApiConfig

1 participant