diff options
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/store.rs | 2 | ||||
| -rw-r--r-- | src/api/users.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/api/store.rs b/src/api/store.rs index a7f4686..f0b3094 100644 --- a/src/api/store.rs +++ b/src/api/store.rs @@ -1342,7 +1342,7 @@ mod tests { json!({"swarm": "s", "path": ["x"], "user": "alice", "at": 1, "seq": 0, "prev": ""}); format!( "{}{}.{}.c2ln", - store::ENVELOPE, + crate::document::signed::START, URL_SAFE_NO_PAD.encode(value.to_string()), URL_SAFE_NO_PAD.encode(meta.to_string()) ) diff --git a/src/api/users.rs b/src/api/users.rs index 66b6a8b..f27eff1 100644 --- a/src/api/users.rs +++ b/src/api/users.rs @@ -48,7 +48,7 @@ use tracing::info; use super::ApiError; use super::access::{Access, Before, registry_kept}; use super::auth::AuthenticatedUser; -use crate::access::{Right, registry}; +use crate::access::{Right, envelope, registry}; use crate::document::store; use crate::state::AppState; @@ -153,7 +153,7 @@ pub(crate) async fn own_keys( .flatten() .ok_or_else(|| ApiError(StatusCode::NOT_FOUND, Some("no entry of yours".to_owned())))?; let signed = match store::read_path(&replica.doc, &path) { - Ok(Some(JsonValue::String(text))) if text.starts_with(store::ENVELOPE) => Some(text), + Ok(Some(JsonValue::String(text))) if envelope::read(&text).is_ok() => Some(text), _ => None, }; Ok(Json(json!({ |
