aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTyler Davis <tyler@gluecode.com>2024-01-23 19:25:56 +0000
committerTyler Davis <tyler@gluecode.com>2024-01-23 19:25:56 +0000
commit014e223081d3772f531964ec29f7222b52980ab7 (patch)
treecf77d0552773a2ac7f7c3d118a98cf9b10a44610 /src
parent209bce3e3b7006c2a269016c6ab085afe6e56ebc (diff)
downloadfortknox-014e223081d3772f531964ec29f7222b52980ab7.tar.gz
fortknox-014e223081d3772f531964ec29f7222b52980ab7.zip
Add struct
Diffstat (limited to 'src')
-rw-r--r--src/main.rs18
1 files changed, 18 insertions, 0 deletions
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!");
}