Server tools to backfill, tail, mirror, and verify PLC logs

fjall: dont use padded base64url to parse the signatures

ptr.pet e61a3187 6ac66700

verified
+4 -4
+4 -4
src/plc_fjall.rs
··· 1 1 use crate::{Dt, ExportPage, Op as CommonOp, PageBoundaryState}; 2 - use data_encoding::{BASE32_NOPAD, BASE64URL}; 2 + use data_encoding::{BASE32_NOPAD, BASE64URL, BASE64URL_NOPAD}; 3 3 use fjall::{Database, Keyspace, KeyspaceCreateOptions, OwnedWriteBatch, PersistMode}; 4 4 use serde::{Deserialize, Serialize}; 5 5 use std::collections::BTreeMap; ··· 86 86 87 87 impl Signature { 88 88 fn from_base64url(s: &str) -> anyhow::Result<Self> { 89 - BASE64URL 89 + BASE64URL_NOPAD 90 90 .decode(s.as_bytes()) 91 91 .map(Self) 92 - .map_err(|e| anyhow::anyhow!("invalid base64url sig: {e}")) 92 + .map_err(|e| anyhow::anyhow!("invalid base64url sig {s}: {e}")) 93 93 } 94 94 } 95 95 96 96 impl fmt::Display for Signature { 97 97 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 98 - f.write_str(&BASE64URL.encode(&self.0)) 98 + f.write_str(&BASE64URL_NOPAD.encode(&self.0)) 99 99 } 100 100 } 101 101