/** * Calculates the expected correct password on the server side for the * general-purpose handshake. The password consists of the block access * token's password (known to the DataNode via its secret manager). This * expects that the client has supplied a user name consisting of its * serialized block access token identifier. * * @param userName SASL user name containing serialized block access token * identifier * @return expected correct SASL password * @throws IOException for any error */ private char[] buildServerPassword(String userName) throws IOException { BlockTokenIdentifier identifier = deserializeIdentifier(userName); byte[] tokenPassword = blockPoolTokenSecretManager.retrievePassword( identifier); return (new String(Base64.encodeBase64(tokenPassword, false), Charsets.UTF_8)).toCharArray(); }
/** * Calculates the expected correct password on the server side for the * general-purpose handshake. The password consists of the block access * token's password (known to the DataNode via its secret manager). This * expects that the client has supplied a user name consisting of its * serialized block access token identifier. * * @param userName SASL user name containing serialized block access token * identifier * @return expected correct SASL password * @throws IOException for any error */ private char[] buildServerPassword(String userName) throws IOException { BlockTokenIdentifier identifier = deserializeIdentifier(userName); byte[] tokenPassword = blockPoolTokenSecretManager.retrievePassword( identifier); return (new String(Base64.encodeBase64(tokenPassword, false), Charsets.UTF_8)).toCharArray(); }
/** * Calculates the expected correct password on the server side for the * general-purpose handshake. The password consists of the block access * token's password (known to the DataNode via its secret manager). This * expects that the client has supplied a user name consisting of its * serialized block access token identifier. * * @param userName SASL user name containing serialized block access token * identifier * @return expected correct SASL password * @throws IOException for any error */ private char[] buildServerPassword(String userName) throws IOException { BlockTokenIdentifier identifier = deserializeIdentifier(userName); byte[] tokenPassword = blockPoolTokenSecretManager.retrievePassword( identifier); return (new String(Base64.encodeBase64(tokenPassword, false), Charsets.UTF_8)).toCharArray(); }