- Implemented PanicTracker to log panics using tracing within a dedicated span. - Introduced PanicInfo struct to capture panic details. - Added tests for panic catching and hook restoration. feat: implement token-bucket rate limiter - Created RateLimiter to manage token consumption with configurable rates and burst capacity. - Added methods for acquiring tokens and checking available tokens. - Included tests for rate limiting behavior and token availability. feat: add automatic retry with exponential backoff - Developed retry function to handle transient errors with configurable retry strategies. - Introduced RetryConfig for customizing retry behavior and jitter. - Added tests for various retry scenarios and error handling. feat: implement graceful shutdown coordination - Created ShutdownManager to manage shutdown signals and task completion. - Introduced ShutdownSignal for tasks to observe shutdown requests. - Added tests for shutdown request handling and task draining. feat: add timeout functionality for async operations - Implemented with_timeout function to enforce execution time limits on futures. - Created Timeout struct for wrapping futures with a deadline. - Added tests for timeout behavior and error mapping.
38 lines
1.8 KiB
TOML
38 lines
1.8 KiB
TOML
[package]
|
|
name = "corex-crypto"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
rust-version = "1.75"
|
|
license = "MIT OR Apache-2.0"
|
|
repository = "https://github.com/asepharyana/mytheclipse"
|
|
homepage = "https://github.com/asepharyana/mytheclipse"
|
|
documentation = "https://docs.rs/corex-crypto"
|
|
authors = ["asepharyana <superaseph@gmail.com>"]
|
|
description = "Safe hashing, encryption, and token helpers (Argon2id, AES-256-GCM, JWT/Paseto) with key rotation support."
|
|
readme = "README.md"
|
|
keywords = ["crypto", "argon2", "aes-gcm", "jwt", "security"]
|
|
categories = ["cryptography", "authentication"]
|
|
|
|
[features]
|
|
default = ["password", "encryption", "tokens"]
|
|
# Low-level primitives are always available (zero-cost). The feature flags
|
|
# pull in the backing SDK crates.
|
|
password = ["dep:password-hash", "dep:argon2"]
|
|
encryption = ["dep:aead", "dep:aes-gcm", "dep:rand_core", "dep:rand"]
|
|
tokens = ["encryption", "dep:serde", "dep:serde_json", "dep:base64", "dep:jsonwebtoken"]
|
|
|
|
[dependencies]
|
|
tracing = "0.1"
|
|
|
|
# Optional backends
|
|
argon2 = { version = "0.5", default-features = false, features = ["std"], optional = true }
|
|
password-hash = { version = "0.5", default-features = false, features = ["std"], optional = true }
|
|
aes-gcm = { version = "0.10", default-features = false, features = ["aes", "alloc"], optional = true }
|
|
aead = { version = "0.5", default-features = false, features = ["alloc"], optional = true }
|
|
jsonwebtoken = { version = "9", default-features = false, optional = true }
|
|
base64 = { version = "0.22", default-features = false, optional = true }
|
|
serde = { version = "1", optional = true, features = ["derive"] }
|
|
serde_json = { version = "1", optional = true }
|
|
rand = { version = "0.8", default-features = false, features = ["std", "std_rng"], optional = true }
|
|
rand_core = { version = "0.6", optional = true }
|