Skip to content

feat(crypto): add selectable RustCrypto algorithm features - #1075

Merged
Xuanwo merged 4 commits into
mainfrom
xuanwo/1069-crypto-feature-slicing-publication
Nov 25, 2026
Merged

Xuanwo merged 4 commits into
mainfrom
xuanwo/1069-crypto-feature-slicing-publication

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Add selectable rsa, p256, and aes-gcm features to reqsign-crypto-rustcrypto, all enabled by default. MD5, SHA-1, SHA-256, HMAC-SHA-1/256/512, and HMAC-SHA512 stay unconditional.
  • Disabled operations return ConfigInvalid naming the missing feature, including secure randomness. RSA, AES-GCM, and randomness remain unsupported on wasm32-unknown-unknown when enabled; P-256 stays available.
  • The facade exposes no algorithm features. default-crypto depends on the backend with default-features = false; service features weakly select only what they need: aws-v4a -> p256; azure, google, oracle, and http-message-signatures -> rsa. A service feature alone does not pull the backend.
  • Remove the facade google-credential-access-boundary-client-side feature. Client-side CAB is now opt-in through reqsign-google/credential-access-boundary-client-side with a provider supporting AES-GCM and secure randomness, plus an HttpSend transport for STS. If a graph also enables facade google, Cargo feature unification can expose the type through facade re-exports; that is not a facade feature.
  • The 0.21 release notes cover both this feature selection and the merged Arc<T> forwarding for CryptoProvider (Implement CryptoProvider for Arc<T> in reqsign-core #1068).

Google client-side CAB migration

  • First acquisition or refresh of intermediary credentials goes to STS. A valid cached intermediary enables local issuance of downscoped tokens.
  • The rustdoc example is runnable and uses a mock STS transport with the public Granter::grant(None) path. Only the aes-gcm backend feature is required; the example uses a public test vector, not credentials.
  • The upgrade guide, service README, and facade docs describe the facade feature removal, direct service opt-in, the Cargo-unification re-export caveat, and the AES-GCM/secure-randomness plus HttpSend requirements.

CI coverage

  • Backend feature matrix: default, no-default, each algorithm alone, and all three together, including missing-feature diagnostics.
  • All 25 facade service features plus the full aggregate are built and behavior-tested in isolated downstream Cargo invocations. Probes exercise actual RSA, P-256, AES-GCM, randomness, hash, and HMAC operations, and verify a service feature alone does not pull the backend.
  • A shared service table drives both the weak-mapping static check and the actual-operation oracle. full is validated by resolved feature expansion; deleting vercel from full fails with full does not enable service features: ['vercel'].
  • Existing crypto dependency-boundary and website provider-catalog checks remain.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace --no-fail-fast
  • cargo test --doc --all-features --workspace
  • cargo test -p reqsign-google --features credential-access-boundary-client-side --lib --tests
  • python3 .github/scripts/check_crypto_features.py
  • python3 .github/scripts/test_facade_features.py
  • node website/scripts/validate-providers.mjs
  • Release plan: 32 packages. Workspace publish dry run: 31 staged uploads / 31 dry-run aborts. Standalone reqsign-crypto-boring packaging: 12 files, 4 staged local dependencies normalized without paths.
  • Integrated tree equals the feat(core): implement CryptoProvider for Arc<T> #1073 merge-tree before the additive release-note and review-fix commits; the original candidate patch-id is preserved.

Part of #1069.

Downstream follow-up

SMB lock resolution is downstream and is not claimed here. After the actual 0.21 release, the maintainers will open and then notify the dedicated OpenDAL issue for the SMB lockfile path. This PR does not edit OpenDAL or notify it.

Add rsa, p256, and aes-gcm features, all enabled by default, while keeping MD5, SHA-1, SHA-256, and HMAC operations unconditional. Disabled operations return ConfigInvalid naming the missing feature.

The facade disables backend defaults and weakly maps aws-v4a to p256 and azure, google, oracle, and http-message-signatures to rsa. A service feature alone no longer pulls the backend. Remove the facade google-credential-access-boundary-client-side feature; direct CAB use now configures reqsign-google and an AES-GCM-capable provider.

Add backend feature-matrix and per-service facade isolation coverage, and update the 0.21 docs.

Part of #1069.
Reflect the Arc<T> forwarding added for #1068 alongside the #1069 algorithm feature selection, including the migration guidance and contract verification note.
Make the client-side CAB example runnable through Granter::grant(None) with a mock STS transport and an aes-gcm-only provider. Document that the facade CAB feature is removed while Cargo feature unification can still expose the service API through facade re-exports.

Validate that the facade full feature expands to every service feature from a shared table, and probe a missing vercel entry as a regression.

Part of #1069.
State that first acquisition or refresh of intermediary credentials goes to STS, while a valid cached intermediary enables local downscoped-token issuance. Name AES-GCM and secure randomness as provider requirements.
@Xuanwo
Xuanwo merged commit 324079e into main Nov 25, 2026
69 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/1069-crypto-feature-slicing-publication branch November 25, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant