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
NXP-29129: refresh aws s3 token #917
Conversation
View issue in JIRA: NXP-29129: Web UI Upload Issues |
c04872b
to
c1d52e5
Compare
⭐ PR built and available in a preview environment nuxeo-nuxeo-web-ui-pr-917 here |
credentials.refresh = (cb) => | ||
this._resource(`upload/${this.batchId}/refreshToken`) | ||
.post() | ||
.then((response) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a catch(cb)
before merging this
options.awsSessionToken, | ||
); | ||
credentials.expireTime = new Date(options.expiration); | ||
credentials.refresh = (cb) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When will this refresh
be called? Do we need to implement needsRefresh
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, default needsRefresh
implementaton works with the expiration
info, see https://github.com/aws/aws-sdk-js/blob/master/lib/credentials.js#L95
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
No description provided.