Skip to content

[WIP] Python DBESDK #1794

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

Draft
wants to merge 255 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
255 commits
Select commit Hold shift + click to select a range
b895643
remove unnecessary asserts
ajewellamz Aug 22, 2024
81d8b26
m
ajewellamz Aug 22, 2024
4825712
m
ajewellamz Aug 22, 2024
f48a550
chore: Test with MPL main head
lucasmcdonald3 Aug 22, 2024
d21fbed
wip
lucasmcdonald3 Aug 28, 2024
2bfd3e3
merge
lucasmcdonald3 Aug 28, 2024
a4f4121
wip
lucasmcdonald3 Aug 28, 2024
1e147ae
wip python example
lucasmcdonald3 Sep 24, 2024
189af17
m
lucasmcdonald3 Oct 29, 2024
8f3604d
wip
lucasmcdonald3 Jan 6, 2025
66d573d
m
lucasmcdonald3 Jan 6, 2025
b6c8142
m
lucasmcdonald3 Jan 6, 2025
3bbe241
m
lucasmcdonald3 Jan 6, 2025
8026da0
m
lucasmcdonald3 Jan 7, 2025
39dd9e6
merge
lucasmcdonald3 Jan 7, 2025
9bbb645
?
lucasmcdonald3 Jan 10, 2025
2136eb4
wip
lucasmcdonald3 Jan 15, 2025
c832c49
wip
lucasmcdonald3 Jan 17, 2025
915ba28
m
lucasmcdonald3 Jan 17, 2025
0d54190
m
lucasmcdonald3 Jan 17, 2025
d9e2a4f
m
lucasmcdonald3 Jan 17, 2025
a2207db
Merge branch 'main' into singleton-keyvectors
lucasmcdonald3 Jan 17, 2025
90e2ede
m
lucasmcdonald3 Jan 17, 2025
a591e7f
ubuntu-not-latest
lucasmcdonald3 Jan 17, 2025
75325b0
m
lucasmcdonald3 Jan 17, 2025
b538d13
Merge branch 'main' into singleton-keyvectors
lucasmcdonald3 Jan 17, 2025
393c25e
cleanup
lucasmcdonald3 Jan 17, 2025
30aa212
merge
lucasmcdonald3 Jan 21, 2025
0f4f37a
m
lucasmcdonald3 Jan 21, 2025
736b2fe
m
lucasmcdonald3 Jan 21, 2025
2e39286
Merge branch 'wrapped-item-encryptor' into python-poc
lucasmcdonald3 Jan 21, 2025
652299c
m
lucasmcdonald3 Jan 21, 2025
ccef01c
Merge branch 'wrapped-item-encryptor' into python-poc
lucasmcdonald3 Jan 21, 2025
1eff5a7
m
lucasmcdonald3 Jan 22, 2025
a2bd9bb
m
lucasmcdonald3 Jan 31, 2025
81be9b6
m
lucasmcdonald3 Jan 31, 2025
0ef759b
m
lucasmcdonald3 Jan 31, 2025
0e41bed
m
lucasmcdonald3 Jan 31, 2025
4cdfd7f
m
lucasmcdonald3 Jan 31, 2025
4ba1345
m
lucasmcdonald3 Feb 7, 2025
05ea742
m
lucasmcdonald3 Feb 7, 2025
321284c
m
lucasmcdonald3 Feb 7, 2025
0892864
m
lucasmcdonald3 Feb 11, 2025
00c77cd
m
lucasmcdonald3 Feb 11, 2025
11c7a2b
m
lucasmcdonald3 Feb 11, 2025
058bd78
wip
lucasmcdonald3 Mar 3, 2025
a113cc4
paginator
Mar 4, 2025
daeed8d
wip
Mar 10, 2025
4383614
wip
Mar 10, 2025
ace02a2
client coverage
Mar 12, 2025
a9fabd7
wip
Mar 13, 2025
07a079a
wip
Mar 20, 2025
1fc0f77
wip, docs, tests
Mar 21, 2025
c2d54bb
wip
Mar 24, 2025
256c64b
m
Apr 3, 2025
2ed1a0e
m
Apr 7, 2025
fc72b5d
m
Apr 7, 2025
9ab80c5
m
Apr 9, 2025
12ded89
m
Apr 9, 2025
f3ae7a1
m
Apr 9, 2025
2ce6807
m
Apr 9, 2025
d3721d8
m
Apr 9, 2025
2b86238
m
Apr 9, 2025
541403b
m
Apr 9, 2025
e2c7c58
m
Apr 9, 2025
bd2e20c
m
Apr 9, 2025
a01b271
m
Apr 9, 2025
655d6d7
m
Apr 10, 2025
683dd64
m
Apr 10, 2025
d848722
m
Apr 10, 2025
86d0e65
m
Apr 10, 2025
8029445
m
Apr 10, 2025
3c80154
m
Apr 10, 2025
5e51f2c
m
Apr 10, 2025
34dae4c
m
Apr 10, 2025
357fea0
m
Apr 10, 2025
a516329
m
Apr 10, 2025
f17ddbe
m
Apr 10, 2025
2c836f0
m
Apr 10, 2025
21e4ce7
m
Apr 11, 2025
0101b05
m
Apr 11, 2025
3df8032
m
Apr 11, 2025
fbcee55
m
Apr 11, 2025
4b42e45
m
Apr 11, 2025
60b3835
m
Apr 11, 2025
2aec2c3
m
Apr 11, 2025
9a9a0b1
m
Apr 11, 2025
e352a01
m
Apr 11, 2025
7264795
m
Apr 14, 2025
6c5b215
m
Apr 15, 2025
a951d87
m
Apr 15, 2025
0606b80
m
Apr 15, 2025
5d0b615
m
Apr 15, 2025
4008095
m
Apr 16, 2025
354b806
local dafnyruntimepython
Apr 16, 2025
2387899
only config
Apr 16, 2025
c8c88bc
m
Apr 16, 2025
25d3f05
m
Apr 17, 2025
f194796
m
Apr 17, 2025
a5adf68
m
Apr 17, 2025
b502cd8
m
Apr 17, 2025
f5f5c1c
m
Apr 17, 2025
52f7c65
m
Apr 17, 2025
9d82567
m
Apr 17, 2025
c5f5b31
m
Apr 17, 2025
13aec15
m
Apr 17, 2025
b205490
m
Apr 17, 2025
72cccd9
m
Apr 17, 2025
fb351b9
m
Apr 17, 2025
9c9446c
m
Apr 17, 2025
97461b4
m
Apr 17, 2025
46eb496
m
Apr 17, 2025
40e1d63
m
Apr 17, 2025
40f6ae2
rust
Apr 17, 2025
d3ac5fe
m
Apr 17, 2025
93ed0f9
m
Apr 17, 2025
3368712
m
Apr 17, 2025
b761460
proof
Apr 17, 2025
35cae5f
m
Apr 17, 2025
719bb05
m
Apr 17, 2025
afd61ec
mm
Apr 17, 2025
8074ccd
m
Apr 17, 2025
8b31331
m
Apr 17, 2025
8651710
m
Apr 18, 2025
c290b04
m
Apr 18, 2025
df31a1d
m
Apr 18, 2025
c12817f
m
Apr 18, 2025
8ce4229
m
Apr 18, 2025
e755164
m
Apr 18, 2025
52e29a3
m
Apr 18, 2025
d8ea08a
m
Apr 18, 2025
00a840b
m
Apr 23, 2025
40624ba
m
Apr 29, 2025
55873eb
m
Apr 29, 2025
25dabc8
m
Apr 29, 2025
b9650ec
m
Apr 29, 2025
7242625
Merge branch 'main' into wrapped-item-encryptor
lucasmcdonald3 Apr 29, 2025
d70361c
m
Apr 29, 2025
8e51e21
m
Apr 30, 2025
ffbbb8f
Merge branch 'wrapped-item-encryptor' of github.com:aws/aws-database-…
Apr 30, 2025
639cf80
m
Apr 30, 2025
6880457
m
Apr 30, 2025
7336651
m
Apr 30, 2025
bb290e7
m
Apr 30, 2025
8779b31
m
Apr 30, 2025
06a1d7e
Merge branch 'main' into python-poc
lucasmcdonald3 May 1, 2025
ffdb761
m
May 1, 2025
83e6c2f
Merge branch 'python-poc' of github.com:aws/aws-database-encryption-s…
May 1, 2025
8df48d2
Merge branch 'main' into python-poc
lucasmcdonald3 May 1, 2025
b8e0d4b
m
May 1, 2025
1510ef6
m
May 1, 2025
89e6020
m
May 1, 2025
309c2a3
m
May 1, 2025
b227e64
m
May 1, 2025
c20581f
m
May 1, 2025
9a8164e
ruff
May 1, 2025
9ac89a1
m
May 1, 2025
2b01af7
m
May 2, 2025
172746c
m
May 2, 2025
5a900f6
m
May 2, 2025
e86604d
m
May 2, 2025
c8503ac
m
May 2, 2025
231a727
m
May 2, 2025
d93c112
m
May 2, 2025
7648bfa
m
May 2, 2025
8f025c0
m
May 2, 2025
a922747
m
May 2, 2025
f15b0a0
m
May 2, 2025
fa58fff
m
May 2, 2025
89fbb4f
m
May 2, 2025
59b1a5b
m
May 12, 2025
6a8e8b6
m
May 12, 2025
683a9dc
Merge branch 'main' into python-poc
May 12, 2025
ce4f1e9
m
May 12, 2025
3cc91ad
m
May 12, 2025
12d7dad
m
May 12, 2025
025cf87
m
May 12, 2025
67a5eeb
m
May 12, 2025
d4dcd48
m
May 12, 2025
37a24b4
m
May 12, 2025
3945dcb
m
May 12, 2025
a83d09a
m
May 13, 2025
ed474dd
m
May 13, 2025
26e40a8
m
May 13, 2025
3c4aef8
m
May 13, 2025
a165750
m
May 13, 2025
9becfb3
m
May 13, 2025
1e42a75
m
May 13, 2025
b82250e
m
May 13, 2025
86e2f89
m
May 13, 2025
b22ddb0
m
May 13, 2025
c801b42
m
May 13, 2025
75c0a40
m
May 13, 2025
bffe39a
m
May 13, 2025
9fca957
m
May 13, 2025
2c32586
m
May 13, 2025
1f464e9
m
May 13, 2025
f47d953
m
May 14, 2025
16e6f8b
m
May 14, 2025
f11765b
m
May 14, 2025
a472eab
m
May 14, 2025
0dfd612
m
May 14, 2025
a7bc85f
m
May 14, 2025
8269285
m
May 14, 2025
b7e8a55
m
May 14, 2025
54fd27a
m
May 14, 2025
a882ec6
m
May 14, 2025
f438ed6
m
May 14, 2025
34cf244
Merge branch 'main' into python-poc
lucasmcdonald3 May 14, 2025
97e4bde
m
May 14, 2025
fdda54b
m
May 14, 2025
d66ddcf
m
May 14, 2025
68bc741
m
May 14, 2025
f47746e
m
May 14, 2025
8761c9e
m
May 14, 2025
72eadd1
m
May 14, 2025
603b68a
m
May 14, 2025
78b7f61
m
May 14, 2025
64acb4a
m
May 14, 2025
d0bb1f3
m
May 14, 2025
9d0d5bd
m
May 14, 2025
6f24541
m
May 14, 2025
34624b5
m
May 14, 2025
161529e
m
May 14, 2025
436f010
m
May 14, 2025
a980548
m
May 15, 2025
6a4e39a
m
May 15, 2025
49cfcfc
m
May 15, 2025
0ff2c46
m
May 15, 2025
bb1c80d
m
May 15, 2025
bdccac6
m
May 15, 2025
8002f69
m
May 15, 2025
d0d58e3
m
May 16, 2025
22e30c2
m
May 16, 2025
376edbb
m
May 16, 2025
7bee0a4
m
May 16, 2025
3b20191
m
May 16, 2025
dc59b60
m
May 16, 2025
eb158dc
m
May 16, 2025
7ac8a18
m
May 16, 2025
1c749e6
m
May 16, 2025
ab7303e
m
May 16, 2025
37588c3
m
May 16, 2025
b21a781
m
May 16, 2025
084f4d3
m
May 16, 2025
08b9932
m
May 16, 2025
043b00c
m
May 16, 2025
8fa4fe7
m
May 16, 2025
5788d22
m
May 16, 2025
b6c74c1
m
May 16, 2025
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
94 changes: 94 additions & 0 deletions .github/workflows/ci_examples_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# This workflow performs tests in Python.
name: Python Examples

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
mpl-version:
description: "MPL version to use"
required: false
type: string
mpl-head:
description: "Running on MPL HEAD"
required: false
default: false
type: boolean

