aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml12
-rw-r--r--src/main.rs18
2 files changed, 24 insertions, 6 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 9d828c0..41778a2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,10 +4,10 @@ version = "0.1.0"
edition = "2021"
[dependencies]
-axum = "0.7.2"
-json = "0.12.4"
-serde = "1.0.193"
-sqlx = "0.7.3"
-tokio = { version = "1.35.1", features = ["full", "tracing"] }
-uuid = { version = "1.6.1", features =["v4", "v8", "fast-rng", "macro-diagnostics","serde", "bytemuck"]}
+axum = "~0.7"
+json = "~0.12"
+serde = "~1.0"
+sqlx = "~0.7"
+tokio = { version = "1", features = ["full", "tracing"] }
+uuid = { version = "1", features =["v4", "v8", "fast-rng", "macro-diagnostics","serde", "bytemuck"]}
diff --git a/src/main.rs b/src/main.rs
index e7a11a9..6f376e1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,3 +1,21 @@
+#![allow(dead_code)]
+
+// Only one kind of token stored: value -> token (+signature)
+// Unless empty=true, immediately reject empty values.
+// Namespace defaults to "Default" for quick start.
+// Always sign tokens with central key. Store signature, update when keys change.
+
+// "Rotate key" function should also re-sign tokens?
+
+#[derive(Debug)]
+struct Token {
+ namespace: String, // Namespace of token. If nil, expect prefix-based or default
+ token: String, // Base64-encoded token value
+ value: String, // Plaintext value
+ signature: String, // Cryptographic signature
+ empty: bool, // Set up a "maybe empty" style of custom token for empty responses
+}
+
fn main() {
println!("Hello, world!");
}