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

chore(dafny): Check for unique transformed keys on init mutation #1398

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
11687e8
chore(Java): version by properties file only
texastony Nov 14, 2024
e4b5a58
feat: Adding a storage option to the KeyStore (#594)
seebees Sep 18, 2024
d1c3075
chore(KSA-Model): more Mutation Operation changes (#955)
texastony Sep 18, 2024
c4af12f
fix(Mutations): KMS Exception improvements
texastony Nov 12, 2024
f8e91e7
feat(KSA): Describe Mutation
texastony Nov 13, 2024
8795bf5
feat(KSA): KMS Decrypt/Encrypt Strategy (#1020)
texastony Nov 25, 2024
0f0ede0
feat(KSA): System Key (#1021) (#1055)
texastony Nov 25, 2024
c44f328
chore: percolate changes from HEAD to mutations branch
texastony Nov 26, 2024
5896cf8
fix(KS-Smithy): explicit error for tampered Branch Key (#1058)
texastony Nov 26, 2024
621116e
chore: fix decrypt encrypt strategy (#1059)
josecorella Nov 26, 2024
34683eb
fix(KSA): Describe Mutation bugs (#1062)
texastony Nov 27, 2024
9d66289
chore: error refinement improvements decrypt/encrypt strategy (#1061)
josecorella Nov 27, 2024
63fa534
fix(KSA-Dafny): break up Mutations, other fixes, more tests (#1069)
texastony Dec 2, 2024
5b2f851
fix: use correct client depending on operation (#1084)
josecorella Dec 4, 2024
6714c65
test(KSA-Java): assert deletion of Index/Commitment at end of Mutatio…
texastony Dec 4, 2024
42149ec
docs: update documentation for Key Store Admin Errors (#1086)
josecorella Dec 5, 2024
b26fbb3
test(KSA): Utilize Limit KMS Clients in Mutation D/E test (#1089)
texastony Dec 5, 2024
a914309
feat(KSA): DoNotVersion for Initialize Mutation (#1082)
texastony Dec 6, 2024
15f1cf0
feat(KSA): require System Key + doc polish + tests (#1092)
texastony Dec 9, 2024
3f9f7d7
fix(MPL): remove un-used imports (#1103)
texastony Dec 10, 2024
180a7d8
chore(Rust): fix Rust import of the KSA (#1110)
texastony Dec 11, 2024
528d8f0
docs(KSA): clarify mutation behvior (#1112)
texastony Dec 12, 2024
90a390e
chore(Smithy): remove Smithy trait un-supported by Smithy-Dafny (#1134)
texastony Dec 17, 2024
2fc52ac
test: add concurrency testing for storage operations (#1132)
josecorella Dec 23, 2024
af0078d
fix(KeyStoreAdmin): Go support (#1242)
texastony Jan 22, 2025
eb56365
fix(GHW): Library Example (#1269)
texastony Jan 31, 2025
0c5cfa7
fix(KeyStoreAdmin): Exceptions for Mutations when KMS Key is Disabled…
texastony Feb 16, 2025
0539f37
chore: fix CI for HV-2 (#1353)
imabhichow Mar 25, 2025
402b6c7
chore: move ProvideCryptoClient to HierarchicalVersionUtils in KeySto…
rishav-karanjit Mar 25, 2025
8697d31
ci(Go, Rust): disable for current HV-2 work (#1360)
texastony Mar 25, 2025
23bf9cd
feat(BKS & BKSA): Smithy Model for HV-2 (#1350)
texastony Mar 25, 2025
7ed5089
chore(BKS): pack & unpack plainTextTuple (#1362)
texastony Mar 26, 2025
5b0064f
chore(BKS): Add Helper functions to select KMS Encryption Context for…
imabhichow Mar 26, 2025
4ee8a6f
chore: refactor hv1 functions and methods (#1367)
rishav-karanjit Mar 26, 2025
8b68bd1
chore(bks): Add createMdDigest in hvutils (#1361)
rishav-karanjit Mar 27, 2025
af21fb0
chore(BKS): add decrypt hook For Hv2 (#1368)
rishav-karanjit Mar 28, 2025
7c6ec94
chore(dafny): Add todo for test (#1377)
rishav-karanjit Mar 31, 2025
28375ab
chore(dafny): BranchKeyContext for HV-2 (#1381)
imabhichow Mar 31, 2025
048d7bb
chore(dafny): KS Refactor KeyStoreException (#1383)
imabhichow Mar 31, 2025
1245c52
chore(dafny): BKS Encrypt Key for HV-1 & HV-2 (#1372)
imabhichow Apr 1, 2025
64f9449
chore(dafny): wire get keys with the decrypt hook (#1376)
rishav-karanjit Apr 1, 2025
12b8e40
chore(dafny): BKS Refactor GetKeys (#1389)
imabhichow Apr 2, 2025
56ac53c
chore(dafny): add test for get keys (#1388)
rishav-karanjit Apr 3, 2025
dbc3aa5
chore(dafny): add VerifyGetKeysFromStorage to test (#1392)
rishav-karanjit Apr 3, 2025
f5125bc
chore(dafny): Add helper function to VerifyGetKeys (#1396)
rishav-karanjit Apr 4, 2025
cac8de6
HasUniqueTransformedKeys?
rishav-karanjit Apr 4, 2025
a15826c
feat(dafny): KSA Create Key Operation for HV-2 (#1374)
imabhichow Apr 4, 2025
d14adbf
test(dafny): no touching the static branch-key-id in the dev branch (…
texastony Apr 4, 2025
71f482d
test(dafny): restore static test branch key id (#1403)
texastony Apr 4, 2025
0e3011c
chore(dafny): refactor HV1 MRK test to use helper methods (#1399)
rishav-karanjit Apr 5, 2025
c5afe43
Need UnexpectedStateException
rishav-karanjit Apr 7, 2025
d35b7f6
remove only
rishav-karanjit Apr 7, 2025
31f1178
Merge branch 'hv-2/hv-2' into rishav/hv-2/M2/NeedUniqueTransformedKeys
rishav-karanjit Apr 7, 2025
2b0d819
TerminalHierarchyVersion.value.v2
rishav-karanjit Apr 7, 2025
72fb1f9
add TestHierarchyVersion
rishav-karanjit Apr 7, 2025
d80fd1b
auto commit
rishav-karanjit Apr 7, 2025
bfa72d1
TestHierarchyVersion
rishav-karanjit Apr 7, 2025
42a5035
auto commit
rishav-karanjit Apr 7, 2025
2a6443c
TODO-HV-2-M2
rishav-karanjit Apr 8, 2025
ab4ed17
formatting
rishav-karanjit Apr 8, 2025
dd99597
auto commit
rishav-karanjit Apr 8, 2025
db3864f
auto commit
rishav-karanjit Apr 8, 2025
17cc05c
Revert "auto commit"
rishav-karanjit Apr 8, 2025
3edd126
chore(dafny): KSA Add test coverage for creating a hv-2 branch key. (…
imabhichow Apr 8, 2025
21f5ee5
PR suggestion
rishav-karanjit Apr 8, 2025
a35c7c6
Add commented code
rishav-karanjit Apr 8, 2025
d15087c
Commentted code update
rishav-karanjit Apr 8, 2025
9a622f0
TODO-HV-2-M2
rishav-karanjit Apr 8, 2025
a144674
happy case hv2
rishav-karanjit Apr 8, 2025
08899dc
support HV2
rishav-karanjit Apr 8, 2025
20eb414
Merge branch 'hv-2/hv-2' into rishav/hv-2/M2/NeedUniqueTransformedKeys
rishav-karanjit Apr 8, 2025
64ed98d
comments
rishav-karanjit Apr 8, 2025
0a17065
auto commit
rishav-karanjit Apr 8, 2025
4abd869
auto commit
rishav-karanjit Apr 8, 2025
cd25a59
auto commit
rishav-karanjit Apr 8, 2025
cf85b13
auto commit
rishav-karanjit Apr 8, 2025
9f9ad65
auto commit
rishav-karanjit Apr 8, 2025
60642e1
auto commit
rishav-karanjit Apr 8, 2025
a8ad3e5
auto commit
rishav-karanjit Apr 8, 2025
5c66a99
auto commit
rishav-karanjit Apr 8, 2025
7843450
auto commit
rishav-karanjit Apr 8, 2025
1580125
auto commit
rishav-karanjit Apr 8, 2025
42185fd
auto commit
rishav-karanjit Apr 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 7 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
_Issue #, if available:_
### Issue #, if available:

_Description of changes:_
### Description of changes:

_Squash/merge commit message, if applicable:_
### Squash/merge commit message, if applicable:

```
<message>
```

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ runs:
with:
arguments: :smithy-python-codegen:pTML
build-root-directory: smithy-dafny/codegen/smithy-dafny-codegen-modules/smithy-python/codegen

- name: Setup Python, black, and docformatter for code formatting
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade black
python -m pip install --upgrade docformatter
9 changes: 9 additions & 0 deletions .github/actions/polymorph_codegen/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ outputs:
runs:
using: "composite"
steps:
- name: Setup Java 17 for codegen
uses: actions/setup-java@v3
with:
distribution: "corretto"
java-version: "17"

- name: Install Smithy-Dafny codegen dependencies
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

# Replace the project.properties file so that we pick up the right runtimes etc.,
# in cases where inputs.dafny is different from the current value in that file.
- name: Update top-level project.properties file
Expand Down
30 changes: 30 additions & 0 deletions .github/actions/setup_dafny/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
#
# This local action consolidate all uses of dafny-lang/setup-dafny-action
# as well as works around any dependencies or issues with setting up Dafny.
# It can also be re-used by downstream projects such as the DB-ESDK and ESDK.
#
name: "Setup Dafny"
description: "This uses the setup Dafny action."
inputs:
dafny-version:
description: "The Dafny version to setup"
required: true
type: string
runs:
using: "composite"
steps:
# The dotnet tool requires >= 9.0.202 to work on MacOS
# See: https://github.com/dotnet/sdk/issues/46857#issuecomment-2734338347
# Ideally this action would only install this on MacOS,
# but I do not want to keep track of the various values
# See: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#detecting-the-operating-system
- name: Setup .NET Core SDK '9.0.x'
uses: actions/setup-dotnet@v3
with:
dotnet-version: "9.0.x"

- name: Setup Dafny with setup-dafny action
uses: dafny-lang/[email protected]
with:
dafny-version: ${{ inputs.dafny-version }}
19 changes: 5 additions & 14 deletions .github/workflows/library_codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
# and to translate version strings such as "nightly-latest"
# to an actual DAFNY_VERSION.
- name: Setup Dafny
uses: dafny-lang/[email protected]
uses: ./.github/actions/setup_dafny
with:
dafny-version: ${{ inputs.dafny }}

Expand All @@ -62,25 +62,16 @@ jobs:
with:
dotnet-version: ${{ matrix.dotnet-version }}

# even though we just installed dotnet 6, maybe dotnet 8 is out there somewhere
- name: Create temporary global.json
run: echo '{"sdk":{"rollForward":"latestFeature","version":"6.0.0"}}' > ./global.json

- name: Setup Java 17 for codegen
uses: actions/setup-java@v3
with:
distribution: "corretto"
java-version: "17"

- name: Install Smithy-Dafny codegen dependencies
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

- name: Setup Python, black, and docformatter for code formatting
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: |
python -m pip install --upgrade pip
python -m pip install --upgrade black
python -m pip install --upgrade docformatter

- name: Install Go
uses: actions/setup-go@v5
with:
Expand Down
116 changes: 116 additions & 0 deletions .github/workflows/library_concurrency_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# This workflow performs Concurrency tests of the MPL in Java.
name: Library Concurrency Tests

on:
workflow_call:
inputs:
dafny:
description: "The Dafny version to run"
required: true
type: string
regenerate-code:
description: "Regenerate code using smithy-dafny"
required: false
default: false
type: boolean

jobs:
generateEncryptVectors:
strategy:
matrix:
library: [AwsCryptographicMaterialProviders]
os: [
# https://taskei.amazon.dev/tasks/CrypTool-5283
# windows-latest,
ubuntu-latest,
macos-13,
]
language: [
java,
# net,
# python,
# rust
]
# https://taskei.amazon.dev/tasks/CrypTool-5284
java-versions: [8, 17]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
steps:
- name: Support longpaths on Git checkout
run: |
git config --global core.longpaths true

# Test Vectors need to call KMS
- name: Configure AWS Credentials for Tests
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-MPL-Dafny-Role-us-west-2
role-session-name: ConcurrencyTests

- uses: actions/checkout@v3
# Not all submodules are needed.
# We manually pull the submodule we DO need.
- run: git submodule update --init libraries
- run: git submodule update --init --recursive smithy-dafny

# Setup Java in Rust is needed for running polymorph
- name: Setup Java 17
if: matrix.language == 'java' || matrix.language == 'rust'
uses: actions/setup-java@v3
with:
distribution: "corretto"
java-version: 17

- name: Setup .NET Core SDK '6.0.x'
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"

- name: Setup Dafny
uses: dafny-lang/[email protected]
with:
dafny-version: ${{ inputs.dafny }}

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ inputs.dafny }}
library: ${{ matrix.library }}
diff-generated-code: false

# Build implementation for each runtime
- name: Build ${{ matrix.library }} implementation in Java
shell: bash
working-directory: ./${{ matrix.library }}
run: |
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make build_java CORES=$CORES

- name: Setup gradle
if: matrix.language == 'java'
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.2

- name: Setup Java ${{matrix.java-versions}}
uses: actions/setup-java@v3
with:
distribution: "corretto"
java-version: ${{matrix.java-versions}}

- name: Compile Java
uses: gradle/gradle-build-action@v3
with:
arguments: build
build-root-directory: ./${{ matrix.library }}/runtimes/java

- name: Test Java
uses: gradle/gradle-build-action@v3
with:
arguments: testConcurrentExamples
build-root-directory: ./${{ matrix.library }}/runtimes/java
11 changes: 2 additions & 9 deletions .github/workflows/library_dafny_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,13 @@ jobs:
# The specification submodule is private so we don't have access, but we don't need
# it to verify the Dafny code. Instead we manually pull the submodules we DO need.
- run: git submodule update --init libraries
- run: git submodule update --init smithy-dafny
- run: git submodule update --init --recursive smithy-dafny

- name: Setup Dafny
uses: dafny-lang/[email protected]
uses: ./.github/actions/setup_dafny
with:
dafny-version: ${{ inputs.dafny }}

# dafny-reportgenerator requires next6
# but only 7.0 is installed on macos-13-large
- name: Setup .NET Core SDK '6.0.x'
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/library_examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# "Copyright Amazon.com Inc. or its affiliates. All Rights Reserved."
# "SPDX-License-Identifier: CC-BY-SA-4.0"
# This workflow runs any examples.
name: Library Examples
on:
workflow_call:
inputs:
dafny:
description: "The Dafny version to run"
required: true
type: string

jobs:
java:
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read
defaults:
run:
shell: bash
steps:
- name: Support longpaths on Git checkout
run: |
git config --global core.longpaths true
- name: Configure AWS Credentials for Tests
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-MPL-Dafny-Role-us-west-2
role-session-name: JavaExampleTests

- uses: actions/checkout@v4
- run: git submodule update --init libraries
- run: git submodule update --init smithy-dafny

- name: Setup Dafny
uses: dafny-lang/[email protected]
with:
dafny-version: ${{ inputs.dafny }}

- name: Setup Java 8
uses: actions/setup-java@v3
with:
distribution: "corretto"
java-version: 8

- name: Build AwsCryptographicMaterialProviders Java implementation
working-directory: ./AwsCryptographicMaterialProviders
run: |
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make build_java CORES=$CORES

- name: Test AwsCryptographicMaterialProviders Java Examples
working-directory: ./AwsCryptographicMaterialProviders
run: |
make test_example_java
8 changes: 6 additions & 2 deletions .github/workflows/library_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
# The specification submodule is private so we don't have access, but we don't need
# it to verify the Dafny code. Instead we manually pull the submodule we DO need.
- run: git submodule update --init libraries
- run: git submodule update --init smithy-dafny
- run: git submodule update --init --recursive smithy-dafny

- name: Setup Dafny
uses: dafny-lang/[email protected]
uses: ./.github/actions/setup_dafny
with:
dafny-version: ${{ inputs.dafny }}

Expand All @@ -61,6 +61,10 @@ jobs:
library: ${{ matrix.library }}
diff-generated-code: false

# make sure we always format for dotnet 6
- name: Create temporary global.json
run: echo '{"sdk":{"rollForward":"latestFeature","version":"6.0.0"}}' > ./global.json

- name: Check format of ${{ matrix.library }} Dafny code
working-directory: ./${{ matrix.library }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/library_go_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ jobs:
# The specification submodule is private so we don't have access, but we don't need
# it to verify the Dafny code. Instead we manually pull the submodules we DO need.
- run: git submodule update --init libraries
- run: git submodule update --init smithy-dafny
- run: git submodule update --init --recursive smithy-dafny

- name: Setup Dafny
uses: dafny-lang/[email protected]
uses: ./.github/actions/setup_dafny
with:
dafny-version: ${{ inputs.dafny }}

Expand Down
Loading
Loading