Skip to content

[core-rest-pipeline] Token refresher update, based on the latest design by Will#14554

Merged
sadasant merged 5 commits intoAzure:masterfrom
sadasant:core-rest-pipeline/refresher
Apr 1, 2021
Merged

[core-rest-pipeline] Token refresher update, based on the latest design by Will#14554
sadasant merged 5 commits intoAzure:masterfrom
sadasant:core-rest-pipeline/refresher

Conversation

@sadasant
Copy link
Copy Markdown
Contributor

@sadasant sadasant commented Mar 26, 2021

@willmtemple just finished a rewrite of the bearerTokenAuthenticationPolicy on the old core: PR #14223

We also want to have this same update in the new core, so I've copied the changes he did into core-rest-pipeline.

This PR closes an early draft I did some time ago: #13832

For this PR I've decided, similar to Will's PR on the old core, to not alter the public API of core-rest-pipeline. We can keep this refresher configuration private until customers ask for this. These are also private in other languages.

Feedback always appreciated 🙏

Related to #13369

@sadasant sadasant self-assigned this Mar 26, 2021
Copy link
Copy Markdown
Member

@witemple-msft witemple-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@sadasant sadasant marked this pull request as ready for review April 1, 2021 00:00
Copy link
Copy Markdown
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good to me. I confess I didn't think super hard about the cycler implementation as I assume it's unchanged from core-http

async function beginRefresh(
getAccessToken: () => Promise<AccessToken | null>,
retryIntervalInMs: number,
timeoutInMs: number
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: timeoutInMs really sounds like the number of ms to wait, not a date stamp in epoch ticks. Can we rename to something better? I'm struggling to come up with it though... /cc @bterlson any thoughts?

Copy link
Copy Markdown
Contributor Author

@sadasant sadasant Apr 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about refreshExpiry? @willmtemple
I'm ok with other names, but I agree with Jeff.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ll use refreshExpiry for now, Brian liked it over teams!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait I like refreshTimeout more... I'll push refresh timeout for now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to fix conflicts on another PR for Jeremy, I'll merge this for now. We can address more feedback alter 😁😁

@ghost
Copy link
Copy Markdown

ghost commented Apr 1, 2021

Hello @sadasant!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@sadasant sadasant merged commit db3fe23 into Azure:master Apr 1, 2021
@sadasant sadasant deleted the core-rest-pipeline/refresher branch April 1, 2021 04:05
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