-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[msal-node] Cache Lookup - 1: Logical keys for cache entities #1624
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
Conversation
credential
key generation to a common placeThere 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.
* Generate Account Id key component as per the schema: <home_account_id>-<environment> | ||
*/ | ||
generateRealm(): string { | ||
return (this.realm || "").toLowerCase(); |
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 think empty space is used in multiple places, consider adding it to the constants file
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.
+1 for EMPTY_STRING constant
…arams and avoid null params
/** | ||
* Generate Account Id key component as per the schema: <home_account_id>-<environment> | ||
*/ | ||
generateAccountId(): string { |
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.
Can these be used as utils for cache lookup (i.e. generate keys for looking up a specific cred)?
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.
So generating accountId for an account object instance should be separate from generating it from a set of values. I will try coming up with common code as needed, for now I added static helpers in CacheHelper.ts
in a later PR to address this. Point noted though.
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.
Couple questions but otherwise looks ok
[msal-node] Cache Lookup - 3: Msal node cache response
…/AzureAD/microsoft-authentication-library-for-js into msal-node-cache-lookup-interface
[msal-node] Cache Lookup - 2: Save, lookup and delete entities
This PR generates
AccountId
andCredentialId
as a part of theCredentialEntity
andAccountEntity
which will be later used in looking up cache elements as needed.Context :
Schema
Account
andCredential
cache has the below schema for keys:But to tie up a
Credential
withAccount
, the keys are logically divided as follows:Logical key components
Credential