Skip to content

Commit

Permalink
Merge branch 'master' into users/balaperu/query_spec_continuation
Browse files Browse the repository at this point in the history
  • Loading branch information
Bala Perumalswamy committed Sep 5, 2023
2 parents b5b9159 + c72ebc8 commit b1b3c78
Show file tree
Hide file tree
Showing 109 changed files with 11,805 additions and 3,924 deletions.
14 changes: 14 additions & 0 deletions .github/policies/resourceManagement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ configuration:
- addLabel:
label: needs-investigation
description:
- if:
- payloadType: Issues
- isAction:
action: Opened
- not:
or:
- activitySenderHasPermission:
permission: Write
- activitySenderHasPermission:
permission: Admin
then:
- addLabel:
label: customer-reported
description: Identifies issues created by users without write access as customers
- if:
- payloadType: Pull_Request
- hasLabel:
Expand Down
10 changes: 5 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ClientOfficialVersion>3.35.2</ClientOfficialVersion>
<ClientPreviewVersion>3.35.2</ClientPreviewVersion>
<ClientOfficialVersion>3.35.3</ClientOfficialVersion>
<ClientPreviewVersion>3.35.3</ClientPreviewVersion>
<ClientPreviewSuffixVersion>preview</ClientPreviewSuffixVersion>
<DirectVersion>3.31.3</DirectVersion>
<EncryptionOfficialVersion>2.0.2</EncryptionOfficialVersion>
<EncryptionPreviewVersion>2.0.2</EncryptionPreviewVersion>
<DirectVersion>3.31.4</DirectVersion>
<EncryptionOfficialVersion>2.0.3</EncryptionOfficialVersion>
<EncryptionPreviewVersion>2.0.3</EncryptionPreviewVersion>
<EncryptionPreviewSuffixVersion>preview</EncryptionPreviewSuffixVersion>
<CustomEncryptionVersion>1.0.0-preview06</CustomEncryptionVersion>
<HybridRowVersion>1.1.0-preview3</HybridRowVersion>
Expand Down
10 changes: 10 additions & 0 deletions Microsoft.Azure.Cosmos.Encryption/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ Preview features are treated as a separate branch and will not be included in th
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### <a name="2.0.3"/> [2.0.3](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.3) - 2023-07-12

#### Added
- [#3979](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3979) Adds fix for supporting Prefix Partition Key (Hierarchical partitioning).

### <a name="2.0.3-preview"/> [2.0.3-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.3-preview) - 2023-07-12

#### Added
- [#3979](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3979) Adds fix for supporting Prefix Partition Key (Hierarchical partitioning).

### <a name="2.0.2"/> [2.0.2](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.2) - 2023-06-01

#### Added
Expand Down
17 changes: 12 additions & 5 deletions Microsoft.Azure.Cosmos.Encryption/src/EncryptionContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -957,15 +957,22 @@ internal async Task<string> CheckIfIdIsEncryptedAndGetEncryptedIdAsync(
JArray jArray = JArray.Parse(partitionKey.ToString());

#if ENCRYPTIONPREVIEW
if (jArray.Count > 1)
if (encryptionSettings.PartitionKeyPaths.Count > 1)
{
int i = 0;
int counter = 0;
PartitionKeyBuilder partitionKeyBuilder = new PartitionKeyBuilder();

if (jArray.Count() > encryptionSettings.PartitionKeyPaths.Count())
{
throw new NotSupportedException($"The number of partition keys passed in the query exceeds the number of keys initialized on the container. Container Id : {this.Id}");
}
bool isPkEncrypted = false;

// partitionKeyBuilder expects the paths and values to be in same order.
foreach (string path in encryptionSettings.PartitionKeyPaths)
for(counter = 0; counter < jArray.Count(); counter++)
{
string path = encryptionSettings.PartitionKeyPaths[counter];

// case: partition key path is /a/b/c and the client encryption policy has /a in path.
// hence encrypt the partition key value with using its top level path /a since /c would have been encrypted in the document using /a's policy.
string partitionKeyPath = path.Split('/')[1];
Expand All @@ -975,12 +982,12 @@ internal async Task<string> CheckIfIdIsEncryptedAndGetEncryptedIdAsync(

if (encryptionSettingForProperty == null)
{
partitionKeyBuilder.Add(jArray[i++].ToString());
partitionKeyBuilder.Add(jArray[counter].ToString());
continue;
}

isPkEncrypted = true;
Stream valueStream = EncryptionProcessor.BaseSerializer.ToStream(jArray[i++]);
Stream valueStream = EncryptionProcessor.BaseSerializer.ToStream(jArray[counter]);

Stream encryptedPartitionKey = await EncryptionProcessor.EncryptValueStreamAsync(
valueStreamToEncrypt: valueStream,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
</ItemGroup>

<ItemGroup Condition=" '$(SdkProjectRef)' != 'True' AND '$(IsPreview)' != 'True' ">
<PackageReference Include="Microsoft.Azure.Cosmos" Version="[3.31.0,3.34.0]" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="[3.31.0,3.35.2]" />
</ItemGroup>

<ItemGroup Condition=" '$(SdkProjectRef)' != 'True' AND '$(IsPreview)' == 'True' ">
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.34.0-preview" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.35.2-preview" />
</ItemGroup>

<ItemGroup Condition=" '$(SdkProjectRef)' == 'True' ">
Expand Down
Loading

0 comments on commit b1b3c78

Please sign in to comment.