Skip to content

Commit

Permalink
feat: make scram an optional feature
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Apr 26, 2024
1 parent a673412 commit d254f5a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Build and run tests
run: cargo test --all-features
- name: Build and run tests on default feature set
run: cargo test
- name: Run tests on minimal feature set
run: cargo test --no-default-features
- name: Run tests on additional scram+ring feature set
run: cargo test --features server-api-scram-ring
- name: Run tests on additional scram+aws-lc-rs feature set
run: cargo test --features server-api-scram-aws-lc-rs

integration:
name: Integration tests
Expand Down
11 changes: 4 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ postgres-types = { version = "0.2", features = [
chrono = { version = "0.4", features = ["std"], optional = true }

[features]
default = ["server-api-ring"]
server-api-ring = ["server-api", "ring"]
server-api-aws-lc-rs = ["server-api", "aws-lc-rs"]
default = ["server-api"]
server-api-scram-ring = ["server-api", "ring", "dep:base64", "dep:stringprep", "dep:x509-certificate"]
server-api-scram-aws-lc-rs = ["server-api", "aws-lc-rs", "dep:base64", "dep:stringprep", "dep:x509-certificate"]
ring = ["dep:ring", "tokio-rustls/ring"]
aws-lc-rs = ["dep:aws-lc-rs", "tokio-rustls/aws-lc-rs"]
server-api = [
Expand All @@ -58,9 +58,6 @@ server-api = [
"dep:rand",
"dep:md5",
"dep:hex",
"dep:base64",
"dep:stringprep",
"dep:x509-certificate",
"dep:postgres-types",
"dep:chrono",
]
Expand Down Expand Up @@ -111,4 +108,4 @@ required-features = ["server-api"]

[[example]]
name = "scram"
required-features = ["server-api"]
required-features = ["server-api-scram-aws-lc-rs"]
4 changes: 4 additions & 0 deletions src/api/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,8 @@ where
pub mod cleartext;
pub mod md5pass;
pub mod noop;
#[cfg(any(
feature = "server-api-scram-ring",
feature = "server-api-scram-aws-lc-rs"
))]
pub mod scram;

0 comments on commit d254f5a

Please sign in to comment.