-
Notifications
You must be signed in to change notification settings - Fork 383
FOCI #957
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
FOCI #957
Conversation
| } | ||
|
|
||
| /// <inheritdoc /> | ||
| public int RefreshTokenCount => throw new NotImplementedException(); |
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 decided to remove these from the interface because they are actually only implemented on the InMemory stuff and are only used for test. It's dangerous to leave here, as one of use could use it, test on .net (which works), then realize that on Android and iOS it throws a NotImplEx....
If you agree with this, you can ignore looking at the rest of the commit - it's just refactoring tests.
src/Microsoft.Identity.Client/Cache/Items/MsalAppMetadataCacheItem.cs
Outdated
Show resolved
Hide resolved
tests/Microsoft.Identity.Test.Unit.net45/CoreTests/CacheTests/MsalTokenCacheKeysTests.cs
Outdated
Show resolved
Hide resolved
d74060c to
9ca5d71
Compare
|
|
||
| namespace Microsoft.Identity.Client.Cache.Items | ||
| { | ||
| [DataContract] |
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.
[DataContract] [](start = 4, length = 14)
isn't this needed for MSAL v2 cache? The dictionary serializer?
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 don't think so, none of the other cache items have this attribute.
| // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| // THE SOFTWARE. | ||
| // | ||
| // ------------------------------------------------------------------------------ |
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.
what about using the new short format?
henrik-me
left a comment
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.
🕐
| @@ -0,0 +1,201 @@ | |||
| { | |||
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.
@rayluo - check out this serialized cache that contains both app metadata and an FRT. Let me know if the format isn't what you expect.
tests/Microsoft.Identity.Test.Unit.net45/Resources/ExpectedTokenCache.json
Show resolved
Hide resolved
| SetServiceBundle(serviceBundle); | ||
| } | ||
|
|
||
| private TokenCache(IPlatformProxy proxy) |
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.
private TokenCache(IPlatformProxy proxy) [](start = 8, length = 40)
Shouldn't this rather a helper similar to SetServiceBundle ?
tests/Microsoft.Identity.Test.Unit.net45/CacheTests/TokenCacheTests.cs
Outdated
Show resolved
Hide resolved
| /// <summary> | ||
| /// App metadata is an optional entity in cache and can be used by apps to store additional metadata applicable to a particular client. | ||
| /// </summary> | ||
| internal class MsalAppMetadataCacheKey : IiOSKey |
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.
MsalAppMetadataCacheKey [](start = 19, length = 23)
Is this in sync with what iOS native does for the storage?
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.
Yes, Olga documented this pretty well. Also, the feature flag for FOCI for iOS and Android is set to false, meaning that:
- we won't serialize app metadata
- we won't serialize the FamilyId field in the RT
- we won't make cache calls to check AppMetadat or FRT
Let me know if this makes sense - I tried to optimize for performance, i.e. eliminate cache calls.
I can easily enable FOCI on iOS and Android (just a few simple methods to implement). On iOS, it should just work because the Cache Schema is documented. On Android not so much, but we can just choose a location for appmetadata and be done with it.
|
Has it been validated that this implementation is not causing issues in our cache sharing with iOS native? |
98eca64 to
87a44c1
Compare
|
This is now complete. If you find that there are too many files to review, I suggest you review: TokenCache, SilentRequest and FociTests - the rest should be uncontroversial. |
| @@ -0,0 +1,13 @@ | |||
| namespace Microsoft.Identity.Client.Cache.Keys | |||
| { | |||
| internal interface IiOSKey | |||
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.
IiOSKey [](start = 23, length = 7)
IMsalIOSCacheKey ?
|
Generally looks good. Let's have a quick sync in person. In reply to: 473578846 [](ancestors = 473578846) |
Please review commit by commit, some are just refactoring.