-
Notifications
You must be signed in to change notification settings - Fork 0
cpp-v3 test server #55
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e3932e9
chore: cpp-v3 test server
ajewellamz 4f0fb14
m
ajewellamz 9753328
m
ajewellamz 9106e50
m
ajewellamz 2d89715
m
ajewellamz 84327ad
m
ajewellamz 6fc2a83
m
ajewellamz e64df93
m
ajewellamz 6052a4e
m
ajewellamz 9cc5614
m
ajewellamz 6ac3996
m
ajewellamz 930f61b
m
ajewellamz f688aea
m
ajewellamz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| reports/ | ||
| requirements/ | ||
| specification/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| reports/ | ||
| requirements/ | ||
| specification/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| '$schema' = "https://awslabs.github.io/duvet/config/v0.4.0.json" | ||
|
|
||
| [[source]] | ||
| pattern = "aws-sdk-cpp/src/aws-cpp-sdk-s3-encryption/**/*.cpp" | ||
|
|
||
| [[source]] | ||
| pattern = "aws-sdk-cpp/src/aws-cpp-sdk-s3-encryption/**/*.h" | ||
|
|
||
| # Include required specifications here | ||
| [[specification]] | ||
| source = "../specification/s3-encryption/data-format/content-metadata.md" | ||
| [[specification]] | ||
| source = "../specification/s3-encryption/data-format/metadata-strategy.md" | ||
| [[specification]] | ||
| source = "../specification/s3-encryption/encryption.md" | ||
| [[specification]] | ||
| source = "../specification/s3-encryption/decryption.md" | ||
| [[specification]] | ||
| source = "../specification/s3-encryption/key-derivation.md" | ||
| [[specification]] | ||
| source = "../specification/s3-encryption/key-commitment.md" | ||
|
|
||
|
|
||
| [report.html] | ||
| enabled = true | ||
|
|
||
| # Enable snapshots to prevent requirement coverage regressions | ||
| [report.snapshot] | ||
| enabled = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| cmake_minimum_required(VERSION 3.16) | ||
| project(s3ec-cpp-v2-server) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 17) | ||
|
|
||
| # Configure AWS SDK build options | ||
| set(BUILD_ONLY "kms;s3;s3-encryption" CACHE STRING "Build only KMS, S3, and S3-encryption components") | ||
| set(ENABLE_TESTING OFF CACHE BOOL "Disable testing") | ||
| set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build static libraries") | ||
|
|
||
| # Add AWS SDK as subdirectory | ||
| add_subdirectory(aws-sdk-cpp) | ||
|
|
||
| find_package(PkgConfig REQUIRED) | ||
| pkg_check_modules(LIBMICROHTTPD REQUIRED libmicrohttpd) | ||
|
|
||
| find_package(nlohmann_json REQUIRED) | ||
|
|
||
| add_executable(s3ec-server main.cpp) | ||
|
|
||
| target_include_directories(s3ec-server PRIVATE | ||
| ${LIBMICROHTTPD_INCLUDE_DIRS} | ||
| /opt/homebrew/include | ||
| ) | ||
|
|
||
| target_link_directories(s3ec-server PRIVATE | ||
| ${LIBMICROHTTPD_LIBRARY_DIRS} | ||
| /opt/homebrew/lib | ||
| ) | ||
|
|
||
| target_link_libraries(s3ec-server | ||
| ${LIBMICROHTTPD_LIBRARIES} | ||
| aws-cpp-sdk-core | ||
| aws-cpp-sdk-kms | ||
| aws-cpp-sdk-s3 | ||
| aws-cpp-sdk-s3-encryption | ||
| nlohmann_json::nlohmann_json | ||
| uuid | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Makefile for S3 Encryption Client Testing | ||
|
|
||
| .PHONY: start-server stop-server wait-for-server | ||
|
|
||
| PID_FILE := server.pid | ||
| PORT := 8091 | ||
|
|
||
| build/s3ec-server: | ||
| brew install libmicrohttpd nlohmann-json ossp-uuid | ||
| mkdir -p build && cd build && cmake .. | ||
|
|
||
| start-server: | build/s3ec-server | ||
| @echo "Starting Cpp V2 server..." | ||
| cd build && make && \ | ||
| AWS_ACCESS_KEY_ID="$$AWS_ACCESS_KEY_ID" \ | ||
| AWS_SECRET_ACCESS_KEY="$$AWS_SECRET_ACCESS_KEY" \ | ||
| AWS_SESSION_TOKEN="$$AWS_SESSION_TOKEN" \ | ||
| AWS_REGION="us-west-2" \ | ||
| ./s3ec-server & echo $$! > $(PID_FILE) | ||
| @echo "Cpp V2 server starting..." | ||
|
|
||
| stop-server: | ||
| @if [ -f $(PID_FILE) ]; then \ | ||
| kill $$(cat $(PID_FILE)) 2>/dev/null || true; \ | ||
| rm $(PID_FILE); \ | ||
| fi | ||
|
|
||
| wait-for-server: | ||
| $(MAKE) -C .. wait-for-port PORT=$(PORT) | ||
|
|
||
| duvet: | ||
| duvet report | ||
|
|
||
| view-report-mac: | ||
| open .duvet/reports/report.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # C++ S3 Encryption Test Server | ||
|
|
||
| Minimal C++ implementation of the S3 Encryption test server. | ||
|
|
||
| ## Dependencies | ||
|
|
||
| - libmicrohttpd | ||
| - AWS SDK for C++ | ||
| - nlohmann/json | ||
| - uuid | ||
|
|
||
| On MacOS you can | ||
| ```bash | ||
| brew install libmicrohttpd nlohmann-json ossp-uuid | ||
| ``` | ||
|
|
||
| ## Build | ||
|
|
||
| ```bash | ||
| mkdir build && cd build | ||
| cmake .. | ||
| make | ||
| ``` | ||
|
|
||
| ## Run | ||
|
|
||
| ```bash | ||
| ./s3ec-server | ||
| ``` | ||
|
|
||
| Server runs on localhost:8085 | ||
|
|
||
| ## API Endpoints | ||
|
|
||
| - `POST /client` - Create S3 encryption client | ||
| - `GET /object/{bucket}/{key}` - Get encrypted object | ||
| - `PUT /object/{bucket}/{key}` - Put encrypted object |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.