[ https://issues.apache.org/jira/browse/HADOOP-18516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17645109#comment-17645109 ]
ASF GitHub Bot commented on HADOOP-18516: ----------------------------------------- anmolanmol1234 commented on code in PR #5148: URL: https://github.com/apache/hadoop/pull/5148#discussion_r1044138742 ########## hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/utils/SASGenerator.java: ########## @@ -85,17 +87,34 @@ private void initializeMac() { } } + protected String getCanonicalAccountName(String accountName) throws InvalidConfigurationValueException { + // returns the account name without the endpoint + int dotIndex = accountName.indexOf(AbfsHttpConstants.DOT); + if (dotIndex == 0) { + // case when accountname starts with a ".": endpoint is present, accountName is null + throw new InvalidConfigurationValueException("Account Name is not fully qualified"); + } + if (dotIndex > 0) { + // case when endpoint is present with accountName + return accountName.substring(0, dotIndex); + } else { + // case when accountName is already canonicalized + return accountName; + } + } + protected String computeHmac256(final String stringToSign) { byte[] utf8Bytes; try { utf8Bytes = stringToSign.getBytes(StandardCharsets.UTF_8.toString()); + // utf8Bytes = stringToSign.getBytes("UTF-8"); } catch (final UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } byte[] hmac; synchronized (this) { hmac = hmacSha256.doFinal(utf8Bytes); } - return Base64.encode(hmac); + return org.apache.hadoop.fs.azurebfs.utils.Base64.encode(hmac); Review Comment: Remove the full import > [ABFS]: Support fixed SAS token config in addition to SAS Token Provider class > ------------------------------------------------------------------------------ > > Key: HADOOP-18516 > URL: https://issues.apache.org/jira/browse/HADOOP-18516 > Project: Hadoop Common > Issue Type: Improvement > Components: fs/azure > Affects Versions: 3.3.4 > Reporter: Sree Bhattacharyya > Assignee: Sree Bhattacharyya > Priority: Minor > Labels: pull-request-available > > Introduce a new configuration for setting the fixed account/service SAS token > in ABFS driver. This will be in addition to the implementations of the > SASTokenProvider interface that can be used for obtaining a SAS Token from > the user. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org