|
|
|
|
[package]
|
|
|
|
|
name = "synctv-core"
|
|
|
|
|
version.workspace = true
|
|
|
|
|
edition.workspace = true
|
|
|
|
|
authors.workspace = true
|
|
|
|
|
license.workspace = true
|
|
|
|
|
|
|
|
|
|
[dependencies]
|
|
|
|
|
# Internal
|
|
|
|
|
synctv-media-providers = { workspace = true, default-features = false }
|
|
|
|
|
synctv-common = { workspace = true, default-features = false }
|
|
|
|
|
|
|
|
|
|
# Async
|
|
|
|
|
tokio.workspace = true
|
|
|
|
|
tokio-util.workspace = true
|
|
|
|
|
async-trait.workspace = true
|
|
|
|
|
futures.workspace = true
|
|
|
|
|
|
|
|
|
|
# Database
|
|
|
|
|
sqlx.workspace = true
|
|
|
|
|
|
|
|
|
|
# Redis
|
|
|
|
|
redis.workspace = true
|
|
|
|
|
|
|
|
|
|
# Security
|
|
|
|
|
opaque-ke.workspace = true
|
|
|
|
|
jsonwebtoken.workspace = true
|
|
|
|
|
oauth2.workspace = true
|
|
|
|
|
webauthn-rs.workspace = true
|
|
|
|
|
webauthn-rs-proto.workspace = true
|
|
|
|
|
aes-gcm.workspace = true
|
|
|
|
|
ammonia.workspace = true
|
|
|
|
|
zxcvbn.workspace = true
|
|
|
|
|
|
|
|
|
|
# Serialization
|
|
|
|
|
serde.workspace = true
|
|
|
|
|
serde_json.workspace = true
|
|
|
|
|
|
|
|
|
|
# Caching
|
|
|
|
|
moka.workspace = true
|
|
|
|
|
dashmap.workspace = true
|
|
|
|
|
async_singleflight.workspace = true
|
|
|
|
|
|
|
|
|
|
# IDs & Crypto
|
|
|
|
|
uuid.workspace = true
|
|
|
|
|
rand.workspace = true
|
|
|
|
|
rand_08.workspace = true
|
|
|
|
|
rand_chacha_08.workspace = true
|
|
|
|
|
sha1.workspace = true
|
|
|
|
|
sha2.workspace = true
|
|
|
|
|
sha2_010.workspace = true
|
|
|
|
|
hkdf.workspace = true
|
|
|
|
|
hmac.workspace = true
|
|
|
|
|
humantime.workspace = true
|
|
|
|
|
hex.workspace = true
|
|
|
|
|
|
|
|
|
|
# Ordered collections
|
|
|
|
|
indexmap.workspace = true
|
|
|
|
|
|
|
|
|
|
# Utilities
|
|
|
|
|
anyhow.workspace = true
|
|
|
|
|
opendal.workspace = true
|
|
|
|
|
opendal-http-transport-reqwest.workspace = true
|
|
|
|
|
thiserror.workspace = true
|
|
|
|
|
bytes.workspace = true
|
|
|
|
|
parking_lot.workspace = true
|
|
|
|
|
url.workspace = true
|
|
|
|
|
percent-encoding.workspace = true
|
|
|
|
|
regex.workspace = true
|
|
|
|
|
|
|
|
|
|
# HTTP Client
|
|
|
|
|
reqwest.workspace = true
|
|
|
|
|
tokio-socks.workspace = true
|
|
|
|
|
tokio-rustls.workspace = true
|
|
|
|
|
webpki-roots.workspace = true
|
|
|
|
|
|
|
|
|
|
rustls.workspace = true
|
|
|
|
|
|
|
|
|
|
# Resilience
|
|
|
|
|
governor.workspace = true
|
|
|
|
|
nonzero_ext.workspace = true
|
|
|
|
|
backon.workspace = true
|
|
|
|
|
failsafe.workspace = true
|
|
|
|
|
|
|
|
|
|
# Time
|
|
|
|
|
chrono.workspace = true
|
feat(logging): add structured transport access logs (#436)
## Summary
- add structured HTTP and gRPC access logs with request correlation,
status-aware levels, response bytes, and complete body lifecycle timing
- route diagnostic and access events through independently configurable
text or JSON outputs with non-blocking writers and dropped-line
accounting
- honor the configured IANA timezone across text, JSON, diagnostic, and
access logs with DST-aware RFC 3339 offsets
- keep HTTP metric labels bounded while logging concrete unmatched paths
without query strings
- reduce local development noise by defaulting global logs to info while
retaining component debug logs
## Behavior
- HTTP 2xx and 3xx complete at info, 4xx at warn, and 5xx or body
failures at error
- slow handlers are raised to warn; ordinary client response
cancellation remains debug
- gRPC completion waits for final trailers and records the canonical
gRPC status
- request IDs are validated, propagated in responses, and included in
mapped gRPC errors
- header latency and full response lifecycle latency are reported
separately
- log timestamps use the configured time.timezone and include a numeric
UTC offset
## Testing
- cargo test -p synctv-api-common transport_access_log --lib
- cargo test -p synctv-core logging::tests --lib
- cargo test -p synctv resource_options::tests --lib
- cargo clippy for affected crates and all targets with warnings denied
- cargo check --workspace --all-targets
- cargo fmt --all -- --check
- git diff --check
- local server smoke tests for request completion, request ID
propagation, byte counts, query omission, and Asia/Shanghai timestamps
in diagnostic and access logs
1 month ago
|
|
|
chrono-tz.workspace = true
|
|
|
|
|
rsntp.workspace = true
|
|
|
|
|
|
|
|
|
|
# Logging
|
|
|
|
|
tracing.workspace = true
|
|
|
|
|
tracing-subscriber.workspace = true
|
|
|
|
|
tracing-appender.workspace = true
|
|
|
|
|
|
|
|
|
|
prometheus.workspace = true
|
|
|
|
|
|
|
|
|
|
# Email
|
|
|
|
|
lettre.workspace = true
|
|
|
|
|
handlebars.workspace = true
|
|
|
|
|
|
|
|
|
|
# Misc
|
|
|
|
|
base64.workspace = true
|
|
|
|
|
lz4_flex.workspace = true
|
|
|
|
|
zstd.workspace = true
|
|
|
|
|
image.workspace = true
|
|
|
|
|
symphonia.workspace = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[features]
|
|
|
|
|
default = ["tls-aws-lc", "tls-webpki-roots"]
|
|
|
|
|
k8s = []
|
|
|
|
|
test-support = []
|
|
|
|
|
tls-aws-lc = [
|
|
|
|
|
"synctv-media-providers/tls-aws-lc",
|
|
|
|
|
"synctv-common/tls-aws-lc",
|
|
|
|
|
"sqlx/tls-rustls-aws-lc-rs",
|
|
|
|
|
"lettre/aws-lc-rs",
|
|
|
|
|
"reqwest/rustls",
|
|
|
|
|
"rustls/aws_lc_rs",
|
|
|
|
|
"jsonwebtoken/aws_lc_rs",
|
|
|
|
|
]
|
|
|
|
|
tls-ring = [
|
|
|
|
|
"synctv-media-providers/tls-ring",
|
|
|
|
|
"synctv-common/tls-ring",
|
|
|
|
|
"sqlx/tls-rustls-ring-webpki",
|
|
|
|
|
"lettre/ring",
|
|
|
|
|
"reqwest/rustls-no-provider",
|
|
|
|
|
"rustls/ring",
|
|
|
|
|
"jsonwebtoken/rust_crypto",
|
|
|
|
|
]
|
|
|
|
|
tls-webpki-roots = [
|
|
|
|
|
"synctv-media-providers/tls-webpki-roots",
|
|
|
|
|
"synctv-common/tls-webpki-roots",
|
|
|
|
|
"lettre/webpki-roots",
|
|
|
|
|
"redis/tokio-rustls-comp",
|
|
|
|
|
"redis/tls-rustls-webpki-roots",
|
|
|
|
|
]
|
|
|
|
|
tls-native-roots = [
|
|
|
|
|
"synctv-media-providers/tls-native-roots",
|
|
|
|
|
"synctv-common/tls-native-roots",
|
|
|
|
|
"lettre/rustls-native-certs",
|
|
|
|
|
"redis/tokio-rustls-comp",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
[lints]
|
|
|
|
|
workspace = true
|
|
|
|
|
|
|
|
|
|
[dev-dependencies]
|
|
|
|
|
tokio = { workspace = true, features = ["test-util"] }
|
|
|
|
|
criterion.workspace = true
|
|
|
|
|
rand.workspace = true
|
|
|
|
|
synctv-core-testing.workspace = true
|
|
|
|
|
tempfile.workspace = true
|
|
|
|
|
|
|
|
|
|
[[bench]]
|
|
|
|
|
name = "auth_service"
|
|
|
|
|
harness = false
|
|
|
|
|
|
|
|
|
|
[[bench]]
|
|
|
|
|
name = "database_benchmarks"
|
|
|
|
|
harness = false
|