Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deserialization problems in TlsContextConfiguration #1210

Merged

Conversation

sleberknight
Copy link
Member

  • Replace Lombok constructor annotations with actual constructors such that the all-args constructor respects the default values.
  • Remove the Builder.Default methods since the default values are now handled in the all-args constructor.
  • The no-args constructor calls the all-args constructor with all null values so that defaults are in one place (instead of on field declarations and in the all-args constructor).
  • The all-args constructor sets the appropriate default values when it does not receive a value for a given field. It also has the ConstructorProperties annotation to help deserializers know how the arguments map to fields.
  • Update tests for TlsContextConfiguration and SecureEndpointsConfiguration so that deserialization from YAML is tested for both TlsContextConfiguration and SSLContextConfiguration (SecureEndpointsConfiguration extends it) using SnakeYAML, Jackson, and Dropwizard. Though Dropwizard uses Jackson and should be the same as using "plain Jackson," we want to make 100% sure Dropwizard isn't doing any kind of customization in Jackson that might change how it deserializes the YAML.
  • Add new helper methods in YamlTestHelper and rename the existing method so that the method names clearly express how they perform the deserialization, i.e., using SnakeYAML or Jackson.

Closes #1209

* Replace Lombok constructor annotations with actual constructors
  such that the all-args constructor respects the default values.
* Remove the Builder.Default methods since the default values
  are now handled in the all-args constructor.
* The no-args constructor calls the all-args constructor with
  all null values so that defaults are in one place (instead of
  on field declarations and in the all-args constructor).
* The all-args constructor sets the appropriate default values
  when it does not receive a value for a given field. It also
  has the ConstructorProperties annotation to help deserializers
  know how the arguments map to fields.
* Update tests for TlsContextConfiguration and
  SecureEndpointsConfiguration so that deserialization from YAML is
  tested for both TlsContextConfiguration and SSLContextConfiguration
  (SecureEndpointsConfiguration extends it) using SnakeYAML, Jackson,
  and Dropwizard. Though Dropwizard uses Jackson and should be the
  same as using "plain Jackson," we want to make 100% sure Dropwizard
  isn't doing any kind of customization in Jackson that might change
  how it deserializes the YAML.
* Add new helper methods in YamlTestHelper and rename the existing
  method so that the method names clearly express how they perform
  the deserialization, i.e., using SnakeYAML or Jackson.

Closes #1209
@sleberknight sleberknight self-assigned this Oct 20, 2024
Copy link

@sleberknight sleberknight merged commit 237afab into main Oct 20, 2024
5 checks passed
@sleberknight sleberknight deleted the 1209-fix-TlsContextConfiguration-deserialization-problems branch October 20, 2024 15:19
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.

TlsContextConfiguration does not respect default values when deserialized from YAML with Jackson
1 participant