[package]
name = "s2-simple-secrets"
version = "1.5.1"
edition = "2021"
description = "Simple Secrets — inject secrets into subprocesses without ambient environment exposure"
license = "MIT"
repository = "https://github.com/ags-slc/s2"
homepage = "https://github.com/ags-slc/s2"
keywords = ["secrets", "security", "cli", "encryption"]
categories = ["command-line-utilities"]

[[bin]]
name = "s2"
path = "src/main.rs"

[dependencies]
# CLI
clap = { version = "4", features = ["derive"] }
clap_complete = "4"

# Secret memory management
secrecy = { version = "0.10", features = ["serde"] }
zeroize = { version = "1", features = ["derive"] }

# Hashing (file-based keychain fallback)
sha2 = "0.10"

# Encryption
age = { version = "0.11", features = ["armor"] }

# Unix
nix = { version = "0.29", features = ["process", "fs", "signal"] }

# Multi-pattern replacement
aho-corasick = "1"

# Secret scanning
regex = "1"
ignore = "0.4"

# Config
toml = "0.8"
serde = { version = "1", features = ["derive"] }

# Error handling
thiserror = "2"
anyhow = "1"

# Time
chrono = { version = "0.4", features = ["serde"] }

# Secure temp files
tempfile = "3"

# IO

# Provider: AWS SSM (optional)
aws-config = { version = "1", optional = true }
aws-sdk-ssm = { version = "1", optional = true }
tokio = { version = "1", features = ["rt"], optional = true }

# JSON (hook stdin/stdout, vault provider)
serde_json = "1"

# Provider: Vault (optional)
reqwest = { version = "0.12", features = ["blocking", "json"], optional = true }

[features]
default = ["provider-ssm"]
provider-ssm = ["dep:aws-config", "dep:aws-sdk-ssm", "dep:tokio"]
provider-vault = ["dep:reqwest"]

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/s2-{ target }.tar.gz"

[target.'cfg(target_os = "macos")'.dependencies]
keyring = { version = "3", features = ["apple-native"] }
security-framework = "3"

[target.'cfg(target_os = "linux")'.dependencies]
keyring = { version = "3", features = ["linux-native"] }

[dev-dependencies]
assert_cmd = "2"
predicates = "3"
tempfile = "3"
