docs: update for new crate layout
This commit is contained in:
@@ -1,15 +1,7 @@
|
||||
use super::*;
|
||||
use crate::test_support::local_actor;
|
||||
use domain::value_objects::{InstanceIdentity, SocialActor, SocialIdentity, UserId};
|
||||
|
||||
fn local_actor(uid: &UserId) -> SocialActor {
|
||||
SocialActor {
|
||||
identity: SocialIdentity::Local(uid.clone()),
|
||||
handle: "@gabriel@md.example".into(),
|
||||
display_name: None,
|
||||
avatar_url: None,
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn local_actor_dto_url_round_trips_back_to_the_same_identity() {
|
||||
let instance = InstanceIdentity::new("https://md.example");
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
use super::*;
|
||||
use domain::value_objects::{InstanceIdentity, SocialActor, SocialIdentity, UserId};
|
||||
|
||||
fn local_actor(uid: &UserId) -> SocialActor {
|
||||
SocialActor {
|
||||
identity: SocialIdentity::Local(uid.clone()),
|
||||
handle: "@gabriel@md.example".into(),
|
||||
display_name: None,
|
||||
avatar_url: None,
|
||||
}
|
||||
}
|
||||
use crate::test_support::local_actor;
|
||||
use domain::value_objects::{InstanceIdentity, SocialIdentity, UserId};
|
||||
|
||||
#[test]
|
||||
fn local_blocked_dto_url_round_trips_back_to_the_same_identity() {
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
use super::*;
|
||||
use domain::value_objects::{InstanceIdentity, SocialActor, SocialIdentity, UserId};
|
||||
|
||||
fn local_actor(uid: &UserId) -> SocialActor {
|
||||
SocialActor {
|
||||
identity: SocialIdentity::Local(uid.clone()),
|
||||
handle: "@gabriel@md.example".into(),
|
||||
display_name: None,
|
||||
avatar_url: None,
|
||||
}
|
||||
}
|
||||
use crate::test_support::local_actor;
|
||||
use domain::value_objects::{InstanceIdentity, SocialIdentity, UserId};
|
||||
|
||||
#[test]
|
||||
fn local_template_url_round_trips_back_to_the_same_identity() {
|
||||
|
||||
@@ -8,3 +8,5 @@ pub mod openapi;
|
||||
pub mod router;
|
||||
pub mod state;
|
||||
mod support;
|
||||
#[cfg(test)]
|
||||
mod test_support;
|
||||
|
||||
12
crates/adapters/http-axum/src/test_support.rs
Normal file
12
crates/adapters/http-axum/src/test_support.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
//! Fixtures shared by the in-crate mapper tests.
|
||||
|
||||
use domain::value_objects::{SocialActor, SocialIdentity, UserId};
|
||||
|
||||
pub(crate) fn local_actor(uid: &UserId) -> SocialActor {
|
||||
SocialActor {
|
||||
identity: SocialIdentity::Local(uid.clone()),
|
||||
handle: "@gabriel@md.example".into(),
|
||||
display_name: None,
|
||||
avatar_url: None,
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,7 @@ pub struct WrapupGroup {
|
||||
pub list_wrapups: ListWrapUpsDeps,
|
||||
}
|
||||
|
||||
/// Every deps struct a handler can need, built once by the composition root.
|
||||
/// Every deps struct a handler can need, built once by `bootstrap`.
|
||||
/// Use cases still receive only their own narrow struct — nothing takes `&Deps`.
|
||||
///
|
||||
/// `bootstrap::build_deps` is called only from `bootstrap::build_server`.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Absorbs `handlers/import.rs::api_apply_profile`'s three-step orchestration:
|
||||
//! Absorbs `http-axum/src/api/import/sessions.rs::api_apply_profile`'s three-step orchestration:
|
||||
//! apply the saved profile's field mappings onto the session, reload the
|
||||
//! session to read back the mappings `apply_profile` just wrote, then run
|
||||
//! `apply_mapping` to regenerate `row_results` from them. All three steps used
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Backs `handlers/import.rs::api_get_session` — a plain state query, not a
|
||||
//! Backs `http-axum/src/api/import/sessions.rs::api_get_session` — a plain state query, not a
|
||||
//! redirect-driving gate (the API has nothing to redirect to; a missing
|
||||
//! session is just a 404).
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ pub mod event_handler;
|
||||
pub mod get_movie_profile;
|
||||
pub mod get_movies;
|
||||
pub mod merge_duplicates;
|
||||
pub mod poster_sync;
|
||||
pub mod poster_sync_handler;
|
||||
pub mod queries;
|
||||
pub mod reindex_search;
|
||||
pub mod request_enrichment;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! The federated half of the former `get_profile` (ADR-0004's closed wart).
|
||||
//! `build_federated_profile_response` (`handlers/users.rs`) calls this with a
|
||||
//! `build_federated_profile_response` (`http-axum/src/api/user_profile.rs`) calls this with a
|
||||
//! synthetic `user_id` that has no row in the local `users` table — a federated
|
||||
//! actor's identity is built entirely from the resolved `FederatedProfile`, so
|
||||
//! this type carries no `identity` field at all: the old `get_profile` computed
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
//! Backs page-chrome data: the nav bar's email/admin state and pending-follow
|
||||
//! badge. Absorbs `handlers/helpers.rs::build_page_context`'s inline user lookup
|
||||
//! badge. Absorbs `html/helpers.rs::build_page_context`'s inline user lookup
|
||||
//! and pending-follower count.
|
||||
//!
|
||||
//! **Error policy (deliberately no internal tolerance):** this function
|
||||
//! propagates every error from `user` and `follow_graph` with `?`. It does not
|
||||
//! itself decide to degrade — that's a presentation-layer policy
|
||||
//! itself decide to degrade — that's a http-adapter policy
|
||||
//! (`build_page_context` logs a warning and falls back to a zeroed `PageViewer`
|
||||
//! on `Err`). Page chrome degrading is a rendering decision, not a domain one.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Absorbs `handlers/users.rs::get_user_by_username`'s
|
||||
//! Absorbs `http-axum/src/html/users.rs::get_user_by_username`'s
|
||||
//! `repos.user.find_by_username()` call. `None` means "no such username" — the
|
||||
//! handler turns that into a 404, same as it always has; this is not an error
|
||||
//! condition.
|
||||
|
||||
@@ -184,15 +184,17 @@ async fn assemble(
|
||||
// ── Event handlers ────────────────────────────────────────────────────────
|
||||
|
||||
let handlers: Vec<Arc<dyn EventHandler>> = {
|
||||
let poster = Arc::new(application::movies::poster_sync::PosterSyncHandler::new(
|
||||
Arc::clone(&movie_command),
|
||||
Arc::clone(&movie_query),
|
||||
Arc::clone(&metadata),
|
||||
Arc::clone(&poster_fetcher),
|
||||
Arc::clone(&object_storage),
|
||||
Arc::clone(&event_publisher),
|
||||
3,
|
||||
)) as Arc<dyn EventHandler>;
|
||||
let poster = Arc::new(
|
||||
application::movies::poster_sync_handler::PosterSyncHandler::new(
|
||||
Arc::clone(&movie_command),
|
||||
Arc::clone(&movie_query),
|
||||
Arc::clone(&metadata),
|
||||
Arc::clone(&poster_fetcher),
|
||||
Arc::clone(&object_storage),
|
||||
Arc::clone(&event_publisher),
|
||||
3,
|
||||
),
|
||||
) as Arc<dyn EventHandler>;
|
||||
|
||||
let cleanup = Arc::new(object_storage::ImageCleanupHandler::new(Arc::clone(
|
||||
&object_storage,
|
||||
|
||||
Reference in New Issue
Block a user