-
Notifications
You must be signed in to change notification settings - Fork 87
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
Adding ExportReplace to support the Context object [breaking change for 1.0] #378
Conversation
manager always reads in-memory data because callers handle any cache I/O
e4a3e42
to
7745a7c
Compare
I added some changes to help get this to the finish line:
|
apps/confidential/confidential.go
Outdated
@@ -740,12 +739,11 @@ func (cca Client) AcquireTokenOnBehalfOf(ctx context.Context, userAssertion stri | |||
} | |||
|
|||
// Account gets the account in the token cache with the specified homeAccountID. | |||
func (cca Client) Account(homeAccountID string) Account { | |||
return cca.base.Account(homeAccountID) | |||
func (cca Client) Account(ctx context.Context, homeAccountID string) (Account, error) { |
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.
Consider naming the id accountId
instead of homeAccountId
. The concept of "home" implies tenancy, which is only in AAD. ADFS doesn't have this. And as we expand to other IdPs, they likely won't have this either.
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.
As discussed, clothe the returns and ignore my comment on the named returns, I apparently was too tired to be doing reviews, I now see the defer with assignments.
This is approved, however since I created this thing and you are finishing it, I can't approve it.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
This PR adds support for the Context object in caches that are implementing a cache.
We cannot update ExportReplace without breaking implementors, so we are introducing an ExportReplaceCtx as a superset.
Calls that use methods from ExportReplace will now check for the existence of ExportReplaceCtx and use those superset methods instead if available.