MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / make_key

Function make_key

ch_10/src/routes/authentication.rs:85–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

83}
84
85fn make_key() -> PasetoSymmetricKey<V4, PasetoLocal> {
86 let key_str = env::var("PASETO_KEY").unwrap();
87 let key_bytes = key_str.as_bytes();
88 let mut key_array = [0u8; 32];
89 let len = key_bytes.len().min(32);
90 key_array[..len].copy_from_slice(&key_bytes[..len]);
91 PasetoSymmetricKey::<V4, PasetoLocal>::from(Key::from(&key_array))
92}
93
94pub fn verify_token(
95 token: String,

Callers 2

verify_tokenFunction · 0.70
issue_tokenFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected