Add ClientAuthenticationMethod constants tls_client_auth and self_signed_tls_client_auth

Closes gh-14889
This commit is contained in:
Joe Grandja 2024-04-11 14:59:51 -04:00
parent 644cfa9f87
commit 9a7f1aa4d9
2 changed files with 24 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -62,6 +62,17 @@ public final class ClientAuthenticationMethod implements Serializable {
*/
public static final ClientAuthenticationMethod NONE = new ClientAuthenticationMethod("none");
/**
* @since 6.3
*/
public static final ClientAuthenticationMethod TLS_CLIENT_AUTH = new ClientAuthenticationMethod("tls_client_auth");
/**
* @since 6.3
*/
public static final ClientAuthenticationMethod SELF_SIGNED_TLS_CLIENT_AUTH = new ClientAuthenticationMethod(
"self_signed_tls_client_auth");
private final String value;
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -58,4 +58,15 @@ public class ClientAuthenticationMethodTests {
assertThat(ClientAuthenticationMethod.NONE.getValue()).isEqualTo("none");
}
@Test
public void getValueWhenAuthenticationMethodTlsClientAuthThenReturnTlsClientAuth() {
assertThat(ClientAuthenticationMethod.TLS_CLIENT_AUTH.getValue()).isEqualTo("tls_client_auth");
}
@Test
public void getValueWhenAuthenticationMethodSelfSignedTlsClientAuthThenReturnSelfSignedTlsClientAuth() {
assertThat(ClientAuthenticationMethod.SELF_SIGNED_TLS_CLIENT_AUTH.getValue())
.isEqualTo("self_signed_tls_client_auth");
}
}