fix(anatomy): V1-2.2 owner arbitrations on SVG references and bytes
Refuse local references to ids a drawing does not define, scope canvas ids per view, upload every drawing in one stored form checked by the verdict and the preview, keep strict numeric rgb() colours, and commit real Inkscape 1.4.3 exports with their generator.
This commit is contained in:
1 parent
17d919971e
commit
e823655f09
31 files changed
+1362
-110
No files matched your search
@@ -10,7 +10,8 @@ use faunosteo_core::curation::upload::{
|
||||
|
||||
const SEED: &str = "../../supabase/seed/anatomical-sheets/equine/draft";
|
||||
const UUID: &str = "7f767f74-3b36-51a7-8465-52dd7e2ead4a";
|
||||
const SVG: &[u8] = b"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\"><g/></svg>";
|
||||
/// A drawing in its stored form (`serialize::stored_form`), as the verdict requires it.
|
||||
const SVG: &[u8] = b"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\"><g/></svg>";
|
||||
|
||||
fn entry_for(bytes: &[u8]) -> AssetEntry {
|
||||
AssetEntry {
|
||||
@@ -118,6 +119,12 @@ fn only_bytes_that_match_and_that_the_svg_reader_keeps_whole_are_uploaded() {
|
||||
kind(verify_asset(&entry_for(not_svg), not_svg)),
|
||||
UploadKind::Content
|
||||
);
|
||||
// Read with no removal but outside the stored form: the verdict would refuse it.
|
||||
let loose = &SVG[SVG.iter().position(|&b| b == b'\n').unwrap() + 1..];
|
||||
assert_eq!(
|
||||
kind(verify_asset(&entry_for(loose), loose)),
|
||||
UploadKind::Content
|
||||
);
|
||||
let binary: &[u8] = &[0xff, 0xfe, 0x00];
|
||||
assert_eq!(
|
||||
kind(verify_asset(&entry_for(binary), binary)),
|
||||
|
||||
Reference in new issue
Block a user