fix: real AP id tests, exact poster key check, exists port, list_movies fake

This commit is contained in:
2026-10-26 01:33:29 +01:00
parent 4cb2972f63
commit 818ab893a1
13 changed files with 395 additions and 80 deletions

View File

@@ -38,34 +38,3 @@ pub fn watchlist_entry_url(
))
.expect("base_url is always a valid URL prefix")
}
#[cfg(test)]
mod tests {
use super::*;
/// k-ap derives the Create activity id from the object id (UUIDv5), so
/// re-handling an event only re-sends the same activity id if our object
/// ids are pure functions of the entity. Update/Delete/Move ids are minted
/// randomly inside k-ap 0.5 with no override (see ADR-0015): those repeat
/// semantically idempotent activities under a fresh id.
#[test]
fn activitypub_object_ids_are_stable_across_event_redelivery() {
let instance = InstanceIdentity::new("https://diary.example");
let review = ReviewId::from_uuid(uuid::Uuid::new_v4());
let user = uuid::Uuid::new_v4();
let movie = uuid::Uuid::new_v4();
assert_eq!(
review_url(&instance, &review),
review_url(&instance, &review)
);
assert_eq!(
goal_url(&instance, user, 2026),
goal_url(&instance, user, 2026)
);
assert_eq!(
watchlist_entry_url(&instance, user, movie),
watchlist_entry_url(&instance, user, movie)
);
}
}