diff --git a/crates/engine/src/cmd/items.rs b/crates/engine/src/cmd/items.rs index 45ce47278f..b8d183a333 100644 --- a/crates/engine/src/cmd/items.rs +++ b/crates/engine/src/cmd/items.rs @@ -846,6 +846,8 @@ fn package_project(s: &mut Session, notes: &mut rustgis_data::loss::Notes) -> Re } // Offline areas are maps too, and their copies keep a streamed layer's source and the tiles. let linked = left_linked("Package Project", p.maps.iter().chain(p.offline_areas.iter().map(|a| &a.data))); + // What documents read from the internet named stays held there when the package is read. + p.mark_internet_only().say(s); let name = p.name.clone(); let readme = format!("{} — a RustGIS project package.\nOpen it with RustGIS (Project › Open), or unzip it for {}.rgis.\n", name, name); // The package as unzipped, the README with it, within what a zip and a project may hold. @@ -924,9 +926,11 @@ fn package_map(s: &mut Session, mobile: bool, tol: f64, linked: &mut rustgis_dat crate::project::ensure_map_imports_complete(&m)?; // After mobile_map: a hidden layer it drops isn't in the package. linked.extend(left_linked("Package Map", [&m])); + let held = crate::project::mark_internet_only(&mut m); let name = m.name.clone(); // With the map file's header, so an older reader refuses what it can't draw. - let (bytes, report) = crate::durable::output_owned(m, crate::project::map_file_bytes)?; + let (bytes, mut report) = crate::durable::output_owned(m, crate::project::map_file_bytes)?; + held.report(&mut report); crate::durable::notify(s, &report); let kind = if mobile { "mobile map package" } else { "map package" }; let readme = format!("{} — a RustGIS {kind}.\nAdd it to a project with Data › Import.\n", name); @@ -1829,7 +1833,9 @@ pub fn item_output(s: &mut Session, kind: &str, p: &Value) -> Result<(String, Ve "map" => { let map = saved_map(s, p)?; crate::project::ensure_map_imports_complete(map)?; - let map = embedded_map(map, &mut MAX_EMBED.clone()); + let mut map = embedded_map(map, &mut MAX_EMBED.clone()); + // What documents read from the internet named stays held there when the file is read. + crate::project::mark_internet_only(&mut map).say(s); let name = map.name.clone(); (name, durable_bytes_with(s, map, crate::project::map_file_bytes)?) } @@ -1839,7 +1845,8 @@ pub fn item_output(s: &mut Session, kind: &str, p: &Value) -> Result<(String, Ve if l.dataset.source.as_deref().is_some_and(|source| source.starts_with("geolibre-pending:")) { return Err("this layer is still downloading; wait for it to finish before saving".into()); } - let layer = embed_layer(l, &mut MAX_EMBED.clone()); + let mut layer = embed_layer(l, &mut MAX_EMBED.clone()); + crate::project::mark_layer_internet_only(&mut layer).say(s); let name = layer.name.clone(); (name, durable_bytes_with(s, layer, crate::project::layer_file_bytes)?) } @@ -1861,6 +1868,8 @@ pub fn item_output(s: &mut Session, kind: &str, p: &Value) -> Result<(String, Ve if let Some(n) = ps(p, "name").map(str::trim).filter(|n| !n.is_empty()) { t.name = super::within("name", "a template's name", n, 200)?; } + // What documents read from the internet named stays held there when it is used. + t.mark_internet_only().say(s); let name = t.name.clone(); let bytes = durable_bytes(s, t)?; if source_references > 0 { diff --git a/crates/engine/src/cmd/layer.rs b/crates/engine/src/cmd/layer.rs index e22a5d774d..d1f7fbf2e8 100644 --- a/crates/engine/src/cmd/layer.rs +++ b/crates/engine/src/cmd/layer.rs @@ -4568,6 +4568,15 @@ pub(crate) fn add_layer_text(s: &mut Session, text: &str) -> CmdResult { // A binding in a file is no authority to use a login here. crate::s3_connections::clear_bindings(layer.addresses_mut()); crate::project::clear_login_bindings(layer.addresses_mut()); + // A layer whose addresses a document read from the internet named is held there again before + // it is read (the repair below reads it). + if layer.internet_only { + let full = crate::render::rustgis_tiles::cache::public_restrictions_full(); + crate::project::apply_layer_internet_only(&layer); + if !full && crate::render::rustgis_tiles::cache::public_restrictions_full() { + s.notify(crate::project::held_full_notice(&format!("the layer '{}'", layer.name)), false); + } + } // A fresh id and a unique name in this map; the rest goes through project repair. let base = layer.name.clone(); let mut i = 1; diff --git a/crates/engine/src/cmd/tiles.rs b/crates/engine/src/cmd/tiles.rs index 1689e8ad16..c95c425d56 100644 --- a/crates/engine/src/cmd/tiles.rs +++ b/crates/engine/src/cmd/tiles.rs @@ -760,6 +760,8 @@ pub(crate) fn cog_tiles_to_rasters(m: &mut rustgis_map::Map) { // anonymous plugin command added takes no saved login, as before. l.connection = t.connection.clone(); l.anonymous = t.anonymous; + // Held to the internet, as the tile layer was. + l.internet_only = t.internet_only; } // Just over the layer it was drawn over, in its group; under them all without one. let group = t.over.and_then(|o| m.group_of(o).map(|g| g.id)); diff --git a/crates/engine/src/cmd/workspace.rs b/crates/engine/src/cmd/workspace.rs index 14cb15e4c4..06cc6297fc 100644 --- a/crates/engine/src/cmd/workspace.rs +++ b/crates/engine/src/cmd/workspace.rs @@ -386,6 +386,12 @@ pub fn commands() -> Vec { s.project.active_map = i; } else { let mut m = a.data.clone(); + // Its layers that documents read from the internet named are held there again + // before anything of the map is read. + let full = crate::render::rustgis_tiles::cache::public_restrictions_full(); + crate::project::apply_internet_only(&m); + let filled = !full && crate::render::rustgis_tiles::cache::public_restrictions_full(); + let area_name = a.name.clone(); let map_name = offline_map_name(&a.name); let taken = |n: &str| s.project.maps.iter().any(|m| m.name.eq_ignore_ascii_case(n)); m.name = if taken(&map_name) { super::numbered(&map_name, taken) } else { map_name.clone() }; @@ -407,6 +413,9 @@ pub fn commands() -> Vec { } s.project.maps.push(m); s.project.active_map = s.project.maps.len() - 1; + if filled { + s.notify(crate::project::held_full_notice(&format!("the offline map '{area_name}'")), false); + } } s.active_layer = s.map().layers.first().map(|l| l.id); s.zoom_to(&extent); diff --git a/crates/engine/src/durable.rs b/crates/engine/src/durable.rs index d9f4e4d606..65737b5171 100644 --- a/crates/engine/src/durable.rs +++ b/crates/engine/src/durable.rs @@ -27,6 +27,12 @@ pub struct Report { pub(crate) numbers: u32, /// First affected dataset names; the total count still covers every dataset. pub(crate) number_places: Vec, + /// Layers held to the internet only because the session's record of such addresses is full, + /// written without the hold ([`crate::project::HELD_UNMARKED`]). + pub(crate) held_unmarked: u32, + /// Layers written held to the internet as a whole though the user named some of their + /// addresses ([`crate::project::NAMED_HELD`]). + pub(crate) named_held: u32, } impl Report { @@ -72,6 +78,8 @@ impl Report { (self.not_retained, "address(es) exceeded the bridge retention limit; their keys will not survive a round trip"), (self.lost, "address(es) lost their keys when a peer sent back its project; add them again in the receiving session"), (self.reconnect, "database source(s) from a peer require an explicit reconnect before reading"), + (self.held_unmarked, crate::project::HELD_UNMARKED), + (self.named_held, crate::project::NAMED_HELD), ( self.executable_changes, "credential-bearing executable field(s) changed when a peer sent back its project; supply missing values before replay", @@ -119,6 +127,8 @@ impl Report { self.executable_changes = self.executable_changes.saturating_add(other.executable_changes); self.reconnect = self.reconnect.saturating_add(other.reconnect); self.numbers = self.numbers.saturating_add(other.numbers); + self.held_unmarked = self.held_unmarked.saturating_add(other.held_unmarked); + self.named_held = self.named_held.saturating_add(other.named_held); for place in &other.number_places { if self.number_places.len() < 3 && !self.number_places.contains(place) { self.number_places.push(place.clone()); diff --git a/crates/engine/src/project.rs b/crates/engine/src/project.rs index 43c54b04eb..f2b03dd24b 100644 --- a/crates/engine/src/project.rs +++ b/crates/engine/src/project.rs @@ -69,6 +69,9 @@ pub const FORMAT: u32 = 2; /// so what a later RustGIS adds to format 2, and an older one would lose, is listed there and /// refused by name instead. pub const READ_FORMAT: u32 = 2; +/// Layers held to the internet (`internetOnly` on a tile layer, `internet_only` on a map layer): an +/// older reader would save the project again without the hold, so it refuses the project by name. +pub const INTERNET_ONLY: &str = "internet-only"; /// The saved additions this RustGIS understands. Writers require only capabilities used by /// their payload, so a format-2 reader without them refuses instead of discarding their fields. pub const CAPABILITIES: &[&str] = &[ @@ -112,6 +115,7 @@ pub const CAPABILITIES: &[&str] = &[ "label-guide", PROJECT_CRS, "dggs-system", + INTERNET_ONLY, ]; /// An offline area keeping the versions that lost a sync or a Bring Back /// (`OfflineArea::conflicts`, #2468): an older reader would save it again without them. @@ -1735,6 +1739,17 @@ impl Project { } done.tiles_over_limit.add(m.tiles.len().saturating_sub(rustgis_map::tiles::MAX_TILE_LAYERS), &m.name); m.tiles.truncate(rustgis_map::tiles::MAX_TILE_LAYERS); + // Layers whose addresses a document read from the internet named are held there again, + // before anything below is read (a raster in place, a streamed source); only the tile + // layers kept, and only as they are read from a file: a later repair (another layer + // added) leaves an address the user has named since as theirs. + if opened { + let full = crate::render::rustgis_tiles::cache::public_restrictions_full(); + apply_internet_only(m); + if !full && crate::render::rustgis_tiles::cache::public_restrictions_full() { + done.held_full.add(1, &m.name); + } + } #[cfg(not(target_arch = "wasm32"))] for t in &mut m.tiles { if t.error.is_none() @@ -1855,13 +1870,24 @@ impl Project { } } + /// Marks every map's layers held to the internet ([`mark_internet_only`]), before writing; + /// returns what that leaves to say. + pub(crate) fn mark_internet_only(&mut self) -> Marked { + let maps = self.maps.iter_mut().chain(self.offline_areas.iter_mut().map(|a| &mut a.data)); + maps.map(mark_internet_only).fold(Marked::default(), Marked::add) + } + /// Writes controlled durable fields and relative paths in one guarded transaction. Live /// fields are restored on every return and native unwind; only explicit saves are remembered. + /// The layers' internet-only marks are the session's own and stay as written + /// ([`mark_internet_only`]). pub fn saved_text(&mut self, dir: Option<&Path>) -> Result<(String, crate::durable::Report), String> { self.ensure_imports_complete()?; + let held = self.mark_internet_only(); let unrecorded = self.bound_address_losses(false); let (text, mut report) = crate::durable::output_remembered(self, dir.and_then(Path::to_str), project_text)?; report.addresses = report.addresses.saturating_add(u32::try_from(unrecorded).unwrap_or(u32::MAX)); + held.report(&mut report); Ok((text, report)) } @@ -1881,6 +1907,7 @@ impl Project { /// Text too large to open again is refused. Returns the text and its counted output notices. pub fn recovery_text_with_report(mut self) -> Result<(String, crate::durable::Report), String> { self.omit_pending_imports(); + let held = self.mark_internet_only(); let unrecorded = self.bound_address_losses(false); // Refused as a recovery copy, not as a save, and never built past the limit. let (text, mut report) = crate::durable::output_owned(self, |p| { @@ -1888,6 +1915,7 @@ impl Project { json_within(p, max)?.ok_or_else(|| format!("the project is too large to keep a recovery copy (maximum {})", limit_said(max))) })?; report.addresses = report.addresses.saturating_add(u32::try_from(unrecorded).unwrap_or(u32::MAX)); + held.report(&mut report); Ok((text, report)) } @@ -2501,6 +2529,8 @@ struct Repaired { tile_settings: Tally, tiles_removed: Tally, tiles_over_limit: Tally, + /// Holding a map's layers to the internet filled the record of held addresses. + held_full: Tally, values_cut: Tally, } @@ -2654,6 +2684,8 @@ impl Repaired { vec![("limit", rustgis_map::tiles::MAX_TILE_LAYERS.to_string().into())], ), ); + let t = &self.held_full; + say(ReadPart::Maps, t, message(HELD_FULL, t, vec![])); let t = &self.values_cut; say( ReadPart::Maps, @@ -2941,6 +2973,153 @@ impl Durable for ModelGraph { } } +/// What is said when holding `place`'s layers to the internet fills the record of held addresses, +/// outside a file's read (an offline area opened, a layer file added). +pub(crate) fn held_full_notice(place: &str) -> String { + format!( + "holding {place} to the internet filled the record of addresses held there: until RustGIS is restarted, every address is held to the internet, and services on this computer or the local network can't be reached" + ) +} + +/// What is said when holding layers to the internet fills the record of held addresses: from then +/// on every address is held there. +pub(crate) const HELD_FULL: &str = "holding the layers whose addresses came from documents read from the internet filled the record of such addresses {when} (in {places}): until RustGIS is restarted, every address is held to the internet, and services on this computer or the local network can't be reached"; + +/// What is said when layers held to the internet as a whole are written though the user named some +/// of their addresses, after their count. +pub(crate) const NAMED_HELD: &str = "layer(s) were written held to the internet as a whole, though you named some of their addresses yourself: opened again, those addresses are held there too; add them again to reach them on this computer or the local network"; + +/// What marking layers before they are written leaves to say ([`mark_internet_only`]). +#[derive(Clone, Copy, Debug, Default)] +pub(crate) struct Marked { + /// Held to the internet only by a full record, written unmarked ([`HELD_UNMARKED`]). + unmarked: usize, + /// Written marked though the user named some of their addresses ([`NAMED_HELD`]). + named: usize, +} + +impl Marked { + fn add(self, other: Marked) -> Marked { + Marked { unmarked: self.unmarked.saturating_add(other.unmarked), named: self.named.saturating_add(other.named) } + } + + /// Counts it in the output's report, which says it. + pub(crate) fn report(self, report: &mut crate::durable::Report) { + report.held_unmarked = u32::try_from(self.unmarked).unwrap_or(u32::MAX); + report.named_held = u32::try_from(self.named).unwrap_or(u32::MAX); + } + + /// Says it, one notice for each kind. + pub(crate) fn say(self, s: &mut crate::Session) { + for (n, text) in [(self.unmarked, HELD_UNMARKED), (self.named, NAMED_HELD)] { + if n > 0 { + s.notify(format!("{n} {text}"), false); + } + } + } +} + +/// What is said when layers held to the internet only by a full record are written without the +/// hold, after their count. +pub(crate) const HELD_UNMARKED: &str = "layer(s) held to the internet only because this session's record of such addresses is full were written without the hold: opened again, their addresses are read as your own"; + +/// Marks, before a map is written, each layer whose addresses this session recorded as named by a +/// document read from the internet ([`cache::recorded_public`]), so the restriction is saved with +/// it (`internetOnly`) and [`apply_internet_only`] puts it back when the map is read again. A layer +/// marked already (read marked from a file, or saved marked before) keeps the mark, though the +/// record had no room for its addresses, until the user names one of them themselves +/// ([`cache::named_by_user`]), which clears it. A layer is held or not as a whole, since its +/// addresses come from one document (a tile layer's template, legends and dated steps from its +/// capabilities or tile set; a map layer's sources from the one add): it is marked while any of +/// them is recorded, so a legend a document named stays held though the user has named the +/// template since, and the rest narrow with it: that is said ([`NAMED_HELD`]), since the addresses +/// the user named are held to the internet again when the map is read. +/// +/// Returns, for the caller to say, how many layers are held to the internet now only because the +/// record is full (added after it filled, so nothing recorded them) and are written unmarked, and +/// how many are written marked though the user named some of their addresses. +/// +/// [`cache::recorded_public`]: crate::render::rustgis_tiles::cache::recorded_public +/// [`cache::named_by_user`]: crate::render::rustgis_tiles::cache::named_by_user +pub(crate) fn mark_internet_only(map: &mut Map) -> Marked { + use crate::render::rustgis_tiles::cache; + let web = |a: &&str| rustgis_map::tiles::is_web(a); + let mut marked = Marked::default(); + for tile in &mut map.tiles { + let named = tile.addresses().filter(web).any(cache::named_by_user); + tile.internet_only = tile.addresses().any(cache::recorded_public) || (tile.internet_only && !named); + marked = marked.add(Marked { + unmarked: usize::from(held_by_full_record(tile.internet_only, tile.addresses().filter(web))), + named: usize::from(tile.internet_only && named), + }); + } + for layer in &mut map.layers { + marked = marked.add(mark_layer_internet_only(layer)); + } + marked +} + +/// [`mark_internet_only`] for one layer. +pub(crate) fn mark_layer_internet_only(layer: &mut rustgis_map::Layer) -> Marked { + use crate::render::rustgis_tiles::cache; + let named = layer_web_addresses(layer).any(cache::named_by_user); + layer.internet_only = layer_recorded(layer) || (layer.internet_only && !named); + Marked { + unmarked: usize::from(held_by_full_record(layer.internet_only, layer_web_addresses(layer))), + named: usize::from(layer.internet_only && named), + } +} + +/// Whether an unmarked layer with these web addresses is held to the internet now only because the +/// session's record of such addresses is full. +fn held_by_full_record<'a>(marked: bool, mut addresses: impl Iterator) -> bool { + use crate::render::rustgis_tiles::{address::Reach, cache}; + !marked && cache::public_restrictions_full() && addresses.any(|a| cache::ceiling_for(a) == Reach::Public) +} + +/// Whether any address a layer's source is read again from is recorded as named by a document read +/// from the internet. +fn layer_recorded(layer: &rustgis_map::Layer) -> bool { + layer_web_addresses(layer).any(crate::render::rustgis_tiles::cache::recorded_public) +} + +/// The web addresses a layer's source is read again from (local paths left out). +fn layer_web_addresses(layer: &rustgis_map::Layer) -> impl Iterator { + layer.output_slots().into_iter().filter(|(_, v, _, local)| !local && rustgis_map::tiles::is_web(v)).map(|(_, v, _, _)| v) +} + +/// Holds the addresses of every layer of `map` marked `internetOnly` to the internet +/// ([`cache::restrict_to_public`]), as when they were added: a project or map file read again keeps +/// what its documents named on the internet, however their names resolve now. The mark comes from +/// the file, which is untrusted input, and can only narrow what a layer reaches; a layer without +/// it is read as before. Per layer it records its template, dated steps and legends (a tile layer: +/// at most 1 + [`MAX_TIME_URLS`](rustgis_map::tiles::MAX_TIME_URLS) + 16), or its source addresses +/// and a Shapefile's parts (a map layer: at most 3 + 4). +/// +/// [`cache::restrict_to_public`]: crate::render::rustgis_tiles::cache::restrict_to_public +pub(crate) fn apply_internet_only(map: &Map) { + use crate::render::rustgis_tiles::cache; + for tile in map.tiles.iter().filter(|t| t.internet_only) { + for address in tile.addresses().filter(|a| rustgis_map::tiles::is_web(a)) { + cache::restrict_to_public(address); + } + } + for layer in map.layers.iter().filter(|l| l.internet_only) { + apply_layer_internet_only(layer); + } +} + +/// [`apply_internet_only`] for one marked layer (a layer file's, before it is added). +pub(crate) fn apply_layer_internet_only(layer: &rustgis_map::Layer) { + use crate::render::rustgis_tiles::cache; + for address in layer_web_addresses(layer) { + cache::restrict_to_public(address); + for (_, part) in rustgis_data::io::shapefile_part_urls(address).unwrap_or_default() { + cache::restrict_to_public(&part); + } + } +} + /// Enforces the opening bound inside the formatter, before any destination is replaced. fn project_text(p: &Project) -> Result { let max = max_bytes(); @@ -2972,6 +3151,270 @@ mod requires_tests { } } +#[cfg(all(test, not(target_arch = "wasm32")))] +mod internet_only_tests { + use crate::render::rustgis_tiles::{address::Reach, cache}; + use crate::{Project, Session}; + use serde_json::json; + + /// The session's record of these addresses as a new process has it, as far as their reach goes + /// (`Local`: they are recorded as named by the user, which a hold replaces). + /// ([`cache::clear_public_restrictions`] would clear other tests' records too.) + fn forget(addresses: &[&str]) { + for a in addresses { + cache::allow_named(a); + } + } + + /// A layer added from a document read from the internet keeps that after the project is saved + /// and opened again in a new session: its tiles, legend, style and features are fetched only + /// from the internet. The same project without the mark (one an older RustGIS saved) opens as + /// before, and a mark can't widen what an address already reaches. + #[test] + fn what_documents_from_the_internet_named_stays_there_when_the_project_is_opened_again() { + let host = "saved-reach.example"; + let wms = format!("https://{host}/wms"); + let legend = format!("https://{host}/legend.png"); + let style = format!("https://{host}/styles/roads.json"); + let features = format!("https://{host}/collections/roads/items.fgb"); + // The capabilities were read from the internet (the app's record of them). + cache::restrict_to_public(&rustgis_data::ogc::capabilities_url(&wms, Some("wms"))); + let caps = format!( + r#" +Test WMS +image/png +RootEPSG:3857roadsRoads + +"# + ); + let mut s = Session::new(Project::default()); + s.run("service.add", &json!({"url": wms, "type": "wms", "layer": "roads", "text": caps})).unwrap(); + // A style and a features source a document read from the internet named. + s.run("map.addTiles", &json!({"url": style, "name": "Roads style", "kind": "style"})).unwrap(); + cache::restrict_to_public(&style); + let roads = r#"{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"n":1},"geometry":{"type":"Point","coordinates":[8.5,47.4]}}]}"#; + s.run("layer.addDataText", &json!({"fileName": "roads.geojson", "text": roads})).unwrap(); + let id = s.map().layers.last().map(|l| l.id).unwrap(); + s.map_mut().layer_mut(id).unwrap().dataset.source = Some(features.clone()); + cache::restrict_to_public(&features); + let template = s.map().tiles.iter().find(|t| t.name == "Roads").map(|t| t.url.clone()).unwrap(); + let addresses = [template.as_str(), legend.as_str(), style.as_str(), features.as_str()]; + for a in addresses { + assert_eq!(cache::ceiling_for(a), Reach::Public, "{a}, as added"); + } + let (saved, _) = s.project.saved_text(None).unwrap(); + // Required by name: an older RustGIS refuses the project rather than saving it again + // without the hold; a map file and a layer file the same. + let requires = |v: &serde_json::Value| v["requires"].as_array().is_some_and(|r| r.iter().any(|c| c == super::INTERNET_ONLY)); + assert!(requires(&serde_json::from_str(&saved).unwrap()), "{saved}"); + let file = |bytes: Vec| serde_json::from_slice::(&bytes).unwrap(); + assert!(requires(&file(super::map_file_bytes(s.map()).unwrap()))); + let marked = s.map().layer(id).unwrap(); + assert!(requires(&file(super::layer_file_bytes(marked).unwrap()))); + // Saved with nothing held, nothing is required. + let mut plain = Session::new(Project::default()); + plain.run("layer.addDataText", &json!({"fileName": "plain.geojson", "text": roads})).unwrap(); + assert!(!requires(&serde_json::from_str(&plain.project.saved_text(None).unwrap().0).unwrap())); + let ceilings = |text: &str| { + forget(&addresses); + let s = Session::new(Project::from_json(text).unwrap()); + let marked = + s.map().tiles.iter().filter(|t| t.internet_only).count() + s.map().layers.iter().filter(|l| l.internet_only).count(); + (addresses.map(cache::ceiling_for), marked) + }; + assert_eq!(ceilings(&saved), ([Reach::Public; 4], 3), "opened again in a new session"); + // A map file and a layer file of the held layers hold them too. + forget(&addresses); + let mut imported = Session::new(Project::default()); + imported.run("map.import", &json!({"text": saved})).unwrap(); + assert_eq!(cache::ceiling_for(&template), Reach::Public, "map.import"); + forget(&addresses); + let layer_file = String::from_utf8(super::layer_file_bytes(s.map().layer(id).unwrap()).unwrap()).unwrap(); + imported.run("layer.addLayerFile", &json!({"text": layer_file})).unwrap(); + assert_eq!(cache::ceiling_for(&features), Reach::Public, "layer.addLayerFile"); + // Held as the file is read, not again later: an address the user names afterwards stays + // theirs when another layer is added (a layer file, which repairs the project again). + cache::allow_named(&template); + imported.run("layer.addLayerFile", &json!({"text": layer_file})).unwrap(); + assert_eq!(cache::ceiling_for(&template), Reach::Local, "named by the user since"); + // An older RustGIS's project, without the mark: as before, the user's own. + let mut older: serde_json::Value = serde_json::from_str(&saved).unwrap(); + let mut dropped = 0; + for map in older["maps"].as_array_mut().unwrap() { + // (A tile layer's keys are camel case, a map layer's snake case.) + for (part, key) in [("tiles", "internetOnly"), ("layers", "internet_only")] { + for item in map[part].as_array_mut().into_iter().flatten() { + dropped += usize::from(item.as_object_mut().unwrap().remove(key).is_some()); + } + } + } + assert_eq!(dropped, 3); + assert_eq!(ceilings(&older.to_string()), ([Reach::Local; 4], 0), "a project without the mark"); + // The mark follows the record: an address the user names afterwards (which clears its + // record) is saved unmarked, and reads as theirs. + for a in addresses { + cache::restrict_to_public(a); + } + let marked = |text: &str, name: &str| { + let v: serde_json::Value = serde_json::from_str(text).unwrap(); + v["maps"][0]["tiles"].as_array().unwrap().iter().any(|t| t["name"] == name && t["internetOnly"] == true) + }; + // The template named, its legend still came from the document: held whole. + // The template it names is held there again when reopened, and that is said. + cache::allow_named(&template); + let (named_template, report) = s.project.saved_text(None).unwrap(); + assert!(marked(&named_template, "Roads"), "its legend is still the document's"); + let said = report.notices().into_iter().filter(|n| n.contains("though you named some of their addresses")).collect::>(); + assert!(said.len() == 1 && said[0].starts_with("1 layer(s)"), "{said:?}"); + forget(&addresses); + let reopened = Session::new(Project::from_json(&named_template).unwrap()); + assert_eq!(cache::ceiling_for(&legend), Reach::Public); + assert_eq!(cache::ceiling_for(&template), Reach::Public, "held as a whole"); + drop(reopened); + // Every address of it named: saved unmarked. + cache::restrict_to_public(&style); + cache::allow_named(&template); + cache::allow_named(&legend); + let (again, _) = s.project.saved_text(None).unwrap(); + assert!(!marked(&again, "Roads"), "named by the user since"); + assert!(marked(&again, "Roads style"), "the rest stay marked"); + forget(&addresses); + let reopened = Session::new(Project::from_json(&again).unwrap()); + assert_eq!(cache::ceiling_for(&template), Reach::Local); + assert_eq!(cache::ceiling_for(&style), Reach::Public); + drop(reopened); + // The mark only narrows: an address held to the internet stays held in a project without it. + cache::restrict_to_public(&template); + let s = Session::new(Project::from_json(&older.to_string()).unwrap()); + assert_eq!(cache::ceiling_for(&template), Reach::Public); + drop(s); + } + + /// An offline area's snapshot keeps the hold: marked when the project is written and held + /// again when the area is opened as a map. A project package and a map package carry the mark + /// too. + #[test] + fn offline_maps_and_packages_keep_the_hold() { + let template = "https://saved-reach-offline.example/tiles/{z}/{x}/{y}.png"; + let mut s = Session::new(Project::default()); + s.run("map.addTiles", &json!({"url": template, "name": "Held", "overlay": true})).unwrap(); + cache::restrict_to_public(template); + let data = s.map().clone(); + s.project.offline_areas.push(super::OfflineArea { + id: String::new(), + name: "Field".into(), + map: "Map".into(), + extent: rustgis_geom::Extent::new(0.0, 0.0, 1.0, 1.0), + created: 0.0, + synced: 0.0, + generation: String::new(), + returned: Vec::new(), + ids: Default::default(), + conflicts: Default::default(), + data, + }); + s.map_mut().tiles.clear(); + // Packages: the project's (its offline area's snapshot) and the map's (a held layer on it). + let mut packaged = Session::new(Project::from_json(&s.project.saved_text(None).unwrap().0).unwrap()); + packaged.run("map.addTiles", &json!({"url": template, "name": "Held", "overlay": true})).unwrap(); + cache::restrict_to_public(template); + for kind in ["projectPackage", "mapPackage"] { + let (_, bytes, _) = crate::cmd::items::item_output(&mut packaged, kind, &json!({})).unwrap(); + let entries = rustgis_data::zip::read(&bytes).unwrap(); + // The map's own tiles (a project's first map, or a map file's), not the snapshot's. + let marked = entries.iter().filter(|(name, _)| name.ends_with(".rgis") || name.ends_with(".rgismap")).any(|(_, text)| { + let v: serde_json::Value = serde_json::from_slice(text).unwrap_or_default(); + let tiles = v.get("maps").and_then(|m| m.get(0)).unwrap_or(&v)["tiles"].as_array().cloned().unwrap_or_default(); + tiles.iter().any(|t| t["name"] == "Held" && t["internetOnly"] == true) + }); + assert!(marked, "{kind}: {:?}", entries.iter().map(|(n, _)| n).collect::>()); + } + // A template keeps the mark on its tile layers too. + let (_, bytes, _) = crate::cmd::items::item_output(&mut packaged, "template", &json!({})).unwrap(); + let v: serde_json::Value = serde_json::from_slice(&bytes).unwrap(); + let tiles = v["maps"][0]["tiles"].as_array().cloned().unwrap_or_default(); + assert!(tiles.iter().any(|t| t["name"] == "Held" && t["internetOnly"] == true), "template: {tiles:?}"); + let (saved, _) = s.project.saved_text(None).unwrap(); + assert!(s.project.offline_areas[0].data.tiles[0].internet_only, "the snapshot is marked"); + forget(&[template]); + let mut reopened = Session::new(Project::from_json(&saved).unwrap()); + assert_eq!(cache::ceiling_for(template), Reach::Local, "a snapshot isn't read until its area is opened"); + reopened.run("offline.open", &json!({"name": "Field"})).unwrap(); + assert_eq!(cache::ceiling_for(template), Reach::Public, "opened as a map, it is held again"); + } + + /// A marked cloud-optimised GeoTIFF tile layer, read in place as a raster layer when its + /// project opens, keeps the mark and is held. + #[test] + fn a_marked_cog_tile_stays_held_as_a_raster_layer() { + let tif = "https://saved-reach-cog.example/scene.tif"; + let mut s = Session::new(Project::default()); + s.run("map.addTiles", &json!({"url": "https://saved-reach-cog.example/{z}/{x}/{y}.png", "name": "Scene", "overlay": true})) + .unwrap(); + cache::restrict_to_public("https://saved-reach-cog.example/{z}/{x}/{y}.png"); + let (saved, _) = s.project.saved_text(None).unwrap(); + let mut v: serde_json::Value = serde_json::from_str(&saved).unwrap(); + v["maps"][0]["tiles"][0]["kind"] = json!("cog"); + v["maps"][0]["tiles"][0]["url"] = json!(tif); + assert_eq!(v["maps"][0]["tiles"][0]["internetOnly"], true); + forget(&[tif]); + let reopened = Session::new(Project::from_json(&v.to_string()).unwrap()); + let layer = reopened.map().layers.iter().find(|l| l.raster.is_some()).expect("read in place as a raster layer"); + assert!(layer.internet_only); + assert_eq!(cache::ceiling_for(tif), Reach::Public); + } + + /// Only the tile layers a project keeps are held: those past the limit, left out (and said), + /// record nothing. + #[test] + fn tile_layers_past_the_limit_record_nothing() { + let template = |i: usize| format!("https://saved-reach-limit-{i}.example/tiles/{{z}}/{{x}}/{{y}}.png"); + let mut s = Session::new(Project::default()); + let first = template(0); + s.run("map.addTiles", &json!({"url": first, "name": "Held", "overlay": true})).unwrap(); + cache::restrict_to_public(&first); + let (saved, _) = s.project.saved_text(None).unwrap(); + let mut v: serde_json::Value = serde_json::from_str(&saved).unwrap(); + let tile = v["maps"][0]["tiles"][0].clone(); + let mut tiles = Vec::new(); + for i in 0..=rustgis_map::tiles::MAX_TILE_LAYERS { + let mut t = tile.clone(); + t["url"] = json!(template(i)); + t["name"] = json!(format!("Held {i}")); + tiles.push(t); + } + v["maps"][0]["tiles"] = json!(tiles); + let last = template(rustgis_map::tiles::MAX_TILE_LAYERS); + forget(&[first.as_str(), last.as_str()]); + let reopened = Session::new(Project::from_json(&v.to_string()).unwrap()); + assert_eq!(reopened.map().tiles.len(), rustgis_map::tiles::MAX_TILE_LAYERS); + assert_eq!(cache::ceiling_for(&first), Reach::Public, "a kept layer is held"); + assert_eq!(cache::ceiling_for(&last), Reach::Local, "the one left out records nothing"); + } + + /// The fixture project's marked WMS layer opens with its template and legend held to the + /// internet; without the mark, they are the user's own. + #[test] + fn the_fixture_projects_marked_layer_opens_held_to_the_internet() { + let text = include_str!("../../../schema/fixtures/internet_only.rgis"); + let project = Project::from_json(text).unwrap(); + let tile = &project.maps[0].tiles[0]; + assert!(tile.internet_only); + let addresses: Vec = tile.addresses().map(str::to_string).collect(); + let addresses: Vec<&str> = addresses.iter().map(String::as_str).collect(); + assert_eq!(addresses.len(), 2, "{addresses:?}"); + for (text, want) in + [(text.replace("\"internetOnly\": true", "\"internetOnly\": false"), Reach::Local), (text.to_string(), Reach::Public)] + { + forget(&addresses); + let _s = Session::new(Project::from_json(&text).unwrap()); + for a in &addresses { + assert_eq!(cache::ceiling_for(a), want, "{a}"); + } + } + } +} + #[cfg(test)] mod limit_tests { use super::*; diff --git a/crates/engine/src/project_capabilities.rs b/crates/engine/src/project_capabilities.rs index 1eb0c45e87..2a485b83d2 100644 --- a/crates/engine/src/project_capabilities.rs +++ b/crates/engine/src/project_capabilities.rs @@ -528,6 +528,7 @@ fn layer_capabilities(layer: &Layer) -> Vec<&'static str> { (layer.has_picture_markers(), "picture-markers"), (zarr_window(layer), "zarr-window"), (label_guide(layer), "label-guide"), + (layer.internet_only, super::INTERNET_ONLY), (held_natively(&layer.dataset), super::NATIVE_COORDINATES), ] .into_iter() @@ -555,6 +556,7 @@ fn map_capabilities<'a>(maps: impl IntoIterator) -> Vec<&'static ) = (false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); let mut polygon = false; let (mut offline_area_id, mut paper, mut native, mut guided) = (false, false, false, false); + let mut internet_only = false; for map in maps { offline_area_id |= map.offline_area_id.is_some(); // A blank basemap's paper colour (#2532), which an older reader would draw and save white. @@ -580,6 +582,9 @@ fn map_capabilities<'a>(maps: impl IntoIterator) -> Vec<&'static // The layer a block's walls are coloured by (#2173), which an older reader would save away. walls_layer |= t.block.as_ref().is_some_and(|b| b.walls_layer.is_some()); } + // A layer held to the internet (its addresses came from a document read from there), which + // an older reader would save again without the hold. + internet_only |= map.tiles.iter().any(|t| t.internet_only) || map.layers.iter().any(|l| l.internet_only); relief |= map.layers.iter().any(relief_effects); light |= map.layers.iter().any(relief_light); sized |= map.layers.iter().any(|layer| layer.size_by.is_some()); @@ -611,6 +616,7 @@ fn map_capabilities<'a>(maps: impl IntoIterator) -> Vec<&'static (mgrs, "graticule-mgrs"), (on_top, "graticule-on-top"), (grid_color, "graticule-color"), + (internet_only, super::INTERNET_ONLY), ] .into_iter() .filter_map(|(used, name)| used.then_some(name)) diff --git a/crates/engine/tests/held_record_full.rs b/crates/engine/tests/held_record_full.rs new file mode 100644 index 0000000000..136347c639 --- /dev/null +++ b/crates/engine/tests/held_record_full.rs @@ -0,0 +1,57 @@ +//! Opening a project that fills the record of addresses held to the internet says so: from then +//! on every address is held there, for the rest of the session. With the record full, a layer read +//! marked keeps its mark, and one held only because the record is full is said when written. +//! +//! Its own test binary, with one test in order: it fills the process-wide record, which would hold +//! every other test's addresses to the internet too. + +use rustgis_engine::map as rustgis_map; +use rustgis_engine::render::rustgis_tiles::{address::Reach, cache}; +use rustgis_engine::{Project, Session}; +use serde_json::json; + +/// A project with one tile layer held to the internet, with `dates` dated files. +fn held(dates: usize) -> String { + let mut s = Session::new(Project::default()); + let template = format!("https://held-full-{dates}.example/scene.tif"); + s.run("map.addTiles", &json!({"url": "https://held-full.example/{z}/{x}/{y}.png", "name": "Scene", "overlay": true})).unwrap(); + let mut v: serde_json::Value = serde_json::to_value(&s.project).unwrap(); + let tile = &mut v["maps"][0]["tiles"][0]; + tile["url"] = json!(template); + tile["internetOnly"] = json!(true); + tile["timeUrls"] = + json!((0..dates).map(|i| json!([i as f64, format!("https://held-full-{dates}.example/{i}.tif")])).collect::>()); + v["requires"] = json!(["internet-only"]); + v.to_string() +} + +#[test] +fn a_full_record_of_held_addresses_is_said_and_keeps_what_was_marked() { + let full = |s: &Session| s.notices_since(0).iter().filter(|n| n.text.contains("filled the record")).count(); + let unmarked = |text: &str| text.contains("only because this session's record of such addresses is full"); + // Within the record: nothing said, and the user's own addresses are theirs. + let opened = Session::new(Project::from_json(&held(10)).unwrap()); + assert_eq!(full(&opened), 0); + let (_, report) = opened.project.clone().saved_text(None).unwrap(); + assert!(!report.notices().iter().any(|n| unmarked(n)), "nothing said with room in the record"); + assert!(!cache::public_restrictions_full()); + assert_eq!(cache::ceiling_for("http://192.168.1.5/tiles/0/0/0.png"), Reach::Local); + // Past it (a data cube with more dated files than the record holds): said once, and from then + // on every address is held to the internet. + let opened = Session::new(Project::from_json(&held(rustgis_map::tiles::MAX_TIME_URLS)).unwrap()); + assert_eq!(full(&opened), 1, "{:?}", opened.notices_since(0).iter().map(|n| &n.text).collect::>()); + assert!(cache::public_restrictions_full()); + assert_eq!(cache::ceiling_for("http://192.168.1.5/tiles/0/0/0.png"), Reach::Public); + // A layer read marked keeps its mark, though the record has no room for its addresses; one + // added since, held only because the record is full, is written unmarked, and that is said. + let mut s = Session::new(Project::from_json(&held(7)).unwrap()); + s.run("map.addTiles", &json!({"url": "https://after-full.example/{z}/{x}/{y}.png", "name": "Later", "overlay": true})).unwrap(); + let (text, report) = s.project.saved_text(None).unwrap(); + let v: serde_json::Value = serde_json::from_str(&text).unwrap(); + let marked = |name: &str| v["maps"][0]["tiles"].as_array().unwrap().iter().any(|t| t["name"] == name && t["internetOnly"] == true); + assert!(marked("Scene"), "read marked, kept marked"); + assert!(!marked("Later")); + let said: Vec = report.notices().into_iter().filter(|n| unmarked(n)).collect(); + assert_eq!(said.len(), 1, "{:?}", report.notices()); + assert!(said[0].starts_with("1 layer(s)"), "{said:?}"); +} diff --git a/crates/map/src/lib.rs b/crates/map/src/lib.rs index d54e0f5209..6d6479f47f 100644 --- a/crates/map/src/lib.rs +++ b/crates/map/src/lib.rs @@ -316,6 +316,12 @@ pub struct Layer { /// after saving and reopening the project. #[serde(default, skip_serializing_if = "std::ops::Not::not")] pub anonymous: bool, + /// Its source's addresses came from a document read from the internet, so they are read only + /// from there, including after the project is saved and opened again (the session's record of + /// where documents were read isn't saved). It only ever narrows what the layer reaches; + /// without it, a layer is read as before. + #[serde(default, skip_serializing_if = "std::ops::Not::not")] + pub internet_only: bool, /// Process-local identity, preserved by snapshots but never stored in a project. #[serde(skip, default = "next_layer_instance")] instance_id: u64, @@ -572,6 +578,7 @@ impl Layer { synced: None, connection: String::new(), anonymous: false, + internet_only: false, projected: Default::default(), display: None, display_rejected: Vec::new(), @@ -3741,6 +3748,7 @@ impl Layer { synced: _, connection: _, anonymous: _, + internet_only: _, instance_id: _, projected: _, display: _, diff --git a/crates/map/src/look.rs b/crates/map/src/look.rs index 2830323574..7bed51a635 100644 --- a/crates/map/src/look.rs +++ b/crates/map/src/look.rs @@ -83,6 +83,7 @@ fn bare(layer: &Layer) -> Layer { synced: _, connection, anonymous, + internet_only, instance_id, replacement_rev, // Caches, emptied below. @@ -160,6 +161,7 @@ fn bare(layer: &Layer) -> Layer { synced: None, connection: connection.clone(), anonymous: *anonymous, + internet_only: *internet_only, instance_id: *instance_id, replacement_rev: *replacement_rev, projected: projected.clone(), @@ -256,6 +258,7 @@ impl LayerLook { synced: _, connection: _, anonymous: _, + internet_only: _, instance_id, replacement_rev, // Caches worked out from the rows, which are compared themselves. diff --git a/crates/map/src/tiles.rs b/crates/map/src/tiles.rs index 914d9f196a..0783445c5d 100644 --- a/crates/map/src/tiles.rs +++ b/crates/map/src/tiles.rs @@ -188,6 +188,12 @@ pub struct TileLayer { /// web-service login, including after saving and reopening the project. #[serde(default, skip_serializing_if = "is_false")] pub anonymous: bool, + /// Its addresses (template, legends, dated steps) came from a document read from the internet, + /// so they are fetched only from there, including after the project is saved and opened again + /// (the session's record of where documents were read isn't saved). It only ever narrows what + /// the layer reaches; without it, a layer is read as before. + #[serde(default, skip_serializing_if = "is_false")] + pub internet_only: bool, /// Picked in the Layers pane (`map.selectTiles`), for the session only: it holds while no /// map layer is active (the engine's `Session::selected_tile`). #[serde(skip)] @@ -416,6 +422,7 @@ impl TileLayer { legends: Vec::new(), connection: String::new(), anonymous: false, + internet_only: false, expanded: false, selected: false, single_image: false, @@ -710,6 +717,7 @@ impl TileLayer { legends, connection: _, anonymous: _, + internet_only: _, expanded: _, selected: _, single_image: _, @@ -729,6 +737,11 @@ impl TileLayer { out } + /// Every address the layer keeps and fetches from: its template, dated steps and legends. + pub fn addresses(&self) -> impl Iterator { + self.output_slots().into_iter().map(|(_, address, _)| address) + } + /// Resolves a fixed location, independent of the address's current spelling. pub(crate) fn output_slot_mut(&mut self, role: crate::TileRole) -> Option<&mut String> { match role { diff --git a/crates/tiles/src/cache.rs b/crates/tiles/src/cache.rs index c83f7551be..b5c98a3934 100644 --- a/crates/tiles/src/cache.rs +++ b/crates/tiles/src/cache.rs @@ -565,6 +565,12 @@ fn direct_base_origin(url: &str, from: Option<&crate::address::Origin>) -> Optio Some(crate::address::Origin { url: origin, reach: crate::address::Reach::Public }) } +/// Whether the user has named `url` directly since a document did ([`allow_named`]). +pub fn named_by_user(url: &str) -> bool { + let base = canonical_resource(url); + !base.is_empty() && public_only().lock().unwrap_or_else(|e| e.into_inner()).named_local.contains(base) +} + /// Clears any document-origin restriction on `url` when the user explicitly names it directly. pub fn allow_named(url: &str) { let base = canonical_resource(url); @@ -605,6 +611,25 @@ pub fn ceiling_for(url: &str) -> crate::address::Reach { } } +/// Whether [`restrict_to_public`] recorded `url` itself (or a template it matches), so a document +/// read from the internet named it. Unlike [`ceiling_for`], a full table doesn't make this true: +/// what is saved with a project must say what was recorded, not that the table filled up. +pub fn recorded_public(url: &str) -> bool { + let base = canonical_resource(url); + if base.is_empty() { + return false; + } + let p = public_only().lock().unwrap_or_else(|e| e.into_inner()); + p.exact.contains(base) || (!p.named_local.contains(base) && p.templates.iter().any(|tpl| tpl.matches(base))) +} + +/// Whether the record of addresses held to the internet is full, so every address not named by the +/// user is held there ([`ceiling_for`]) until the process ends: for the caller that filled it to +/// say. +pub fn public_restrictions_full() -> bool { + public_only().lock().unwrap_or_else(|e| e.into_inner()).saturated +} + /// Resets document-origin public restrictions recorded by [`restrict_to_public`] and [`allow_named`]. pub fn clear_public_restrictions() { let mut p = public_only().lock().unwrap_or_else(|e| e.into_inner()); diff --git a/docs/maintaining.md b/docs/maintaining.md index 04af512492..e029112a9f 100644 --- a/docs/maintaining.md +++ b/docs/maintaining.md @@ -157,6 +157,18 @@ Projects, map files and layer files with a window of a Zarr variable that follow reader refuses them instead of reading the whole map at each step. A saved `layer.addZarr` command with both needs nothing: an older RustGIS refuses it when it runs. +Projects, map files and layer files with a layer held to the internet (one whose addresses a +document read from the internet named: `internetOnly` on a tile layer, `internet_only` on a map +layer) require `internet-only`, so an older reader refuses them instead of reading the layer's +addresses wherever their names resolve and saving the project again without the hold. The one +exception is a layer held only because the session's record of such addresses is full (one added +after it filled): it is written unmarked, so its file needs nothing new and opening it again +doesn't hold it, and writing it says so. + +A layer is held or not as a whole: one marked because some of its addresses came from such a +document holds every address it has when it is read, including any the user named since, and +writing it says so. + Projects, map files and layer files with a label class curved along a guide line layer (`labels.placement` with a `guide`) require `label-guide`, so an older reader refuses them instead of placing those labels as without it and saving them again without the guide. A saved diff --git a/schema/fixtures/internet_only.rgis b/schema/fixtures/internet_only.rgis new file mode 100644 index 0000000000..39efd53f68 --- /dev/null +++ b/schema/fixtures/internet_only.rgis @@ -0,0 +1,106 @@ +{ + "format": 2, + "requires": [ + "internet-only" + ], + "name": "Internet only", + "maps": [ + { + "name": "Map", + "layers": [], + "basemap": "Paper", + "camera": { + "center": { + "x": 0.0, + "y": 2000000.0 + }, + "res": 30000.0, + "bearing": 0.0, + "pitch": 0.0 + }, + "bookmarks": [], + "graticule": true, + "projection": "WebMercator", + "popup_mode": "Topmost", + "label_display": { + "paused": false, + "locked": false, + "show_unplaced": false + }, + "editing": { + "relationships": [], + "snapping": { + "enabled": false, + "tolerance_px": 10.0, + "vertex": true, + "edge": true, + "end": true + }, + "topology": [], + "settings": { + "enabled": true, + "show_vertices": true, + "elevation": "None", + "ground_to_grid": null + } + }, + "swipe": null, + "view": { + "effects": { + "stars": true, + "sun_time": null, + "weather": "None", + "vignette": false, + "edges": false, + "tilt_shift": false, + "grain": false, + "brightness": 0.0, + "contrast": 0.0, + "saturation": 0.0, + "sepia": 0.0 + }, + "wireframe": false, + "clip_distance": null + }, + "animation": [], + "next_layer_id": 1, + "tiles": [ + { + "name": "Roads", + "kind": "raster", + "url": "https://internet-only-fixture.example/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=roads&STYLES=&CRS=EPSG:3857&BBOX={bbox-epsg-3857}&WIDTH=256&HEIGHT=256&FORMAT=image/png", + "legends": [ + { + "url": "https://internet-only-fixture.example/legend.png" + } + ], + "internetOnly": true + } + ] + } + ], + "active_map": 0, + "tables": [], + "next_table_id": 1, + "gp_history": [], + "layouts": [], + "folders": [], + "styles": [], + "ramps": [], + "tasks": [], + "gp_env": { + "extent": null, + "cell_size": null + }, + "models": [], + "workspaces": [], + "link_views": false, + "jobs": [], + "offline_areas": [], + "reports": [], + "presentations": [], + "notebooks": [], + "dl_models": [], + "shared": [], + "data_stores": [] +} diff --git a/schema/project.schema.json b/schema/project.schema.json index 7cbc133e20..cb32372d6c 100644 --- a/schema/project.schema.json +++ b/schema/project.schema.json @@ -1275,7 +1275,8 @@ "layout-text-size", "label-guide", "project-crs", - "dggs-system" + "dggs-system", + "internet-only" ], "type": "string" }, @@ -1379,7 +1380,8 @@ "layout-text-size", "label-guide", "project-crs", - "dggs-system" + "dggs-system", + "internet-only" ], "x-rustgis-reads-format": 2, "x-rustgis-writes-format": 2