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

feat: Python MPL #360

Closed
wants to merge 125 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
d8f0537
Primitives: Smithy-generated code (#188)
lucasmcdonald3 Feb 5, 2024
465b4ae
Merge branch 'main' into python-reviewed
lucasmcdonald3 Feb 5, 2024
56adb10
merge submodules
lucasmcdonald3 Feb 5, 2024
e523dfd
Merge branch 'main' into python-reviewed
lucasmcdonald3 Feb 5, 2024
14d1d2a
KMS: Smithy-generated code (#196)
lucasmcdonald3 Feb 27, 2024
b895f9e
DDB: Smithy-generated code (#197)
lucasmcdonald3 Feb 27, 2024
ab0aad5
MPL-Core: Smithy-generated code (#225)
lucasmcdonald3 Apr 2, 2024
72ca31e
Re-run Smithy-Dafny (#261)
lucasmcdonald3 Apr 10, 2024
efda267
Python Primitives: Dafny externs (#263)
lucasmcdonald3 May 30, 2024
de87c11
chore(cfn): allow Staging Repo access to testing resources (#203)
texastony Feb 12, 2024
0c2e8f4
chore(deps): bump GitHub Action Dependencies (#204)
texastony Feb 12, 2024
a40022d
chore(GHA): add semantic release manual gha (#206)
josecorella Feb 13, 2024
f876ebc
chore: fix gha semver (#208)
josecorella Feb 13, 2024
da3caf3
chore: gh_token vs github_token (#209)
josecorella Feb 13, 2024
6ca5690
chore: fix permissions gha (#210)
josecorella Feb 14, 2024
4ee13ec
chore: abb back env (#211)
josecorella Feb 14, 2024
8f5ca01
feat: remove quantifier-syntax (#218)
ajewellamz Feb 23, 2024
e201e54
chore: gha to check release file diff (#220)
josecorella Feb 23, 2024
cbb96a6
chore(release-test): test kickoff java releases via GHA (#205)
josecorella Feb 23, 2024
64dc602
chore: fix workflow name (#222)
josecorella Feb 23, 2024
1a4be9d
chore: Forwards compatibility with Dafny > 4.2 (including pending 4.5…
robin-aws Mar 1, 2024
490a12e
chore(deps): bump software.amazon.awssdk:bom (#231)
dependabot[bot] Mar 4, 2024
9989ca6
chore: Use shared SmithyDafnyMakefile.mk (#230)
robin-aws Mar 5, 2024
b586721
Always regenerate code in the nightly build (#229)
robin-aws Mar 5, 2024
5d782af
chore: add stale issue/pr action (#235)
josecorella Mar 6, 2024
7de48cb
chore(CFN): add another KMS Key ARN for Key Store Testing (#236)
texastony Mar 8, 2024
932c663
fix(dafny): Local Service Constructors MUST return concrete
texastony Mar 29, 2024
61b33fe
chore: add example of tail recursion (#262)
ajewellamz Apr 2, 2024
e5bd1f5
Pick up newer copy of smithy-dafny, revert service constructor result…
robin-aws Apr 9, 2024
31d3622
feat: repolymorph to get dotnet constraint checking (#281)
ajewellamz Apr 15, 2024
2c1d436
refactor: Remove redundant ghost var (#283)
rishav-karanjit Apr 16, 2024
498a395
Merge from python-reviewed into merged main
lucasmcdonald3 Jun 4, 2024
fc1417e
Update error msg (#275)
rishav-karanjit Apr 22, 2024
de29271
chore(deps): bump org.bouncycastle:bcprov-jdk18on (#290)
dependabot[bot] Apr 23, 2024
2725692
fix(KeyStore): JavaDocs for KMS Configuration (#293)
texastony Apr 23, 2024
1319758
chore(release): 1.3.0 (#294)
lucasmcdonald3 Apr 24, 2024
40a5b82
chore: add test for VersionKey with an MRK (#296)
ajewellamz Apr 26, 2024
f41ad89
chore: bump to SNAPSHOT version to pick up and test latest (#300)
josecorella Apr 26, 2024
955edbb
chore(Dafny): Fix verification and formatting errors (#288)
atomb Apr 29, 2024
017ba62
chore: the test vectors should not define a Main (#303)
ajewellamz Apr 29, 2024
e62f01b
chore(CI): add smithy diff checker gha (#307)
josecorella May 2, 2024
4466338
ci: Cut Dafny issues on nightly failures (#306)
robin-aws May 13, 2024
a8f96a8
chore(Dafny): Move InternalResult into StandardLibrary(Internal) (#325)
robin-aws May 17, 2024
ed1b95f
chore(.NET): bump deps BouncyCastle & AWSSDK.Core (#329)
texastony May 20, 2024
d75d8fc
feat(Keystore): Introduce additional KMSConfiguration options (#316)
texastony May 20, 2024
15151bc
chore(release): 1.4.0 (#335)
texastony May 20, 2024
652250e
chore(Java): enable SNAPSHOT testing (#336)
texastony May 21, 2024
38aeb3e
chore: Try to update existing issues (#340)
fabiomadge May 23, 2024
08e0752
chore: add Java TestVectors to Semantic Release script (#344)
texastony May 24, 2024
0327d51
Python: DDB extern (#404)
lucasmcdonald3 Jun 13, 2024
b28b534
Python: KMS Extern (#373)
lucasmcdonald3 Jun 13, 2024
401872f
chore(release): add cfn and codebuild files for release (#528)
RitvikKapila Jul 23, 2024
3ac8ef0
Python: StandardLibrary Externs (#418)
lucasmcdonald3 Jul 24, 2024
749f590
Python: Testvectors Externs (#537)
lucasmcdonald3 Jul 29, 2024
1b056d6
Python MPL-Core: Dafny extern (#266)
lucasmcdonald3 Jul 29, 2024
fb6fb8e
Python: Dafny-generated code (#548)
lucasmcdonald3 Jul 29, 2024
2888219
merge'
lucasmcdonald3 Jul 29, 2024
a50aac7
merge from main
lucasmcdonald3 Jul 30, 2024
b916e9b
Merge branch 'main' into python-reviewed
lucasmcdonald3 Jul 30, 2024
121b07f
Python: Dafny tests (#552)
lucasmcdonald3 Jul 30, 2024
1a60ca4
Python: TestVectors Smithy-generated code (#536)
lucasmcdonald3 Aug 2, 2024
59c65e9
Merge branch 'main' into python-reviewed
lucasmcdonald3 Aug 6, 2024
fc062e1
Python: Project setup (#567)
lucasmcdonald3 Aug 8, 2024
0552aa8
Python: Re-polymorph (#568)
lucasmcdonald3 Aug 12, 2024
7865b40
Python: ECDH (#579)
lucasmcdonald3 Aug 19, 2024
324db47
Merge branch 'main' into python-reviewed
lucasmcdonald3 Aug 28, 2024
6bb886d
Python: Remove committed Dafny, Makefile updates, update package name…
lucasmcdonald3 Sep 5, 2024
2aa4c41
m
lucasmcdonald3 Sep 9, 2024
6c9cae5
Merge branch 'main' into python-reviewed
lucasmcdonald3 Sep 9, 2024
0c85ee0
Python: rm committed Dafny tests (#681)
lucasmcdonald3 Sep 9, 2024
55a80f4
Python: Update externs (#674)
lucasmcdonald3 Sep 9, 2024
caa03d7
Python: Merge, resolve conflicts (#702)
lucasmcdonald3 Sep 10, 2024
6b9da17
Python: Merge, resolve conflicts
lucasmcdonald3 Sep 10, 2024
9db31f3
Python: MPL-Core Release and Docs (#689)
lucasmcdonald3 Sep 17, 2024
7c0c590
Python: Re-Polymorph (#671)
lucasmcdonald3 Sep 17, 2024
1270e21
Python: Format docstrings (#734)
lucasmcdonald3 Sep 18, 2024
77bc3b6
Python: MPL subproject release workflows (#688)
lucasmcdonald3 Sep 19, 2024
00e130d
Python: Regenerate and commit dtr files on release (#735)
lucasmcdonald3 Sep 19, 2024
7263835
merge
lucasmcdonald3 Sep 19, 2024
4b4935d
Python: Misc. files (#738)
lucasmcdonald3 Sep 19, 2024
4385812
Python: Commit Smithy-Python lib (#743)
lucasmcdonald3 Sep 20, 2024
afd7423
Python: More misc. files (#745)
lucasmcdonald3 Sep 20, 2024
27353b9
Python: Add missing file (#746)
lucasmcdonald3 Sep 20, 2024
4c65066
Python: GHA workflows (#739)
lucasmcdonald3 Sep 24, 2024
a5a65c7
chore: add mpl version to project.properties (#501)
josecorella Jul 10, 2024
197361f
chore: fix typos in test-prod.yml (#507)
rishav-karanjit Jul 11, 2024
6b0f149
chore(verfication): remove {:only} (#517)
josecorella Jul 16, 2024
adf156a
chore: remove redundant assignment (#526)
ajewellamz Jul 22, 2024
fc9b76f
chore: update Dafny code to appease Rust code generation (#527)
ajewellamz Jul 23, 2024
04b2f8f
chore: interop tests via test vectors (#181) (#276)
texastony Jul 24, 2024
c117db7
chore(TestVectors): TestVector execution directory extern (#546)
lucasmcdonald3 Jul 26, 2024
8cce3f5
chore(release): .releaserc.cjs updates (#551)
lucasmcdonald3 Jul 29, 2024
fc5a297
chore(CI): Add new comment to smithy diff checker gha (#544)
rishav-karanjit Jul 30, 2024
705dfc0
test: More ECDH known value tests (#566)
lucasmcdonald3 Aug 5, 2024
caac399
fix: add ECDH error message for Rust (#574)
ajewellamz Aug 6, 2024
cab63c1
chore: Change exception raised for SM2 (#576)
lucasmcdonald3 Aug 7, 2024
fd7e416
chore: add intermediate test for compression test (#580)
ajewellamz Aug 8, 2024
1ff3260
fix: GetCurrentTimeStamp returns ISO8601 format (#575)
seebees Aug 9, 2024
7d44c71
chore: add documentation to externs (#590)
ajewellamz Aug 13, 2024
88eaef9
fix: Remove 4.4 DDB and KMS patches, abstract test to work on later D…
robin-aws Aug 20, 2024
55399db
fix: Remove uses of `:|` (#618)
atomb Aug 22, 2024
645139f
chore: remove case-based if statement (#630)
atomb Aug 23, 2024
6a8c27f
chore: Remove a few more case-based if statements (#639)
atomb Aug 26, 2024
9334984
fix: maintain order in test vectors for languages with parallel tests…
ajewellamz Aug 27, 2024
3812266
chore: clean up poly generated code (#648)
josecorella Aug 28, 2024
a86a193
chore: improve message for failed test vector test (#649)
ajewellamz Aug 29, 2024
32d5d57
fix: test vector help text (#657)
ajewellamz Sep 1, 2024
83e39d0
chore(ci): make all pull.yml jobs required in branch protection autom…
josecorella Sep 4, 2024
3e9cb42
test(StandardLibrary): Update Unicode tests to work around Dafny tran…
lucasmcdonald3 Sep 5, 2024
414270f
chore(smithy-dafny): changes to support Smithy-Dafny mainline (#643)
lucasmcdonald3 Sep 6, 2024
01ad51f
fix(DDB-Model): DDB Supports 100 actions per Transaction (#692)
texastony Sep 10, 2024
c8ca617
feat: bump dafny verification and code gen to dafny 4.8.0 (#520)
josecorella Sep 10, 2024
0cbf35e
chore(release): 1.6.0 (#703)
josecorella Sep 11, 2024
b98fb45
chore(CI): enable local testing (#713)
josecorella Sep 13, 2024
6c1af28
chore(CI): make smithy diff checker smarter (#736)
josecorella Sep 19, 2024
3a8ed3b
chore: test smithy diff (#740)
josecorella Sep 19, 2024
cee1718
feat(HierarchyKeyring; CMC): Shared cache across Hierarchy Keyrings (…
RitvikKapila Sep 23, 2024
2928508
chore(release): 1.7.0 (#761)
RitvikKapila Sep 24, 2024
7d3b609
chore(CI): Enable local testing (#766)
lucasmcdonald3 Sep 25, 2024
3129085
merge
lucasmcdonald3 Oct 1, 2024
6fcbd89
merge
lucasmcdonald3 Oct 1, 2024
4c84a4a
Python: Commit current CFN state (#781)
lucasmcdonald3 Oct 1, 2024
c17a10f
Python: Re-polymorph (shared cache) (#797)
lucasmcdonald3 Oct 2, 2024
7e0c431
merge
lucasmcdonald3 Oct 2, 2024
c571f51
chore(Python): Merge in remaining changes (#550)
lucasmcdonald3 Oct 2, 2024
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
6 changes: 6 additions & 0 deletions .github/actions/polymorph_codegen/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ runs:
run: |
make polymorph_dotnet

- name: Regenerate Python code using smithy-dafny
working-directory: ./${{ inputs.library }}
shell: bash
run: |
make polymorph_python

- name: Check regenerated code against commited code
# Composite action inputs seem to not actually support booleans properly for some reason
if: inputs.diff-generated-code == 'true'
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/daily_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ jobs:
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
daily-ci-python:
needs: getVersion
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_python_tests.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
daily-interop-test:
needs: getVersion
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/library_codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
# Note dotnet is only used for formatting generated code
# in this workflow
dotnet-version: ["6.0.x"]
# Note python is only used for formatting generated code
# in this workflow.
# The workflow installs black and docformatter and runs them on generated code.
python-version: [3.11]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
defaults:
Expand Down Expand Up @@ -66,6 +70,16 @@ jobs:
- 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

- uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
Expand Down
44 changes: 41 additions & 3 deletions .github/workflows/library_interop_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
ubuntu-latest,
macos-12,
]
language: [java, net]
language: [java, net, python]
# https://taskei.amazon.dev/tasks/CrypTool-5284
dotnet-version: ["6.0.x"]
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -57,6 +57,16 @@ jobs:
distribution: "corretto"
java-version: 17

- name: Setup Python for running tests
uses: actions/setup-python@v4
with:
python-version: 3.11
architecture: x64
- run: |
python -m pip install --upgrade pip
pip install --upgrade tox
pip install poetry

- name: Setup Dafny
uses: dafny-lang/[email protected]
with:
Expand Down Expand Up @@ -89,6 +99,15 @@ jobs:
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_net

- name: Build ${{ matrix.library }} implementation in Python
if: matrix.language == 'python'
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 transpile_python

- name: Setup gradle
if: matrix.language == 'java'
uses: gradle/gradle-build-action@v2
Expand Down Expand Up @@ -128,8 +147,8 @@ jobs:
ubuntu-latest,
macos-12,
]
encrypting_language: [java, net]
decrypting_language: [java, net]
encrypting_language: [java, net, python]
decrypting_language: [java, net, python]
dotnet-version: ["6.0.x"]
runs-on: ${{ matrix.os }}
permissions:
Expand Down Expand Up @@ -167,6 +186,16 @@ jobs:
distribution: "corretto"
java-version: 17

- name: Setup Python for running tests
uses: actions/setup-python@v4
with:
python-version: 3.11
architecture: x64
- run: |
python -m pip install --upgrade pip
pip install --upgrade tox
pip install poetry

- name: Setup Dafny
uses: dafny-lang/[email protected]
with:
Expand Down Expand Up @@ -199,6 +228,15 @@ jobs:
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_net

- name: Build ${{ matrix.library }} implementation in Python
if: matrix.decrypting_language == 'python'
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 transpile_python

- name: Download Encrypt Manifest Artifact
uses: actions/download-artifact@v4
with:
Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/library_python_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# This workflow performs tests in Python.
name: Library Python 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:
testPython:
strategy:
fail-fast: false
matrix:
library:
[
StandardLibrary,
AwsCryptographyPrimitives,
ComAmazonawsKms,
ComAmazonawsDynamodb,
AwsCryptographicMaterialProviders,
TestVectorsAwsCryptographicMaterialProviders,
]
python-version: ["3.11"]
os: [
# TODO fix Dafny-generated tests on Windows;
# the sys.path workaround for generated Dafny doesn't work on Windows.
# Note: only tests use the sys.path workaround, not source code.
# Windows source code is tested downstream (ex. ESDK-Python CI).
# windows-latest,
ubuntu-latest,
macos-12,
]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
permissions:
id-token: write
contents: read
steps:
- name: Support longpaths on Git checkout
run: |
git config --global core.longpaths true

- name: Configure AWS Credentials
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: PythonTests

- uses: actions/checkout@v4
# 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

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

- name: Setup Python ${{ matrix.python-version }} for running tests
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: |
python -m pip install --upgrade pip
pip install --upgrade tox
pip install poetry

- name: Build ${{ matrix.library }} implementation
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 transpile_python CORES=$CORES

- name: Test ${{ matrix.library }}
working-directory: ./${{ matrix.library }}
shell: bash
run: |
make test_python
5 changes: 5 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
with:
dafny: ${{ inputs.dafny }}
regenerate-code: ${{ inputs.regenerate-code }}
manual-ci-python:
uses: ./.github/workflows/library_python_tests.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
regenerate-code: ${{ inputs.regenerate-code }}
manual-interop-test:
uses: ./.github/workflows/library_interop_tests.yml
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/nightly_dafny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
with:
dafny: "nightly-latest"
regenerate-code: true
dafny-nightly-python:
needs: getVersion
uses: ./.github/workflows/library_python_tests.yml
with:
dafny: ${{needs.getVersion.outputs.version}}

cut-issue-on-failure:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
pr-ci-python:
needs: getVersion
uses: ./.github/workflows/library_python_tests.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
pr-interop-test:
needs: getVersion
uses: ./.github/workflows/library_interop_tests.yml
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ jobs:
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
push-ci-python:
needs: getVersion
uses: ./.github/workflows/library_python_tests.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
pr-interop-test:
needs: getVersion
uses: ./.github/workflows/library_interop_tests.yml
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ test/**/Output/*
/package-lock.json
/node_modules

# Python docs build Artifacts
build
doc/build
AwsCryptographicMaterialProviders/runtimes/python/doc/generated/*

# Duvet output
specification_compliance_report.html

Expand Down
Loading
Loading