Skip to content
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

Cosmos v4 encryption #9984

Merged
merged 49 commits into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ea52d30
encryption draft
moderakh Apr 8, 2020
bfdceec
added sample code
moderakh Apr 8, 2020
68a98c0
Merge branch 'master' into users/moderakh/v4-encryption-merge-master
moderakh Apr 14, 2020
e1452a4
undo changes for bom
moderakh Apr 14, 2020
21e98da
encryption and storing key in cosmos container
moderakh Apr 20, 2020
ed26d12
minor cleanup
moderakh Apr 20, 2020
91c5435
Merge branch 'master' into users/moderakh/merge-master-to-encryption
moderakh Apr 20, 2020
b13ee3a
minor cleanup
moderakh Apr 20, 2020
408d76b
Merge branch 'master' into users/moderakh/encryption-20200618
moderakh Jun 23, 2020
d805672
Merge branch 'master' into feature/cosmos/v4-encryption
moderakh Jun 24, 2020
a05704f
added back removed files
moderakh Jun 24, 2020
d308e38
Merge branch 'master' into feature/cosmos/v4-encryption
moderakh Jun 25, 2020
ce4f3ea
address code review comments
moderakh Jun 25, 2020
90db035
decrypt on write as well
moderakh Jun 25, 2020
0e0ce5b
review comments
moderakh Jul 6, 2020
e43a3c7
code review
moderakh Jul 8, 2020
7aca1fe
Merge branch 'master' into feature/cosmos/v4-encryption
moderakh Jul 8, 2020
d1ce16d
spotbug issues
moderakh Jul 9, 2020
d989e13
checkstyle rules
moderakh Jul 10, 2020
811b035
fixed checkstyle
moderakh Jul 10, 2020
b7578b9
code style rule
moderakh Jul 10, 2020
38226cc
infra update
moderakh Jul 10, 2020
9fad903
Merge branch 'master' into feature/cosmos/v4-encryption
moderakh Jul 10, 2020
903d43d
fixed typo
moderakh Jul 10, 2020
590a810
fixed gate ci
moderakh Jul 10, 2020
902acf8
pom file
moderakh Jul 10, 2020
1efcf5b
dependency fix
moderakh Jul 10, 2020
bde97d0
code review
moderakh Jul 10, 2020
9ea0a6e
removed bcprov-ext-jdk15on
moderakh Jul 10, 2020
86d25ff
code review comment
moderakh Jul 10, 2020
ec628f6
code review comment addressed
moderakh Jul 10, 2020
f8d0a37
fixed version mismatch
moderakh Jul 10, 2020
5e97dd8
code review comments
moderakh Jul 10, 2020
bf0829d
readme
moderakh Jul 10, 2020
de10a87
readme update
moderakh Jul 10, 2020
1904fbd
readme update
moderakh Jul 10, 2020
bc87616
readme update
moderakh Jul 10, 2020
89aa6ee
changelog added
moderakh Jul 10, 2020
1a4b69f
readme update
moderakh Jul 10, 2020
36e325e
one word
moderakh Jul 10, 2020
eea0781
readme verifier skip
moderakh Jul 10, 2020
cd8f025
run only unit tests in unit test phase
moderakh Jul 10, 2020
3feb427
minor test fix
moderakh Jul 14, 2020
6e97928
update
moderakh Jul 15, 2020
5d21d9b
Merge branch 'master' into feature/cosmos/v4-encryption
moderakh Jul 15, 2020
f0175b6
version update
moderakh Jul 15, 2020
17ba37d
fixed a few tests
moderakh Jul 15, 2020
ec27fbf
fixed test
moderakh Jul 15, 2020
d45fd99
fix NPE
moderakh Jul 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@

<!-- Cosmos sdk suppressions -->
<suppress checks="[a-zA-Z0-9]*" files="[/\\]azure-cosmos[/\\]src[/\\]test[/\\]"/>
<suppress checks="[a-zA-Z0-9]*" files="[/\\]azure-cosmos-encryption[/\\]src[/\\]test[/\\]"/>
<suppress checks="[a-zA-Z0-9]*" files="[/\\]cosmos[/\\]examples[/\\]"/>
<suppress checks="[a-zA-Z0-9]*" files="[/\\]cosmos[/\\]implementation[/\\]"/>
<suppress checks="[a-zA-Z0-9]*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,25 @@
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>

<Match>
<Class name="com.azure.cosmos.implementation.encryption.AeadAes256CbcHmac256Algorithm"/>
<Method name="decryptData"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>

<Match>
<Class name="com.azure.cosmos.implementation.encryption.AeadAes256CbcHmac256Algorithm"/>
<Method name="encryptData"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>


<Match>
<Class name="com.azure.cosmos.implementation.encryption.SecurityUtility"/>
<Method name="getSHA256Hash"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>

<!-- Suppress false positive, there is no null in the flagged code -->
<Match>
<Class name="com.azure.cosmos.implementation.TestConfigurations"/>
Expand Down Expand Up @@ -1452,6 +1471,12 @@
<Bug pattern="DLS_DEAD_LOCAL_STORE_OF_NULL"/>
</Match>

<Match>
<Class name="com.azure.cosmos.implementation.encryption.AeadAes256CbcHmac256Algorithm"/>
<Method name="encryptData"/>
<Bug pattern="DLS_DEAD_LOCAL_STORE"/>
</Match>

<!-- Bug: https://github.com/Azure/azure-sdk-for-java/issues/9093 -->
<Match>
<Class name="com.azure.cosmos.implementation.QueryMetrics"/>
Expand Down Expand Up @@ -1647,13 +1672,56 @@
<Bug pattern="EI_EXPOSE_REP"/>
</Match>

<!-- Returning a new copy of the object is not necessary -->
<Match>
<Class name="com.azure.cosmos.implementation.encryption.EncryptionKeyUnwrapResult"/>
<Method name="getDataEncryptionKey"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>

<!-- Returning a new copy of the object is not necessary -->
<Match>
<Class name="com.azure.cosmos.implementation.encryption.EncryptionKeyUnwrapResult"/>
<Method name="getWrappedDataEncryptionKey"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>


<!-- Returning a new copy of the object is not necessary -->
<Match>
<Class name="com.azure.cosmos.implementation.encryption.EncryptionKeyUnwrapResult"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>

<!-- Returning a new copy of the object is not necessary -->
<Match>
<Class name="com.azure.cosmos.implementation.directconnectivity.StoreResponse"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>

<!-- Returning a new copy of the object is not necessary -->
<Match>
<Class name="com.azure.cosmos.implementation.encryption.EncryptionKeyWrapResult"/>
<Method name="getWrappedDataEncryptionKey"/>
<Bug pattern="EI_EXPOSE_REP2,EI_EXPOSE_REP"/>
</Match>

<!-- Returning a new copy of the object is not necessary -->
<Match>
<Class name="com.azure.cosmos.implementation.encryption.EncryptionKeyWrapResult"/>
<Method name="getEncryptionKeyWrapMetadata"/>
<Bug pattern="EI_EXPOSE_REP2,EI_EXPOSE_REP"/>
</Match>

<!-- Returning a new copy of the object is not necessary -->
<Match>
<Class name="com.azure.cosmos.implementation.encryption.EncryptionKeyWrapResult"/>
<Method name="&lt;init&gt;"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>

<!-- Returning a new copy of the object is not necessary -->
<Match>
<Class name="com.azure.cosmos.implementation.RxDocumentServiceRequest"/>
Expand Down Expand Up @@ -1817,6 +1885,12 @@
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
</Match>

<Match>
<Class name="com.azure.cosmos.implementation.encryption.CosmosDataEncryptionKeyProvider"/>
<Method name="initialize"/>
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
</Match>

<!-- https://github.com/Azure/azure-sdk-for-java/issues/9179 -->
<Match>
<Class name="com.azure.cosmos.implementation.SessionContainer"/>
Expand Down
5 changes: 5 additions & 0 deletions eng/jacoco-test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@
<artifactId>azure-cosmos</artifactId>
<version>4.2.0-beta.1</version> <!-- {x-version-update;com.azure:azure-cosmos;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-cosmos-encryption</artifactId>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-cosmos-encryption;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-data-appconfiguration</artifactId>
Expand Down
1 change: 1 addition & 0 deletions eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ com.azure:azure-core-test;1.3.1;1.4.0-beta.1
com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.5;1.0.0-beta.6
com.azure:azure-cosmos;4.1.0;4.2.0-beta.1
com.azure:azure-cosmos-benchmark;4.0.1-beta.1;4.0.1-beta.1
com.azure:azure-cosmos-encryption;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-data-appconfiguration;1.1.3;1.2.0-beta.1
com.azure:azure-data-schemaregistry;1.0.0-beta.2;1.0.0-beta.3
com.azure:azure-data-schemaregistry-avro;1.0.0-beta.2;1.0.0-beta.3
Expand Down
13 changes: 13 additions & 0 deletions sdk/cosmos/azure-cosmos-encryption/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Azure CosmosDB Client Library Encryption Extension

To add client side encryption support you need to add

[//]: # ({x-version-update-start;com.azure:azure-cosmos;current})
```xml
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-cosmos-encryption</artifactId>
<version>1.0.0-beta.1</version>
</dependency>
```
[//]: # ({x-version-update-end})
Loading