-
Notifications
You must be signed in to change notification settings - Fork 7
Use platform OCSP implementation by default #95
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
base: v4
Are you sure you want to change the base?
Conversation
ed385dd to
2c1de73
Compare
| * @throws AuthTokenException when user certificate is revoked or revocation check fails. | ||
| */ | ||
| public void validateCertificateNotRevoked(X509Certificate subjectCertificate) throws AuthTokenException { | ||
| public RevocationInfo validateCertificateNotRevoked(X509Certificate subjectCertificate, X509Certificate issuerCertificate) throws AuthTokenException { |
Check notice
Code scanning / CodeQL
Missing Override annotation
| private static class OcpClientThatThrowsException extends IOException { | ||
| } | ||
|
|
||
| public static AuthTokenValidator getAuthTokenValidatorWithOverriddenOcspClient(OcspClient ocspClient) throws CertificateException, JceException, IOException { |
Check notice
Code scanning / CodeQL
Useless parameter
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 9 days ago
The best way to fix this problem is to remove the unused parameter from the method signature and update all method calls to stop passing the unnecessary argument. This keeps the code clean and prevents confusion for future maintainers. Specifically, in src/test/java/eu/webeid/ocsp/client/OcspClientOverrideTest.java, modify the signature of getAuthTokenValidatorWithOverriddenOcspClient to remove the OcspClient ocspClient parameter, and update invocations at lines 47 and 63 to call it without arguments. No additional imports or method definitions are required; only method signatures and usages need updating.
-
Copy modified line R47 -
Copy modified line R63 -
Copy modified line R78
| @@ -44,7 +44,7 @@ | ||
|
|
||
| @Test | ||
| void whenOcspClientIsOverridden_thenItIsUsed() throws JceException, CertificateException, IOException { | ||
| final AuthTokenValidator validator = getAuthTokenValidatorWithOverriddenOcspClient(new OcpClientThatThrows()); | ||
| final AuthTokenValidator validator = getAuthTokenValidatorWithOverriddenOcspClient(); | ||
| assertThatThrownBy(() -> validator.validate(validAuthToken, VALID_CHALLENGE_NONCE)) | ||
| .cause() | ||
| .isInstanceOf(OcpClientThatThrowsException.class); | ||
| @@ -60,9 +60,7 @@ | ||
| @Test | ||
| @Disabled("Demonstrates how to configure the built-in HttpClient instance for OcspClientImpl") | ||
| void whenOcspClientIsConfiguredWithCustomHttpClient_thenOcspCallSucceeds() throws JceException, CertificateException, IOException { | ||
| final AuthTokenValidator validator = getAuthTokenValidatorWithOverriddenOcspClient( | ||
| new OcspClientImpl(HttpClient.newBuilder().build(), Duration.ofSeconds(5)) | ||
| ); | ||
| final AuthTokenValidator validator = getAuthTokenValidatorWithOverriddenOcspClient(); | ||
| assertThatCode(() -> validator.validate(validAuthToken, VALID_CHALLENGE_NONCE)) | ||
| .doesNotThrowAnyException(); | ||
| } | ||
| @@ -77,7 +75,7 @@ | ||
| private static class OcpClientThatThrowsException extends IOException { | ||
| } | ||
|
|
||
| public static AuthTokenValidator getAuthTokenValidatorWithOverriddenOcspClient(OcspClient ocspClient) throws CertificateException, JceException, IOException { | ||
| public static AuthTokenValidator getAuthTokenValidatorWithOverriddenOcspClient() throws CertificateException, JceException, IOException { | ||
| // FIXME: test override | ||
| return AuthTokenValidators.getAuthTokenValidator(); | ||
| } |
b018323 to
9f7fb95
Compare
…tation to eu.webeid.ocsp and make it optional WE2-1030 Signed-off-by: Mart Somermaa <mrts@users.noreply.github.com>
9f7fb95 to
2e783f3
Compare
|


WE2-1030
Signed-off-by: Mart Somermaa mrts@users.noreply.github.com