diff --git a/crates/core/src/format/descriptor.rs b/crates/core/src/format/descriptor.rs index ef6170dd..c40edd74 100644 --- a/crates/core/src/format/descriptor.rs +++ b/crates/core/src/format/descriptor.rs @@ -53,6 +53,11 @@ pub fn check_one(descriptor: &Descriptor) -> Result<(), String> { "format {id:?}: only a package format keeps indexes" )); } + if descriptor.readme && descriptor.storage != Storage::Packages { + return Err(format!( + "format {id:?}: only a package format's manifests carry a README" + )); + } validate_options(descriptor).map_err(|e| format!("format {id:?}: {e}"))?; validate_assets(&descriptor.assets).map_err(|e| format!("format {id:?}: {e}")) } @@ -166,6 +171,7 @@ mod tests { options: &[], prereleases: forge_format_api::Prereleases::Dash, indexes: false, + readme: false, }; #[test] @@ -252,6 +258,17 @@ mod tests { ..GOOD }; assert!(check(&[&files_with_indexes]).is_err()); + let files_with_readme = Descriptor { + storage: Storage::Files, + readme: true, + ..GOOD + }; + assert!(check(&[&files_with_readme]).is_err()); + let with_readme = Descriptor { + readme: true, + ..GOOD + }; + assert_eq!(check(&[&with_readme]), Ok(())); } #[test] diff --git a/crates/core/src/format/mod.rs b/crates/core/src/format/mod.rs index acce0aa0..399456cd 100644 --- a/crates/core/src/format/mod.rs +++ b/crates/core/src/format/mod.rs @@ -194,6 +194,13 @@ pub trait Format: Send + Sync { false } + /// Whether the format's manifests carry a README ([`Self::readme`]). + /// The web UI's package page resolves the latest version's manifest + /// only when they do: on a proxy that read can ask the upstream. + fn has_readme(&self) -> bool { + false + } + /// The README a manifest carries, for the web UI's package page. fn readme(&self, manifest: &[u8]) -> Option { let _ = manifest; diff --git a/crates/core/src/format/spec.rs b/crates/core/src/format/spec.rs index d3418fb3..07cb5d0d 100644 --- a/crates/core/src/format/spec.rs +++ b/crates/core/src/format/spec.rs @@ -37,6 +37,7 @@ pub struct SpecFormat { assets: Assets, storage: Storage, upstream_token: UpstreamToken, + readme: bool, } impl SpecFormat { @@ -48,6 +49,7 @@ impl SpecFormat { assets: descriptor.assets, storage: descriptor.storage, upstream_token: descriptor.upstream_token, + readme: descriptor.readme, spec, } } @@ -340,6 +342,10 @@ impl Format for SpecFormat { self.upstream_token == UpstreamToken::Bearer } + fn has_readme(&self) -> bool { + self.readme + } + fn readme(&self, manifest: &[u8]) -> Option { self.spec.readme(manifest) } @@ -390,6 +396,7 @@ mod tests { options: &[], prereleases: forge_format_api::Prereleases::Dash, indexes: false, + readme: false, }; impl FormatSpec for Unlimited { diff --git a/crates/core/src/repo/group.rs b/crates/core/src/repo/group.rs index d8c4d287..b09e8934 100644 --- a/crates/core/src/repo/group.rs +++ b/crates/core/src/repo/group.rs @@ -216,7 +216,10 @@ pub trait MemberOpsFactory: Send + Sync { /// Identity-aware group read resolver. /// /// Constructed per request with the [`Principal`] in hand so visibility -/// filtering is baked into every method. Implements [`RepoReadOps`] keyed by the +/// filtering is baked into every method. It reads a group's memberships and +/// the principal's grants once, on its first read of the group, and answers +/// every later read from that graph: make a new resolver for each request, +/// since one kept longer sees no change to either. Implements [`RepoReadOps`] keyed by the /// **group** repository name; the per-member ops are keyed by each member's own /// name (resolved from the `group_member` join). pub struct GroupRepo { @@ -229,6 +232,11 @@ pub struct GroupRepo { max_depth: u32, /// Version precedence for merged results. `None` ⇒ string order (tests). format: Option>, + /// The graph of each group this resolver was asked about, by the + /// group's name, built on its first read ([`Self::group_graph`]) and + /// kept for the resolver's lifetime: a request's reads walk one graph + /// (#537). + graphs: tokio::sync::Mutex>>, } /// A visible member: its repository row (carrying its own `name`) and the ops to @@ -599,6 +607,7 @@ impl GroupRepo { authz, max_depth, format: None, + graphs: tokio::sync::Mutex::new(HashMap::new()), } } @@ -630,6 +639,21 @@ impl GroupRepo { Ok(row) } + /// The compact readable graph of `group` for this principal, built + /// ([`Self::build_group_graph`]) on the resolver's first read of the + /// group and shared by the later ones, with the per-id walks it + /// memoizes. Reads that come in together wait for the one build. A + /// failed build is not kept: the next read tries again. + async fn group_graph(&self, group: &str) -> Result, RepoError> { + let mut graphs = self.graphs.lock().await; + if let Some(graph) = graphs.get(group) { + return Ok(graph.clone()); + } + let graph = self.build_group_graph(group).await?; + graphs.insert(group.to_string(), graph.clone()); + Ok(graph) + } + /// Build the compact readable group graph for this principal. /// /// Two breadth-first passes over the membership DAG below `group`. Both @@ -646,7 +670,7 @@ impl GroupRepo { /// 2. **Visibility**: the same walk over the loaded adjacency lists, keeping /// only edges whose member the principal may read, each narrowed to /// the membership's scope. - async fn group_graph(&self, group: &str) -> Result, RepoError> { + async fn build_group_graph(&self, group: &str) -> Result, RepoError> { let group_row = self.group_row(group).await?; // Pass 1. A group past the depth bound is not expanded: no caller can diff --git a/crates/core/tests/group_read.rs b/crates/core/tests/group_read.rs index 22368ab3..6bf3390d 100644 --- a/crates/core/tests/group_read.rs +++ b/crates/core/tests/group_read.rs @@ -322,6 +322,74 @@ async fn highest_priority_member_serves_overlapping_version() { ); } +/// A resolver builds a group's graph once, on its first read, and answers +/// its later reads from it (#537): the package page's four reads +/// (`list_versions`, `registration`, `tags`, `resolve_nuspec`) load the +/// memberships and the caller's grants once, not once each. A member added +/// after the first read is therefore not in the graph of that resolver, +/// while the next request's resolver has it. +#[tokio::test] +async fn a_resolver_builds_its_graph_once() { + let pool = common::pool().await; + let mut blobs = StubBlobs::default(); + + let first = seed_member(&pool, false).await; + let later = seed_member(&pool, false).await; + let group = seed_group(&pool).await; + seed_version(&pool, &mut blobs, first.id, "Sample", "1.0.0", "f").await; + seed_version(&pool, &mut blobs, later.id, "Sample", "2.0.0", "l").await; + repository_dao::add_group_member(&pool, group.id, first.id, 100) + .await + .unwrap(); + + let principal = user(&pool).await; + let g = group_repo(&pool, blobs.clone(), principal.clone()); + let versions = |entries: Vec| -> Vec { + entries.into_iter().map(|v| v.version).collect() + }; + let listed = g.list_versions(&group.name, "sample").await.unwrap(); + assert_eq!(versions(listed), ["1.0.0"]); + + // A graph built again for a read would have this member. + repository_dao::add_group_member(&pool, group.id, later.id, 10) + .await + .unwrap(); + let listed = g.list_versions(&group.name, "sample").await.unwrap(); + assert_eq!(versions(listed), ["1.0.0"], "the listing built a graph"); + let registration = g.registration(&group.name, "sample").await.unwrap(); + assert_eq!( + registration + .iter() + .map(|e| e.version.as_str()) + .collect::>(), + ["1.0.0"], + "the registration built a graph" + ); + g.tags(&group.name, "sample").await.unwrap(); + assert!( + g.resolve_nuspec(&group.name, "sample", "2.0.0") + .await + .unwrap() + .is_none(), + "the manifest read built a graph" + ); + assert!(g + .resolve_nuspec(&group.name, "sample", "1.0.0") + .await + .unwrap() + .is_some()); + + // The next request's resolver reads the memberships as they are now. + let next = group_repo(&pool, blobs, principal); + let listed = next.list_versions(&group.name, "sample").await.unwrap(); + assert_eq!(versions(listed), ["1.0.0", "2.0.0"]); + assert!(next + .resolve_nuspec(&group.name, "sample", "2.0.0") + .await + .unwrap() + .is_some()); +} + #[tokio::test] async fn list_versions_is_union_across_members() { let pool = common::pool().await; @@ -3590,10 +3658,11 @@ async fn a_scoped_member_is_never_asked_about_other_ids() { scope(&pool, &group, &internal, &["Envisia.*"]).await; let internal_ops = PassThrough::new(&["Envisia.Lib", "Internal.Other"]); let public_ops = PassThrough::new(&["Newtonsoft.Json", "Serilog"]); + let principal = user(&pool).await; let g = pass_through_group_repo( &pool, StubBlobs::default(), - user(&pool).await, + principal.clone(), &[(&internal, &internal_ops), (&public, &public_ops)], ); @@ -3685,6 +3754,13 @@ async fn a_scoped_member_is_never_asked_about_other_ids() { // Without patterns the member is asked about every id again. scope(&pool, &group, &internal, &[]).await; + // The next request's resolver: one keeps the graph it built. + let g = pass_through_group_repo( + &pool, + StubBlobs::default(), + principal, + &[(&internal, &internal_ops), (&public, &public_ops)], + ); g.list_versions(&group.name, "Serilog").await.unwrap(); assert!(internal_ops.asked().contains(&"Serilog".to_string())); } @@ -3821,10 +3897,11 @@ async fn a_scope_on_a_nested_group_holds_for_every_member_below_it() { scope(&pool, &outer, &inner, &["Envisia.*"]).await; let internal_ops = PassThrough::new(&["Envisia.Lib", "Internal.Other"]); let public_ops = PassThrough::new(&["Newtonsoft.Json"]); + let principal = user(&pool).await; let g = pass_through_group_repo( &pool, StubBlobs::default(), - user(&pool).await, + principal.clone(), &[(&internal, &internal_ops), (&public, &public_ops)], ); @@ -3847,6 +3924,13 @@ async fn a_scope_on_a_nested_group_holds_for_every_member_below_it() { // A scope inside the nested group narrows further: an id must match // the scope of every membership on the way. scope(&pool, &inner, &internal, &["Envisia.Tools.*"]).await; + // The next request's resolver: one keeps the graph it built. + let g = pass_through_group_repo( + &pool, + StubBlobs::default(), + principal, + &[(&internal, &internal_ops), (&public, &public_ops)], + ); g.list_versions(&outer.name, "Envisia.Data").await.unwrap(); g.list_versions(&outer.name, "Envisia.Tools.Cli") .await @@ -3887,7 +3971,13 @@ async fn a_scope_never_widens_what_the_guards_allow() { scope(&pool, &group, &hosted, &["Envisia.*"]).await; scope(&pool, &group, &public, &["Envisia.*", "Sample", "Serilog"]).await; let public_ops = PassThrough::new(&["Envisia.Fake", "Sample", "Serilog"]); - let g = pass_through_group_repo(&pool, blobs, user(&pool).await, &[(&public, &public_ops)]); + let principal = user(&pool).await; + let g = pass_through_group_repo( + &pool, + blobs.clone(), + principal.clone(), + &[(&public, &public_ops)], + ); // The ids as NuGet clients ask for them: lowercase. // A reserved id: served by the owner alone, the proxy is not asked @@ -3922,5 +4012,7 @@ async fn a_scope_never_widens_what_the_guards_allow() { // With the owner's scope gone, it serves its id again. scope(&pool, &group, &hosted, &[]).await; + // The next request's resolver: one keeps the graph it built. + let g = pass_through_group_repo(&pool, blobs, principal, &[(&public, &public_ops)]); assert_eq!(sorted_versions(&g, &group.name, "sample").await, ["2.0.0"]); } diff --git a/crates/core/tests/proxy_read.rs b/crates/core/tests/proxy_read.rs index 10ba451e..ec557ad7 100644 --- a/crates/core/tests/proxy_read.rs +++ b/crates/core/tests/proxy_read.rs @@ -2993,24 +2993,29 @@ async fn group_search_asks_upstreams_for_the_page_window() { forge_db::authz_dao::assign_role(&pool, user.id, role) .await .unwrap(); - let group_ops = GroupRepo::new( - pool.clone(), - Principal::User { - user_id: user.id, - token_id: None, - method: forge_core::auth::AuthMethod::Password, - }, - Arc::new(ProxySearchFactory(Arc::new(proxy_repo( - &pool, - cas, - Cache::l1_only(128), - )))), - authz, - 20, - ) - .with_format(Arc::new(nuget())); + let principal = Principal::User { + user_id: user.id, + token_id: None, + method: forge_core::auth::AuthMethod::Password, + }; + let factory: Arc = Arc::new(ProxySearchFactory( + Arc::new(proxy_repo(&pool, cas, Cache::l1_only(128))), + )); + // A resolver per request, as the server makes one: it keeps the group's + // graph, so one made earlier does not see a later change to the group. + let new_group_ops = || { + GroupRepo::new( + pool.clone(), + principal.clone(), + factory.clone(), + authz.clone(), + 20, + ) + .with_format(Arc::new(nuget())) + }; + let group_ops = new_group_ops(); let search = |q: &str, skip: usize, take: usize| { - let (group_ops, group) = (&group_ops, &group); + let (group_ops, group) = (new_group_ops(), &group); let params = SearchParams { q: q.into(), skip, diff --git a/crates/format-api/src/lib.rs b/crates/format-api/src/lib.rs index efb312ed..1d3a25ea 100644 --- a/crates/format-api/src/lib.rs +++ b/crates/format-api/src/lib.rs @@ -156,6 +156,7 @@ pub trait FormatSpec: Send + Sync + 'static { } /// The README a manifest carries, shown on the web UI's package page. + /// Asked only of a format whose descriptor says [`Descriptor::readme`]. /// `None` by default. fn readme(&self, manifest: &[u8]) -> Option { let _ = manifest; diff --git a/crates/format-api/src/types.rs b/crates/format-api/src/types.rs index 424dab3c..e19bfabf 100644 --- a/crates/format-api/src/types.rs +++ b/crates/format-api/src/types.rs @@ -128,6 +128,7 @@ impl RepositoryKind { /// options: &[], /// prereleases: Prereleases::Dash, /// indexes: false, +/// readme: false, /// }; /// ``` /// @@ -167,6 +168,14 @@ pub struct Descriptor { /// /// [`FormatSpec::index`]: crate::FormatSpec::index pub indexes: bool, + /// The format's manifests carry a README ([`FormatSpec::readme`], npm): + /// the web UI's package page reads the latest version's manifest for + /// it. Without it the page reads no manifest, which on a proxy can be a + /// request to the upstream, and `readme` is never asked. A package + /// format only. + /// + /// [`FormatSpec::readme`]: crate::FormatSpec::readme + pub readme: bool, } /// Which versions of a format are prereleases ([`Descriptor::prereleases`]). diff --git a/crates/formats/apt/src/lib.rs b/crates/formats/apt/src/lib.rs index 55ba4337..dbf4829e 100644 --- a/crates/formats/apt/src/lib.rs +++ b/crates/formats/apt/src/lib.rs @@ -73,6 +73,7 @@ pub const DESCRIPTOR: Descriptor = Descriptor { // A `-` starts the Debian revision (`1.0-1`), it marks no prerelease. prereleases: Prereleases::None, indexes: true, + readme: false, }; /// The apt format. diff --git a/crates/formats/docker/src/lib.rs b/crates/formats/docker/src/lib.rs index ab1d1837..9c43701f 100644 --- a/crates/formats/docker/src/lib.rs +++ b/crates/formats/docker/src/lib.rs @@ -62,6 +62,7 @@ pub const DESCRIPTOR: Descriptor = Descriptor { options: &[], prereleases: forge_format_api::Prereleases::Dash, indexes: false, + readme: false, }; /// The Docker / OCI format. diff --git a/crates/formats/npm/src/lib.rs b/crates/formats/npm/src/lib.rs index 610ea264..1f0a7bdd 100644 --- a/crates/formats/npm/src/lib.rs +++ b/crates/formats/npm/src/lib.rs @@ -84,6 +84,7 @@ pub const DESCRIPTOR: Descriptor = Descriptor { }], prereleases: forge_format_api::Prereleases::Dash, indexes: false, + readme: true, }; /// What the format reads of a request, beyond the package the repository's diff --git a/crates/formats/nuget/src/lib.rs b/crates/formats/nuget/src/lib.rs index 6badf4bf..ddeaf4a4 100644 --- a/crates/formats/nuget/src/lib.rs +++ b/crates/formats/nuget/src/lib.rs @@ -59,6 +59,7 @@ pub const DESCRIPTOR: Descriptor = Descriptor { options: &[], prereleases: forge_format_api::Prereleases::Dash, indexes: false, + readme: false, }; /// The NuGet format, with the zip-bomb limits applied while parsing packages. diff --git a/crates/formats/raw/src/lib.rs b/crates/formats/raw/src/lib.rs index 1c1382e9..63fb3c60 100644 --- a/crates/formats/raw/src/lib.rs +++ b/crates/formats/raw/src/lib.rs @@ -55,6 +55,7 @@ pub const DESCRIPTOR: Descriptor = Descriptor { options: &[], prereleases: forge_format_api::Prereleases::Dash, indexes: false, + readme: false, }; /// The raw format. diff --git a/crates/server/src/browse.rs b/crates/server/src/browse.rs index 3bb4dcf4..c6d94d58 100644 --- a/crates/server/src/browse.rs +++ b/crates/server/src/browse.rs @@ -756,7 +756,10 @@ async fn cached_detail( }) .filter(|d| !d.trim().is_empty()) }); - let readme = match latest { + // The manifest is read for its README alone, so only for a format that + // has one (#537): a read of it is a blob read, and on a proxy the + // upstream's listing again. + let readme = match latest.filter(|_| format.has_readme()) { Some(entry) => match ops.resolve_nuspec(&repo.name, lower, &entry.version).await { Ok(Some(manifest)) => { let format = format.clone(); @@ -815,7 +818,8 @@ fn latest_entry<'a>( /// Ask `repo`'s upstream (a group's: its serving members') for package /// `lower`, through the read path a client's request takes, and keep what it /// answers for the package page: the version listing, the versions' -/// metadata, the tags and the latest version's manifest (npm's README). What +/// metadata, the tags and, for a format that reads a README from it +/// ([`Format::has_readme`], npm), the latest version's manifest. What /// is still within the metadata TTL is served from the cache, not asked /// again, as for a client. Only the listing's failure is one: the rest is /// best effort, as on the page. @@ -839,7 +843,12 @@ async fn refresh_from_upstream( tracing::warn!(repo = %repo.name, id = %lower, error = %e, "browse: refreshing the tags failed"); Default::default() }); - if let Some(latest) = latest_entry(format.as_ref(), &tags, ®istration) { + // The page reads the manifest for its README alone: a format without + // one (NuGet) asks its upstream for none, which could come to downloading + // the package (#537). + let latest = + latest_entry(format.as_ref(), &tags, ®istration).filter(|_| format.has_readme()); + if let Some(latest) = latest { if let Err(e) = ops.resolve_nuspec(&repo.name, lower, &latest.version).await { tracing::warn!(repo = %repo.name, id = %lower, error = %e, "browse: refreshing the latest manifest failed"); } diff --git a/crates/server/tests/browse.rs b/crates/server/tests/browse.rs index 8b0d6679..865dfa11 100644 --- a/crates/server/tests/browse.rs +++ b/crates/server/tests/browse.rs @@ -967,6 +967,17 @@ impl Upstream { } } + /// The requests for a file of package `lower` whose name ends in + /// `suffix` (`.nuspec`, `.nupkg`). + fn file_requests_for(&self, lower: &str, suffix: &str) -> usize { + self.requests + .lock() + .unwrap() + .iter() + .filter(|path| path.contains(&format!("/{lower}/")) && path.ends_with(suffix)) + .count() + } + /// The requests that named package `lower`. fn requests_for(&self, lower: &str) -> usize { self.requests @@ -1328,6 +1339,59 @@ async fn refresh_from_upstream_needs_only_read_access() { assert_eq!(resp.status(), 404); } +/// NuGet's page shows no README, so neither the page nor a refresh reads +/// the latest version's manifest (#537): on a proxy, and on a group over +/// one, that read asked the upstream for the `.nuspec` of a version nobody +/// had downloaded, and for the whole package where the upstream serves no +/// manifest. The refresh still asks for the listing and the registration, +/// which the page shows. +#[tokio::test] +async fn a_nuget_package_page_reads_no_manifest_for_a_readme() { + let srv = common::start().await; + let upstream = Upstream::start(&[("Plain.Lib", "1.0.0"), ("Plain.Lib", "2.0.0")]).await; + let proxy = format!("nordp{}", common::unique()); + create_proxy(&srv, &proxy, &upstream).await; + let group = format!("nordg{}", common::unique()); + let (u, p) = srv.admin_basic(); + let resp = srv + .client() + .post(format!("{}/admin/repositories", srv.base_url)) + .basic_auth(&u, Some(&p)) + .json(&json!({"name": group, "kind": "group"})) + .send() + .await + .unwrap(); + assert_eq!(resp.status(), 201, "create group"); + let resp = srv + .client() + .post(format!( + "{}/admin/repositories/{group}/members", + srv.base_url + )) + .basic_auth(&u, Some(&p)) + .json(&json!({"member": proxy, "priority": 10})) + .send() + .await + .unwrap(); + assert!(resp.status().is_success(), "add member: {}", resp.status()); + + for repo in [&proxy, &group] { + let page = format!("/browse/packages/{repo}/plain.lib"); + let (status, detail) = + admin_send(&srv, reqwest::Method::POST, &format!("{page}/refresh")).await; + assert_eq!(status, 200, "{detail}"); + assert_eq!(versions_of(&detail), ["1.0.0", "2.0.0"], "{detail}"); + assert_eq!(dependencies_of(&detail, "2.0.0"), ["Dep.Lib"], "{detail}"); + assert!(detail.get("readme").is_none(), "{detail}"); + let (status, detail) = admin_send(&srv, reqwest::Method::GET, &page).await; + assert_eq!(status, 200, "{detail}"); + assert!(detail.get("readme").is_none(), "{detail}"); + } + assert!(upstream.requests_for("plain.lib") > 0, "the listing"); + assert_eq!(upstream.file_requests_for("plain.lib", ".nuspec"), 0); + assert_eq!(upstream.file_requests_for("plain.lib", ".nupkg"), 0); +} + /// A group's package page reads its proxy member from the cache too (#836): /// a package the proxy holds nothing of is not found through the group and /// is not asked for, the age of the page is the member's listing, a stale diff --git a/crates/server/tests/format_contract.rs b/crates/server/tests/format_contract.rs index 6a8a7e93..85b78cd2 100644 --- a/crates/server/tests/format_contract.rs +++ b/crates/server/tests/format_contract.rs @@ -35,6 +35,7 @@ const PROBE: Descriptor = Descriptor { options: &[], prereleases: forge_format_api::Prereleases::Dash, indexes: false, + readme: false, }; /// A package is text whose first line is ` `. diff --git a/docs/changes/2.2.0/537.fixed.md b/docs/changes/2.2.0/537.fixed.md new file mode 100644 index 00000000..2ca4fd53 --- /dev/null +++ b/docs/changes/2.2.0/537.fixed.md @@ -0,0 +1,10 @@ +The web UI's package page looked for a README in the latest version's +manifest for every format, although only npm's manifests carry one. For a +NuGet package each page view read the stored manifest for nothing, and a +refresh of a proxy's package from its upstream (off the request once the +listing is stale, or with **Refresh from upstream**) asked the upstream for +the `.nuspec` of a version nobody had downloaded, or downloaded the whole +package where the upstream serves no manifest. The manifest is now read +only for a format that shows a README. A group also loaded its memberships +and the caller's grants again for each of the page's reads; a request now +loads them once. diff --git a/docs/format-plugins.md b/docs/format-plugins.md index deb9d5b8..49f7c32c 100644 --- a/docs/format-plugins.md +++ b/docs/format-plugins.md @@ -196,9 +196,10 @@ returns with the version. `render` gets it back as `summary`, so a listing never re-reads manifests (for a version stored before summaries were, the host asks `manifest_summary` of its stored manifest). The web UI's package detail reads three keys from it, if present: `description`, `deprecated` (a proxy's upstream deprecation), -and `dependency_groups` (the same shape as NuGet's). It shows the latest -version's README, which the format's `readme` reads from the stored -manifest, and the package's tags. +and `dependency_groups` (the same shape as NuGet's). It shows the +package's tags and, for a format whose descriptor says `readme: true`, the +latest version's README, which the format's `readme` reads from the stored +manifest. For any other format the page reads no manifest. Every listing hands each version's summary to the format, so a summary should stay small. @@ -693,6 +694,9 @@ pub const DESCRIPTOR: Descriptor = Descriptor { // Whether the host keeps signed indexes of its hosted repositories // (Signed indexes). indexes: false, + // Whether its manifests carry a README (`readme`), which the web UI's + // package page then reads from the latest version's manifest (npm). + readme: false, }; #[derive(Default)]