office-js

Office JS Partition Key - What is it partitioning by?


In my testing on the desktop, Office.context.partitionKey is undefined.

In the docs, it states:

Gets a partition key for local storage. Add-ins should use this partition key as part of the storage key to securely store data. The partition key is undefined in environments without partitioning, such as the browser controls for Windows applications.

In the cases where it is defined, what is it partitioning by?

For example, does it refer to:

My intuition would say it should be the first option, however I wasn't able to find anything explicit that references this.

What is the partition key partitioning by?


Solution

  • The partitioning is by an ordered pair of domains:

    So, each of the following would be a different partition:

    excel.cloud.microsoft + myAddin.contoso.com

    word.cloud.microsoft + myAddin.contoso.com

    word.cloud.microsoft + myOtherAddin.contoso.com

    The partition key is a hash of the two domains.