jobs:
testPython:
strategy:
matrix:
python-version: [3.11]
os: [macos-13]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
steps:
- 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-DDBEC-Dafny-Role-us-west-2
role-session-name: DDBEC-Dafny-Python-Tests

- uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Python ${{ matrix.python-version }} for running tests
run: |
python -m pip install --upgrade pip
pip install --upgrade tox
pip install poetry

- name: Setup Dafny
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
with:
dafny-version: ${{ inputs.dafny }}

- name: Update MPL submodule if using MPL HEAD
if: ${{ inputs.mpl-head == true }}
working-directory: submodules/MaterialProviders
run: |
git checkout main
git pull
git submodule update --init --recursive
git rev-parse HEAD

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
library: DynamoDbEncryption
diff-generated-code: false
update-and-regenerate-mpl: true

- name: Build and locally deploy dependencies for examples
shell: bash
working-directory: ./DynamoDbEncryption
run: |
make transpile_python

- name: Test DynamoDbEncryption Examples
working-directory: ./Examples/runtimes/python
run: |
# Run simple examples
tox -e dynamodbencryption
# Run migration examples
# tox -e migration
77 changes: 77 additions & 0 deletions .github/workflows/ci_static_analysis_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# This workflow performs static analysis in Python.
name: Python Static Analysis

