Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HADOOP-17388. AbstractS3ATokenIdentifier to issue date in UTC #2477

Merged
merged 1 commit into from
Nov 20, 2020

Conversation

HeartSaVioR
Copy link
Contributor

In HADOOP-17379, I missed to set issue date as local timezone sensitive, whereas we actually set issue date in UTC.

@Override
protected synchronized byte[] createPassword(TokenIdent identifier) {
int sequenceNum;
long now = Time.now();
sequenceNum = incrementDelegationTokenSeqNum();
identifier.setIssueDate(now);
identifier.setMaxDate(now + tokenMaxLifetime);
identifier.setMasterKeyId(currentKey.getKeyId());
identifier.setSequenceNumber(sequenceNum);
LOG.info("Creating password for identifier: " + formatTokenId(identifier)
+ ", currentKey: " + currentKey.getKeyId());
byte[] password = createPassword(identifier.getBytes(), currentKey.getKey());
DelegationTokenInformation tokenInfo = new DelegationTokenInformation(now
+ tokenRenewInterval, password, getTrackingIdIfEnabled(identifier));
try {
storeToken(identifier, tokenInfo);
} catch (IOException ioe) {
LOG.error("Could not store token " + formatTokenId(identifier) + "!!",
ioe);
}
return password;
}

This PR fixes the issue.

@HeartSaVioR
Copy link
Contributor Author

cc. @steveloughran Appreciate your review. Thanks!

@hadoop-yetus

This comment has been minimized.

@HeartSaVioR
Copy link
Contributor Author

Rationalization of no new test: tests were addressed in HADOOP-17379. Please let me know if we need to improve the test to strictly check for issue date that current time of UTC is returned.

asflicense looks to be false alarm, or real issue brought from other PR.

@steveloughran
Copy link
Contributor

ASF license is an independent and I need to work out what's up there. We deleted those files earlier in the week, see

@steveloughran
Copy link
Contributor

LGTM, +1

@steveloughran steveloughran merged commit f3c629c into apache:trunk Nov 20, 2020
asfgit pushed a commit that referenced this pull request Nov 20, 2020
Followup to HADOOP-17379.

Contributed by Jungtaek Lim.

Change-Id: I7b2fce36028d297c1e095499691a08caba92d9fd
@steveloughran
Copy link
Contributor

+1, merged to 3.3+

@HeartSaVioR
Copy link
Contributor Author

Thanks for reviewing and merging!

jojochuang pushed a commit to jojochuang/hadoop that referenced this pull request May 23, 2023
… UTC. (apache#2477)

Followup to HADOOP-17379.

Contributed by Jungtaek Lim.

Change-Id: I7b2fce36028d297c1e095499691a08caba92d9fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants