smiklosovic commented on code in PR #3085:
URL: https://github.com/apache/cassandra/pull/3085#discussion_r1479347972
##########
src/java/org/apache/cassandra/auth/IAuthenticator.java:
##########
@@ -179,5 +194,50 @@ default boolean shouldSendAuthenticateMessage()
{
return true;
}
+
+ /**
+ * @return The assumed mode of authentication attempted using this
negotiator, this will usually be some value
+ * of {@link AuthenticationMode#getDisplayName()} unless an
implementor provides their own custom authentication
+ * scheme.
+ */
+ default String getAuthenticationMode()
+ {
+ return AuthenticationMode.UNAUTHENTICATED.getDisplayName();
+ }
+ }
+
+ /**
+ * Known modes of authentication supported by Cassandra's provided {@link
IAuthenticator} implementations.
+ */
+ enum AuthenticationMode
+ {
+ /**
+ * User was not authenticated in any particular way.
+ */
+ UNAUTHENTICATED,
+ /**
+ * User authenticated using a password.
+ */
+ PASSWORD,
+ /**
+ * User authenticated using a trusted identity in their client
certificate.
+ */
+ MTLS;
+
+ private final String displayName;
+
+ AuthenticationMode()
+ {
+ this.displayName = StringUtils.capitalize(name().toLowerCase());
+ }
+
+ /**
+ * @return How the mode should be displayed to users. Formally it is
the enum name with the first letter
Review Comment:
@tolbertam aha, this is interesting ... why have you chose such a naming
convention? Why not just `AuthenticationMode.name()` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]