Skip to content

Commit e2fd685

Browse files
tobyhedeauxesis
andcommitted
Support Authentication with SCRAM (#26)
* auth message parsing and scrambling * extract handler into module * add require_tls option to server config * read_message_with_timeout * PasswordMessage and SASLinitialresponse * Passthrough SCRAM_SHA_256 auth * add postgres-protocol * Pull log into module * Add dev option to disable database tls * remove unused tests * rename dataset to encrypt_config * rename test config files to disambiguate * add channel binding to tlsconfig on init * Improve error message on db connect failure * channelbinding for asyncstream * Auth module & SASL messages * read_auth_message * cleanup * SASL & MD5 Auth actually working * Do not require_tls by default * Handle database Md5 and cleartext auth * disable mapping * SASLMechanism as enum * log targets * Use correct sasl mechanism * updated cargo * Cleanup * psql tests * Maybe integration tests * README on int tests * Ignore cipherstash-proxy.local.toml * just enough shutdown for tests * attempt integration test in ci * clippy cleanup * Filter integration tests * Install latest stable rust * Explain what this config is for * Bump to latest mise, in attempt to work around bug * Do something unholy to make the command execute correctly * Fix use ordering to satisfy the `cargo fmt` gods * Move the test tasks to a more discoverable place * Explicitly call nextest tests unit tests * Run the integration tests as part of the CI tests * option to disable mapping * More logging * Fix bug introduced by bad merge conflict * Add a task for testing if Proxy has started * Make nc work on GNU-based systems * Try and determine if the wait is working * Report when successful * Disable running up a container Because we do that later in the integration tests * Test for the right port t 🤦 * wtf is going on * GitHub: tell me how can you fuck up a loop * Remove debugging. Fuck you GitHub * setup proxy env from secrets * setup proxy env from secrets * un-silent proxy run in tests * Install rust via mise * more clippy --------- Co-authored-by: Lindsay Holmwood <[email protected]> Co-authored-by: Lindsay Holmwood <[email protected]>
1 parent dacfd84 commit e2fd685

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1791
-321
lines changed

.github/workflows/test.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,29 @@ jobs:
1212
runs-on: buildjet-16vcpu-ubuntu-2204
1313
steps:
1414
- uses: actions/checkout@v4
15+
- name: Install rust
16+
shell: /bin/bash -l {0}
17+
run: rustup toolchain install stable --profile minimal --no-self-update
1518
- name: Setup Rust cache
1619
uses: Swatinem/rust-cache@v2
1720
with:
1821
cache-provider: buildjet
1922
cache-all-crates: true
2023
- uses: jdx/mise-action@v2
2124
with:
22-
version: 2024.12.0 # [default: latest] mise version to install
25+
version: 2024.12.11 # [default: latest] mise version to install
2326
install: true # [default: true] run `mise install`
2427
cache: true # [default: true] cache mise using GitHub's cache
2528
- run: |
2629
mise run up --extra-args "--detach --wait"
2730
- run: |
2831
mise run setup
29-
- run: |
30-
mise run test
32+
- name: ci
33+
env:
34+
CS_AUTH__WORKSPACE_ID: ${{ secrets.CS_AUTH__WORKSPACE_ID }}
35+
CS_AUTH__CLIENT_ACCESS_KEY: ${{ secrets.CS_AUTH__CLIENT_ACCESS_KEY }}
36+
CS_ENCRYPT__DATASET_ID: ${{ secrets.CS_ENCRYPT__DATASET_ID }}
37+
CS_ENCRYPT__CLIENT_ID: ${{ secrets.CS_ENCRYPT__CLIENT_ID }}
38+
CS_ENCRYPT__CLIENT_KEY: ${{ secrets.CS_ENCRYPT__CLIENT_KEY }}
39+
run: |
40+
mise run ci

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/target
22
.DS_Store
33
/cipherstash-proxy.toml
4+
/cipherstash-proxy.local.toml
45
mise.local.toml
56
tests/pg/data**
67
tests/sql/cipherstash-encrypt.sql

.mise/tasks/test/run

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

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rust stable

Cargo.lock

Lines changed: 197 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)