Files
alknet/crates/alknet-core/Cargo.toml
glm-5.2 8611935f1a feat(core): implement core types (ProtocolHandler, Connection, Capabilities)
Implements the foundational types in alknet-core/src/types.rs per the
core-types architecture (ADRs 002, 007, 014, 022):

- ProtocolHandler trait (alpn + async handle) with HandlerError
- Connection wrapping quinn/iroh via internal enum dispatch (feature-gated);
  write-once identity via OnceLock, IdentityAlreadySet on second set
- SendStream/RecvStream concrete wrappers implementing AsyncWrite/AsyncRead
- BiStream convenience trait
- StreamError with canonical From<StreamError> for HandlerError
- Capabilities: non-serializable, Zeroize + ZeroizeOnDrop, immutable builder
  API (new/with_api_key/with_http_token/get) backed by a Secret<String> wrapper
- Minimal Identity and AuthContext in auth.rs as the foundation the auth task
  extends

13 unit tests cover Capabilities (build/get/clone/zeroize/redaction) and
Connection::set_identity (once succeeds, twice errors). Verified across
feature combos (default, no-default, iroh-only): build, clippy -D warnings,
test, fmt --check all clean.

(task: core/core-types)
2026-06-23 13:49:12 +00:00

32 lines
806 B
TOML

[package]
name = "alknet-core"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "Core library for ALPN-based protocol dispatch: ProtocolHandler trait, Connection, auth, config, and multi-connectivity endpoint"
repository.workspace = true
[lib]
name = "alknet_core"
[features]
default = ["quinn"]
quinn = ["dep:quinn"]
iroh = ["dep:iroh"]
[dependencies]
tokio = { version = "1", features = ["full"] }
quinn = { version = "0.11", optional = true }
iroh = { version = "0.35", optional = true }
rustls = "0.23"
rustls-pki-types = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
toml = "0.8"
arc-swap = "1"
async-trait = "0.1"
tracing = "0.1"
thiserror = "2"
zeroize = { version = "1", features = ["alloc", "derive"] }
bytes = "1"
futures = "0.3"