on:
workflow_call:
inputs:
regenerate-code:
description: "Regenerate code using smithy-dafny"
required: false
default: false
type: boolean
mpl-version:
description: "MPL version to use"
required: false
type: string
mpl-head:
description: "Running on MPL HEAD"
required: false
default: false
type: boolean

jobs:
testPython:
strategy:
matrix:
python-version: [3.11]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
steps:
- 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-DDBEC-Dafny-Role-us-west-2
role-session-name: DDBEC-Dafny-Python-Tests

- uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Python ${{ matrix.python-version }} for running tests
run: |
python -m pip install --upgrade pip
pip install --upgrade tox
pip install poetry

- name: Update MPL submodule if using MPL HEAD
if: ${{ inputs.mpl-head == true }}
working-directory: submodules/MaterialProviders
run: |
git checkout main
git pull
git submodule update --init --recursive
git rev-parse HEAD

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
library: DynamoDbEncryption
diff-generated-code: false
update-and-regenerate-mpl: true

- name: Run static analysis
working-directory: ./DynamoDbEncryption/runtimes/python
run: |
tox -e ruff
tox -e black-check
128 changes: 128 additions & 0 deletions .github/workflows/ci_test_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# This workflow runs only Dafny-transpiled Python tests.
name: test python

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
mpl-head:
description: "Running on MPL HEAD"
required: false
default: false
type: boolean

