-
Notifications
You must be signed in to change notification settings - Fork 494
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
Client Encryption: Adds fix to allow partition key path and id to be part of client encryption policy. #3211
Conversation
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.
Please follow the required format: "[Internal] Category: (Adds|Fixes|Refactors|Removes) Description"
Internal should be used for PRs that have no customer impact. This flag is used to help generate the changelog to know which PRs should be included. Examples:
Diagnostics: Adds GetElapsedClientLatency to CosmosDiagnostics
PartitionKey: Fixes null reference when using default(PartitionKey)
[v4] Client Encryption: Refactors code to external project
[Internal] Query: Adds code generator for CosmosNumbers for easy additions in the future.
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.
Please follow the required format: "[Internal] Category: (Adds|Fixes|Refactors|Removes) Description"
Internal should be used for PRs that have no customer impact. This flag is used to help generate the changelog to know which PRs should be included. Examples:
Diagnostics: Adds GetElapsedClientLatency to CosmosDiagnostics
PartitionKey: Fixes null reference when using default(PartitionKey)
[v4] Client Encryption: Refactors code to external project
[Internal] Query: Adds code generator for CosmosNumbers for easy additions in the future.
Microsoft.Azure.Cosmos/src/Resource/Settings/ClientEncryptionPolicy.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/Resource/Settings/ClientEncryptionPolicy.cs
Outdated
Show resolved
Hide resolved
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.
My 2 cents: Don't even try to support non-strings as partition keys. numbers in json are evil (neither range nor precision are clearly standardized - so supported ranges/precisions depend on the json parsers/libraries used - and this can cause hard to diagnose and mitigate issues). The good thing for end-to-end encryption is that all workloads are green-field - no scenario where a customer has TBs of data already. I think we should simply only support strings, instead of hacking something together that might work in most scenarios but doesn't solve the underlying problem that json doesn't have a clear definition for numbers - that solves the encryption-specific challenge of having to know the type and prevents customers form running into the other issues with numbers as PK later.
To be honest only supporting strings as PK is what we should have done across the board - too late now, because it is a breaking change. But with encryption we have the benefit of a "fresh start" for every workload - so let's do it right this time.
Closed by mistake :) |
Fixed. |
Microsoft.Azure.Cosmos/src/Resource/Settings/ClientEncryptionPolicy.cs
Outdated
Show resolved
Hide resolved
Please add a comment on this class, something like: 'The <see cref=ClientEncryptionPolicy should be initialized with policyFormatVersion 2 if "id" or properties that are part of the partition key need to be encrypted'. Also we need to mention that all PK property values need to be JSON strings. Goal is that this documentation should suffice to let customers know how to use the functionality. Ideally add some examples too where possible. Refers to: Microsoft.Azure.Cosmos/src/Resource/Settings/ClientEncryptionPolicy.cs:40 in cba1c4d. [](commit_id = cba1c4d, deletion_comment = False) |
Microsoft.Azure.Cosmos/src/Resource/Settings/ClientEncryptionPolicy.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/Resource/Settings/ClientEncryptionPolicy.cs
Outdated
Show resolved
Hide resolved
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.
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.
@kirankumarkolli Please review public API change
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.
Thanks - looks good to me now.
Description
The PR brings in the following changes.
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #IssueNumber