aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTyler Davis <tyler@gluecode.com>2024-01-23 19:33:06 +0000
committerTyler Davis <tyler@gluecode.com>2024-01-23 19:33:06 +0000
commite8b747d34075003c6d34d340349774c902e73eee (patch)
treef9dfb3944f8524fba5da3a13324a319a60a6fb50
parent014e223081d3772f531964ec29f7222b52980ab7 (diff)
downloadfortknox-e8b747d34075003c6d34d340349774c902e73eee.tar.gz
fortknox-e8b747d34075003c6d34d340349774c902e73eee.zip
More structs with API
-rw-r--r--src/main.rs18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 6f376e1..cdac768 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,12 +8,24 @@
// "Rotate key" function should also re-sign tokens?
#[derive(Debug)]
-struct Token {
- namespace: String, // Namespace of token. If nil, expect prefix-based or default
+struct TokenStore {
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
+}
+
+#[derive(Debug)]
+struct APISubmit {
+ namespace: String, // Namespace of token. If nil, expect prefix-based or default
+ value: String, // Plaintext value
+ empty: bool, // Allow a "maybe empty" style of custom token for empty responses
+}
+
+#[derive(Debug)]
+struct APIResponse {
+ namespace: String, // Namespace of token. If nil, expect prefix-based or default
+ token: String, // Base64-encoded token value
+ signature: String, // Cryptographic signature
}
fn main() {