Skip to content

Commit

Permalink
Client Encryption: Fixes issue with clients using incorrect/stale Enc…
Browse files Browse the repository at this point in the history
…ryption Policy or Encryption Keys from the cache. (Azure#2403)

This PR fixes issue with clients using incorrect or stale policy when cache is not updated with the latest Encryption policy or Encryption Key, which could occur when a container or database is deleted and recreated with same Id but with different policy and Keys.
  • Loading branch information
kr-santosh authored May 6, 2021
1 parent ea8e7bf commit 3a6981a
Show file tree
Hide file tree
Showing 13 changed files with 1,565 additions and 759 deletions.
3 changes: 2 additions & 1 deletion Microsoft.Azure.Cosmos.Encryption/src/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ namespace Microsoft.Azure.Cosmos.Encryption
{
internal static class Constants
{
public const int CachedEncryptionSettingsDefaultTTLInMinutes = 60;
public const string DocumentsResourcePropertyName = "Documents";
public const string SubStatusHeader = "x-ms-substatus";
public const string IncorrectContainerRidSubStatus = "1024";
}
}
32 changes: 16 additions & 16 deletions Microsoft.Azure.Cosmos.Encryption/src/Custom/EncryptionContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -927,22 +927,6 @@ public override Task<ResponseMessage> PatchItemStreamAsync(
throw new NotImplementedException();
}

public override Task<ResponseMessage> ReadManyItemsStreamAsync(
IReadOnlyList<(string id, PartitionKey partitionKey)> items,
ReadManyRequestOptions readManyRequestOptions = null,
CancellationToken cancellationToken = default)
{
throw new NotImplementedException();
}

public override Task<FeedResponse<T>> ReadManyItemsAsync<T>(
IReadOnlyList<(string id, PartitionKey partitionKey)> items,
ReadManyRequestOptions readManyRequestOptions = null,
CancellationToken cancellationToken = default)
{
throw new NotImplementedException();
}

public override ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder<T>(
string processorName,
ChangeFeedHandler<T> onChangesDelegate)
Expand Down Expand Up @@ -970,5 +954,21 @@ public override ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManu
{
throw new NotImplementedException();
}

public override Task<ResponseMessage> ReadManyItemsStreamAsync(
IReadOnlyList<(string id, PartitionKey partitionKey)> items,
ReadManyRequestOptions readManyRequestOptions = null,
CancellationToken cancellationToken = default)
{
throw new NotImplementedException();
}

public override Task<FeedResponse<T>> ReadManyItemsAsync<T>(
IReadOnlyList<(string id, PartitionKey partitionKey)> items,
ReadManyRequestOptions readManyRequestOptions = null,
CancellationToken cancellationToken = default)
{
throw new NotImplementedException();
}
}
}
Loading

0 comments on commit 3a6981a

Please sign in to comment.