Skip to content

Commit b2df7a2

Browse files
author
Lucas McDonald
committed
Merge branch 'dashboard-commit' of github.com:aws/amazon-s3-encryption-client-python into dashboard-commit
2 parents da71381 + e6f7803 commit b2df7a2

37 files changed

Lines changed: 955 additions & 114 deletions

File tree

.github/workflows/duvet.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,20 @@ jobs:
1414

1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v5
1818
with:
1919
submodules: true
2020
token: ${{ secrets.PAT_FOR_PRIVATE_RUBY }}
2121

22+
- name: Checkout CPP code cpp-v3
23+
uses: actions/checkout@v5
24+
with:
25+
submodules: recursive
26+
token: ${{ secrets.PAT_FOR_CPP }}
27+
repository: awslabs/aws-sdk-cpp-staging
28+
ref: fire-egg-dev
29+
path: test-server/cpp-v3-server/aws-sdk-cpp/
30+
2231
- name: Setup Rust toolchain
2332
uses: actions-rust-lang/setup-rust-toolchain@v1
2433
with:
@@ -82,15 +91,15 @@ jobs:
8291
test-server/index.html
8392
8493
- name: Setup Pages
85-
if: github.ref == 'refs/heads/fireegg-test-servers' && github.event_name == 'push'
94+
if: always() && github.ref == 'refs/heads/fireegg-test-servers' && github.event_name == 'push'
8695
uses: actions/configure-pages@v5
8796

8897
- name: Upload Pages artifact
89-
if: github.ref == 'refs/heads/fireegg-test-servers' && github.event_name == 'push'
98+
if: always() && github.ref == 'refs/heads/fireegg-test-servers' && github.event_name == 'push'
9099
uses: actions/upload-pages-artifact@v3
91100
with:
92101
path: test-server/
93102

94103
- name: Deploy to GitHub Pages
95-
if: github.ref == 'refs/heads/fireegg-test-servers' && github.event_name == 'push'
104+
if: always() && github.ref == 'refs/heads/fireegg-test-servers' && github.event_name == 'push'
96105
uses: actions/deploy-pages@v4

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
lint:
11-
runs-on: macos-13
11+
runs-on: macos-15
1212

1313
steps:
1414
- name: Checkout code

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,20 @@ jobs:
1818
uses: ./.github/workflows/lint.yml
1919

2020
run-tests:
21+
permissions:
22+
id-token: write
23+
contents: read
2124
name: Run Tests
2225
uses: ./.github/workflows/test.yml
2326
with:
2427
python-version: ${{ inputs.python-version || '3.11' }}
2528
secrets: inherit
2629

2730
run-duvet:
31+
permissions:
32+
id-token: write
33+
contents: read
34+
pages: write
2835
name: Run Duvet
2936
uses: ./.github/workflows/duvet.yml
3037
secrets: inherit

.github/workflows/test.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
# ask Ryan to edit this PAT's permissions to add access to a new private repo.
2828
token: ${{ secrets.PAT_FOR_PRIVATE_RUBY }}
2929

30-
- name: Checkout CPP code
30+
- name: Checkout CPP code for cpp-v2-transition
3131
uses: actions/checkout@v5
3232
with:
3333
submodules: recursive
@@ -36,6 +36,15 @@ jobs:
3636
ref: fire-egg-dev
3737
path: test-server/cpp-v2-transition-server/aws-sdk-cpp/
3838

39+
- name: Checkout CPP code cpp-v3
40+
uses: actions/checkout@v5
41+
with:
42+
submodules: recursive
43+
token: ${{ secrets.PAT_FOR_CPP }}
44+
repository: awslabs/aws-sdk-cpp-staging
45+
ref: fire-egg-dev
46+
path: test-server/cpp-v3-server/aws-sdk-cpp/
47+
3948
- name: Checkout .NET V2 code
4049
uses: actions/checkout@v5
4150
with:
@@ -94,7 +103,7 @@ jobs:
94103
uses: actions/cache@v3
95104
with:
96105
path: ~/.cache/uv
97-
key: ${{ runner.os }}-uv-${{ hashFiles('**/pyproject.toml') }}
106+
key: ${{ runner.os }}-uv-${{ hashFiles('./test-server/python-v3-server/**/pyproject.toml') }}
98107
restore-keys: |
99108
${{ runner.os }}-uv-
100109

test-server/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
.PHONY: all start-servers run-tests stop-servers clean ci check-env help
44

55
# Default target
6-
all: start-all-servers run-tests
6+
all: start-all-servers wait-all-servers run-tests
77

88
# CI target for GitHub Actions
9-
ci: start-all-servers run-tests stop-servers
9+
ci: start-all-servers wait-all-servers run-tests stop-servers
1010

1111
SERVER_DIRS := $(shell find . -maxdepth 1 -type d -name '*-server' | sed 's|^\./||' | $(if $(FILTER),grep -E "$$(echo '$(FILTER)' | sed 's/,/|/g')",cat) | sort)
12-
# SERVER_DIRS := cpp-v3-server
1312

1413
START_SERVER_TARGETS := $(addprefix start-, $(SERVER_DIRS))
1514
WAIT_SERVER_TARGETS := $(addprefix wait-, $(SERVER_DIRS))
@@ -125,4 +124,4 @@ duvet:
125124
@for dir in $(SERVER_DIRS); do \
126125
echo "Running make duvet in $$dir..."; \
127126
$(MAKE) -C $$dir duvet; \
128-
done
127+
done

test-server/cpp-v2-server/Makefile

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ PID_FILE := server.pid
66
PORT := 8085
77

