From 06ff2e479d4ca7000eefdf14be1f5dad8d599d7c Mon Sep 17 00:00:00 2001 From: Stephen Crawford Date: Tue, 11 Oct 2022 12:01:08 -0400 Subject: [PATCH] Naming conventions Signed-off-by: Stephen Crawford --- .../identity/ExtensionTokenProcessor.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/src/main/java/org/opensearch/identity/ExtensionTokenProcessor.java b/server/src/main/java/org/opensearch/identity/ExtensionTokenProcessor.java index 2965b81bb4a0b..8e6e951d4b457 100644 --- a/server/src/main/java/org/opensearch/identity/ExtensionTokenProcessor.java +++ b/server/src/main/java/org/opensearch/identity/ExtensionTokenProcessor.java @@ -129,14 +129,14 @@ public Principal extractPrincipal(PrincipalIdentifierToken token) throws Illegal // check is token is valid, we don't do anything if it is valid // else we re-throw the thrown exception - String token_name = token.getWriteableName(); - byte[] token_bytes = token_name.getBytes(); + String tokenName = token.getWriteableName(); + byte[] tokenBytes = tokenName.getBytes(); validateToken(token); - byte[] principalNameEncodedBytes = Arrays.copyOfRange(token_bytes, 0, KEY_SIZE); - byte[] extensionNameEncodedBytes = Arrays.copyOfRange(token_bytes, KEY_SIZE, token_bytes.length); + byte[] principalNameEncodedBytes = Arrays.copyOfRange(tokenBytes, 0, KEY_SIZE); + byte[] extensionNameEncodedBytes = Arrays.copyOfRange(tokenBytes, KEY_SIZE, tokenBytes.length); Cipher principalCipher = Cipher.getInstance(ALGORITHM); principalCipher.init(Cipher.DECRYPT_MODE, this.secretKey, new GCMParameterSpec(TAG_LENGTH, this.initializationVector)); @@ -167,10 +167,10 @@ public void validateToken(PrincipalIdentifierToken token) throws IllegalArgument throw new IllegalArgumentException(INVALID_TOKEN_MESSAGE); } - String token_name = token.getWriteableName(); - byte[] token_bytes = token_name.getBytes(); + String tokenName = token.getWriteableName(); + byte[] tokenBytes = tokenName.getBytes(); // Check whether token is correct length - if (token_bytes.length != KEY_SIZE*2) { + if (tokenBytes.length != KEY_SIZE*2) { throw new IllegalArgumentException(INVALID_TOKEN_MESSAGE); }