Skip to content

Conversation

@bgavrilMS
Copy link
Member

@bgavrilMS bgavrilMS commented Mar 8, 2019

Please review commit by commit, some are just refactoring.

}

/// <inheritdoc />
public int RefreshTokenCount => throw new NotImplementedException();
Copy link
Member Author

@bgavrilMS bgavrilMS Mar 8, 2019

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.


namespace Microsoft.Identity.Client.Cache.Items
{
[DataContract]
Copy link
Contributor

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?

Copy link
Member Author

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.
//
// ------------------------------------------------------------------------------
Copy link
Contributor

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?

Copy link
Contributor

@henrik-me henrik-me left a 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 @@
{
Copy link
Member Author

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.

SetServiceBundle(serviceBundle);
}

private TokenCache(IPlatformProxy proxy)
Copy link
Contributor

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 ?

/// <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
Copy link
Contributor

@henrik-me henrik-me Mar 15, 2019

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?

Copy link
Member Author

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.

@henrik-me
Copy link
Contributor

Has it been validated that this implementation is not causing issues in our cache sharing with iOS native?

@bgavrilMS
Copy link
Member Author

@henrik-me , @MarkZuber

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.

@bgavrilMS bgavrilMS requested a review from henrik-me March 16, 2019 19:50
@@ -0,0 +1,13 @@
namespace Microsoft.Identity.Client.Cache.Keys
{
internal interface IiOSKey
Copy link
Contributor

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 ?

@henrik-me
Copy link
Contributor

Generally looks good. Let's have a quick sync in person.


In reply to: 473578846 [](ancestors = 473578846)

@bgavrilMS bgavrilMS merged commit f0bc7e0 into dev3x Mar 19, 2019
@bgavrilMS bgavrilMS deleted the bogavril/foci branch March 19, 2019 01:39
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.

5 participants