(secret_key: &str)
| 87 | type JobStore = Arc<Mutex<HashMap<String, JobStatus>>>; |
| 88 | |
| 89 | fn derive_key(secret_key: &str) -> Vec<u8> { |
| 90 | let mut hasher = Sha256::new(); |
| 91 | hasher.input_str(secret_key); |
| 92 | let mut hashed_key = vec![0; 32]; |
| 93 | hasher.result(&mut hashed_key); |
| 94 | hashed_key |
| 95 | } |
| 96 | |
| 97 | fn decrypt_token(encrypted_token: &str, secret_key: &str) -> Result<String, GourceError> { |
| 98 | let parts: Vec<&str> = encrypted_token.split(':').collect(); |