Skip to content

Commit 32a3abd

Browse files
authored
Merge branch 'main' into ajewell/async-example
2 parents ec168d3 + 98724d3 commit 32a3abd

File tree

9 files changed

+841
-1
lines changed

9 files changed

+841
-1
lines changed

.github/workflows/ci_test_vector_java.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
java-version: [8, 11, 16, 17]
3232
os: [
3333
# Run on ubuntu image that comes pre-configured with docker
34-
ubuntu-latest,
34+
ubuntu-22.04,
3535
]
3636
runs-on: ${{ matrix.os }}
3737
permissions:

.github/workflows/library_rust_tests.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
required: false
1414
default: false
1515
type: boolean
16+
mpl-head:
17+
description: "Running on MPL HEAD"
18+
required: false
19+
default: false
20+
type: boolean
1621

1722
jobs:
1823
testRust:
@@ -59,6 +64,15 @@ jobs:
5964
with:
6065
dafny-version: nightly-2024-12-03-4954170
6166

67+
- name: Update MPL submodule if using MPL HEAD
68+
if: ${{ inputs.mpl-head == true }}
69+
working-directory: submodules/MaterialProviders
70+
run: |
71+
git checkout main
72+
git pull
73+
git submodule update --init --recursive
74+
git rev-parse HEAD
75+
6276
# Remove this after the formatting in Rust starts working
6377
- name: smithy-dafny Rust hacks
6478
shell: bash

.github/workflows/pull.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,25 @@ jobs:
6464
uses: ./.github/workflows/ci_examples_net.yml
6565
with:
6666
dafny: ${{needs.getVersion.outputs.version}}
67+
pr-ci-all-required:
68+
if: always()
69+
needs:
70+
- getVersion
71+
- getVerifyVersion
72+
- pr-ci-format
73+
- pr-ci-codegen
74+
- pr-ci-verification
75+
- pr-ci-test-vector-verification
76+
- pr-ci-java
77+
- pr-ci-java-test-vectors
78+
- pr-ci-java-examples
79+
- pr-ci-net
80+
- pr-ci-rust
81+
- pr-ci-net-test-vectors
82+
- pr-ci-net-examples
83+
runs-on: ubuntu-22.04
84+
steps:
85+
- name: Verify all required jobs passed
86+
uses: re-actors/alls-green@release/v1
87+
with:
88+
jobs: ${{ toJSON(needs) }}

Examples/runtimes/java/DynamoDbEncryption/src/main/java/software/amazon/cryptography/examples/keyring/SharedCacheAcrossHierarchicalKeyringsExample.java

Lines changed: 429 additions & 0 deletions
Large diffs are not rendered by default.

Examples/runtimes/java/DynamoDbEncryption/src/test/java/software/amazon/cryptography/examples/TestUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ public class TestUtils {
66
public static final String TEST_LOGICAL_KEYSTORE_NAME = "KeyStoreDdbTable";
77
public static final String TEST_KEYSTORE_KMS_KEY_ID =
88
"arn:aws:kms:us-west-2:370957321024:key/9d989aa2-2f9c-438c-a745-cc57d3ad0126";
9+
public static final String TEST_PARTITION_ID =
10+
"91c1b6a2-6fc3-4539-ad5e-938d597ed730";
911

1012
public static final String TEST_AWS_ACCOUNT_ID = "658956600833";
1113
public static final String TEST_AWS_REGION = "us-west-2";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package software.amazon.cryptography.examples.keyring;
2+
3+
import org.testng.annotations.Test;
4+
import software.amazon.cryptography.examples.CreateKeyStoreKeyExample;
5+
import software.amazon.cryptography.examples.TestUtils;
6+
7+
public class TestSharedCacheAcrossHierarchicalKeyringsExample {
8+
9+
@Test
10+
public void TestSharedCacheAcrossHierarchicalKeyringsExample()
11+
throws InterruptedException {
12+
// Create new branch key for test
13+
String keyId = CreateKeyStoreKeyExample.KeyStoreCreateKey(
14+
TestUtils.TEST_KEYSTORE_NAME,
15+
TestUtils.TEST_LOGICAL_KEYSTORE_NAME,
16+
TestUtils.TEST_KEYSTORE_KMS_KEY_ID
17+
);
18+
19+
// Key creation is eventually consistent, so wait 5 seconds to decrease the likelihood
20+
// our test fails due to eventual consistency issues.
21+
Thread.sleep(5000);
22+
23+
SharedCacheAcrossHierarchicalKeyringsExample.SharedCacheAcrossHierarchicalKeyringsGetItemPutItem(
24+
TestUtils.TEST_DDB_TABLE_NAME,
25+
keyId,
26+
TestUtils.TEST_KEYSTORE_NAME,
27+
TestUtils.TEST_LOGICAL_KEYSTORE_NAME,
28+
TestUtils.TEST_PARTITION_ID,
29+
TestUtils.TEST_KEYSTORE_KMS_KEY_ID
30+
);
31+
}
32+
}

Examples/runtimes/net/src/Examples.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ static async Task Main()
3333
Thread.Sleep(5000);
3434

3535
await HierarchicalKeyringExample.HierarchicalKeyringGetItemPutItem(keyId, keyId2);
36+
await SharedCacheAcrossHierarchicalKeyringsExample.SharedCacheAcrossHierarchicalKeyringsGetItemPutItem(keyId);
3637

3738
await BasicSearchableEncryptionExample.PutItemQueryItemWithBeacon(keyId);
3839
await CompoundBeaconSearchableEncryptionExample.PutItemQueryItemWithCompoundBeacon(keyId);

Examples/runtimes/net/src/TestUtils.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ public class TestUtils
77
public static readonly string TEST_KEYSTORE_NAME = "KeyStoreDdbTable";
88
public static readonly string TEST_LOGICAL_KEYSTORE_NAME = "KeyStoreDdbTable";
99

10+
public static readonly string TEST_PARTITION_ID = "91c1b6a2-6fc3-4539-ad5e-938d597ed730";
11+
1012
public static readonly string TEST_KEYSTORE_KMS_KEY_ID =
1113
"arn:aws:kms:us-west-2:370957321024:key/9d989aa2-2f9c-438c-a745-cc57d3ad0126";
1214

0 commit comments

Comments
 (0)