Repository navigation
Pass only the needed config values instead of OpenApiConfig - #359
Merged
Merged
Conversation
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.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Airlift config objects are mutable, so classes and helpers should only get the property values they use, read in their
@Injectconstructors, instead of the wholeOpenApiConfig, as discussed in the review of #343. Several helpers still got the config during construction, andAuthenticationkept it in a field and passed it to its static credential resolvers (#345, #352).The catalog credentials are now resolved once into an immutable
CatalogCredentialsvalue, used by authentication, fetching the spec from spec-location, and naming the HTTP cache directory. LikeUserCredentials, it has no JSON form and doesn't print its values, so it can't leak into logs, handles, or splits. Retries get a smallRetryOptionsrecord, and the spec fetcher gets the credentials only when spec-location-authentication requires them.This doesn't change the behavior.
Fixes #348