88
build/s3ec-server:
9-
# brew install libmicrohttpd nlohmann-json ossp-uuid
10-
# git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp.git
11-
# cd aws-sdk-cpp
12-
# mkdir -p build && cd build && cmake ..
9+
brew install libmicrohttpd nlohmann-json ossp-uuid
10+
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp.git
11+
cd aws-sdk-cpp
12+
mkdir -p build && cd build && cmake ..
1313

1414
start-server: | build/s3ec-server
15-
# @echo "Starting Cpp V2 server..."
16-
# cd build && make && \
17-
# AWS_ACCESS_KEY_ID="$$AWS_ACCESS_KEY_ID" \
18-
# AWS_SECRET_ACCESS_KEY="$$AWS_SECRET_ACCESS_KEY" \
19-
# AWS_SESSION_TOKEN="$$AWS_SESSION_TOKEN" \
20-
# AWS_REGION="us-west-2" \
21-
# ./s3ec-server & echo $$! > $(PID_FILE)
22-
# @echo "Cpp V2 server starting..."
15+
@echo "Starting Cpp V2 server..."
16+
cd build && make && \
17+
AWS_ACCESS_KEY_ID="$$AWS_ACCESS_KEY_ID" \
18+
AWS_SECRET_ACCESS_KEY="$$AWS_SECRET_ACCESS_KEY" \
19+
AWS_SESSION_TOKEN="$$AWS_SESSION_TOKEN" \
20+
AWS_REGION="us-west-2" \
21+
./s3ec-server & echo $$! > $(PID_FILE)
22+
@echo "Cpp V2 server starting..."
2323

2424
stop-server:
2525
@if [ -f $(PID_FILE) ]; then \
@@ -29,9 +29,3 @@ stop-server:
2929

3030
wait-for-server:
3131
$(MAKE) -C .. wait-for-port PORT=$(PORT)
32-
33-
duvet:
34-
duvet report
35-
36-
view-report-mac:
37-
open .duvet/reports/report.html

test-server/cpp-v2-server/main.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,19 @@ MHD_Result handle_create_client(struct MHD_Connection *connection,
5757
std::string kms_key_id = request["config"]["keyMaterial"]["kmsKeyId"];
5858
bool legacy1 = request["config"]["enableLegacyWrappingAlgorithms"];
5959
bool legacy2 = request["config"]["enableLegacyUnauthenticatedModes"];
60+
bool inst_put = false;
61+
if (request["config"].contains("instructionFileConfig") &&
62+
request["config"]["instructionFileConfig"].contains("enableInstructionFilePutObject")) {
63+
inst_put = request["config"]["instructionFileConfig"]["enableInstructionFilePutObject"];
64+
}
6065

6166
auto materials =
6267
std::make_shared<KMSWithContextEncryptionMaterials>(kms_key_id);
6368
CryptoConfigurationV2 config(materials);
64-
if (legacy1 || legacy2) {
69+
if (legacy1 || legacy2)
6570
config.SetSecurityProfile(SecurityProfile::V2_AND_LEGACY);
71+
if (inst_put)
72+
config.SetStorageMethod(StorageMethod::INSTRUCTION_FILE);
6673

6774
auto encryption_client = std::make_shared<S3EncryptionClientV2>(config);
6875

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
reports/
2+
requirements/
3+
specification/

test-server/cpp-v2-transition-server/.duvet/config.toml

Lines changed: 0 additions & 24 deletions
This file was deleted.

test-server/cpp-v2-transition-server/Makefile

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ PID_FILE := server.pid
66
PORT := 8097
77

88
build/s3ec-server:
9-
# brew install libmicrohttpd nlohmann-json ossp-uuid
10-
# mkdir -p build && cd build && cmake ..
9+
brew install libmicrohttpd nlohmann-json ossp-uuid
10+
mkdir -p build && cd build && cmake ..
1111

1212
start-server: | build/s3ec-server
13-
# @echo "Starting Cpp V2 server..."
14-
# cd build && make && \
15-
# AWS_ACCESS_KEY_ID="$$AWS_ACCESS_KEY_ID" \
16-
# AWS_SECRET_ACCESS_KEY="$$AWS_SECRET_ACCESS_KEY" \
17-
# AWS_SESSION_TOKEN="$$AWS_SESSION_TOKEN" \
18-
# AWS_REGION="us-west-2" \
19-
# ./s3ec-server & echo $$! > $(PID_FILE)
20-
# @echo "Cpp V2 server starting..."
13+
@echo "Starting Cpp V2 server..."
14+
cd build && make && \
15+
AWS_ACCESS_KEY_ID="$$AWS_ACCESS_KEY_ID" \
16+
AWS_SECRET_ACCESS_KEY="$$AWS_SECRET_ACCESS_KEY" \
17+
AWS_SESSION_TOKEN="$$AWS_SESSION_TOKEN" \
18+
AWS_REGION="us-west-2" \
19+
./s3ec-server & echo $$! > $(PID_FILE)
20+
@echo "Cpp V2 server starting..."
2121

2222
stop-server:
2323
@if [ -f $(PID_FILE) ]; then \
@@ -26,10 +26,4 @@ stop-server:
2626
fi
2727

2828
wait-for-server:
29-
# $(MAKE) -C .. wait-for-port PORT=$(PORT)
30-
31-
duvet:
32-
duvet report
33-
34-
view-report-mac:
35-
open .duvet/reports/report.html
29+
$(MAKE) -C .. wait-for-port PORT=$(PORT)

0 commit comments

Comments
 (0)