mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-30 18:27:00 +01:00
new_token returns 32 bytes from the operating system's random source as 64 lowercase hexadecimal characters, the form valid_token checks. A server built on serve_lines can now create its per-launch token without its own random source. The function and its getrandom dependency are left out on wasm32.
20 lines
490 B
TOML
20 lines
490 B
TOML
[package]
|
|
name = "craft-control-protocol"
|
|
description = "Authenticated bounded JSON-lines control protocol"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version.workspace = true
|
|
repository.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
serde_json = { workspace = true }
|
|
subtle = "2"
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
# The session token: 32 random bytes from the operating system (MIT OR Apache-2.0).
|
|
getrandom = "0.3"
|