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

security: Stabilize AdvancedTlsX509KeyManager. #11139

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Conversation

erm-g
Copy link
Contributor

@erm-g erm-g commented May 1, 2024

This PR is a part of 'Stabilize Advanced TLS' effort.
Clean up, improve javadoc, de-experimentalize of AdvancedTlsX509KeyManager, add a unit test (e2e already exists).

Copy link
Contributor

@matthewstevenson88 matthewstevenson88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @erm-g! A couple nits, and two other points:

  1. This PR only de-experimentalizes the key manager. Should we amend the PR title accordingly?
  2. Please address the failing tests.

@erm-g erm-g changed the title Clean up and de-experimentalization of AdvancedTLS Clean up and de-experimentalization of AdvancedTlsX509KeyManager May 7, 2024
Copy link
Contributor

@matthewstevenson88 matthewstevenson88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the failing tests. :)

@erm-g
Copy link
Contributor Author

erm-g commented May 8, 2024

Please address the failing tests. :)

Fixed (few styling things)

@erm-g erm-g changed the title Clean up and de-experimentalization of AdvancedTlsX509KeyManager security: Stabilize AdvancedTlsX509KeyManager. May 8, 2024
}

@Test
public void credentialSettingParameterValidity() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to be testing several distinct behaviors in the same unit test - can we break these up into separate smaller-scoped tests so that each unit test is testing an independent behavior?

Similarly above in the credentialSetting test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this test we're just checking that we correctly put checkNotNull checks across the public api. So I grouped that under single unit test since I saw a similar pattern at MatcherTest -

credentialSetting is different - we check a sequence of changing (serverCert->clientCert->serverCert) so splitting it is possible, but will require a lot of boilerplate code (smth like wordy BeforeMethod before each test)

@erm-g erm-g requested a review from ejona86 May 8, 2024 19:59
@erm-g erm-g requested a review from ejona86 May 17, 2024 21:44
Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's swap to FakeClock, but otherwise looks good.

@ejona86
Copy link
Member

ejona86 commented May 29, 2024

@matthewstevenson88, do you want us to wait for your approval before this goes in?

@matthewstevenson88
Copy link
Contributor

Thanks @ejona86. LGTM, and ok to merge once the FakeClock change is done.

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.

None yet

3 participants