jobs:
testPython:
strategy:
fail-fast: false
matrix:
library: [DynamoDbEncryption]
python-version: ["3.11"]
os: [
# macos-13,
ubuntu-22.04,
# Dafny-transpiled Python tests use a PYTHONPATH hack that doesn't work on Windows.
# Windows is tested with non-Dafny-transpiled Python tests.
# windows-latest
]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
steps:
- name: Support longpaths on Git checkout
run: |
git config --global core.longpaths true
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Python ${{ matrix.python-version }} for running tests
run: |
python -m pip install --upgrade pip
pip install --upgrade tox
pip install poetry

- name: Setup Dafny
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
with:
dafny-version: ${{ inputs.dafny }}

- name: Update MPL submodule if using MPL HEAD
if: ${{ inputs.mpl-head == true }}
working-directory: submodules/MaterialProviders
run: |
git checkout main
git pull
git submodule update --init --recursive
git rev-parse HEAD

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

- name: Download Dependencies
working-directory: ./${{ matrix.library }}
run: make setup_python

- 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-DDBEC-Dafny-Role-us-west-2
role-session-name: DDBEC-Dafny-Net-Tests

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

- name: Test ${{ matrix.library }} Dafny-transpiled Python tests
# Dafny-transpiled Python tests use a PYTHONPATH hack that doesn't work on Windows.
# Windows is tested with non-Dafny-transpiled Python tests.
if: ${{ matrix.os != 'windows-latest' }}
working-directory: ./${{ matrix.library }}/runtimes/python
shell: bash
run: |
tox -e dafnytests

- name: Test ${{ matrix.library }} Python unit tests
working-directory: ./${{ matrix.library }}/runtimes/python
shell: bash
run: |
tox -e unit

- name: Test ${{ matrix.library }} Python integration tests
working-directory: ./${{ matrix.library }}/runtimes/python
shell: bash
run: |
tox -e integ

- name: Test ${{ matrix.library }} Python coverage
working-directory: ./${{ matrix.library }}/runtimes/python
shell: bash
run: |
tox -e encrypted-interface-coverage
tox -e client-to-resource-conversions-coverage
tox -e resource-to-client-conversions-coverage
Loading
Loading