Skip to content

Commit 1fb53b3

Browse files
committed
cleanup
1 parent 6b819c4 commit 1fb53b3

File tree

6 files changed

+43
-104
lines changed

6 files changed

+43
-104
lines changed

rust/signed_doc/src/validator/rules/ownership/tests/without_collaborators.rs

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -47,54 +47,6 @@ use crate::{
4747
} => true ;
4848
"Latest Version Catalyst Signed Document has the same author as the first version"
4949
)]
50-
#[test_case(
51-
|provider| {
52-
let (a_sk, _, a_kid) = create_dummy_key_pair(RoleId::Role0);
53-
let (c_sk, _, c_kid) = create_dummy_key_pair(RoleId::Role0);
54-
let id = UuidV7::new();
55-
let doc = Builder::new()
56-
.with_metadata_field(SupportedField::Id(id))
57-
.with_metadata_field(SupportedField::Ver(id))
58-
.with_metadata_field(SupportedField::Collaborators(vec![c_kid.clone()].into()))
59-
.add_signature(|m| a_sk.sign(&m).to_vec(), a_kid.clone())
60-
.unwrap()
61-
.build();
62-
provider.add_document(None, &doc).unwrap();
63-
64-
Builder::new()
65-
.with_metadata_field(SupportedField::Id(id))
66-
.with_metadata_field(SupportedField::Ver(UuidV7::new()))
67-
.add_signature(|m| a_sk.sign(&m).to_vec(), a_kid.clone())
68-
.unwrap()
69-
.add_signature(|m| c_sk.sign(&m).to_vec(), c_kid.clone())
70-
.unwrap()
71-
.build()
72-
} => false ;
73-
"Latest Version Catalyst Signed Document signed by first author and one collaborator"
74-
)]
75-
#[test_case(
76-
|provider| {
77-
let (a_sk, _, a_kid) = create_dummy_key_pair(RoleId::Role0);
78-
let (c_sk, _, c_kid) = create_dummy_key_pair(RoleId::Role0);
79-
let id = UuidV7::new();
80-
let doc = Builder::new()
81-
.with_metadata_field(SupportedField::Id(id))
82-
.with_metadata_field(SupportedField::Ver(id))
83-
.with_metadata_field(SupportedField::Collaborators(vec![c_kid.clone()].into()))
84-
.add_signature(|m| a_sk.sign(&m).to_vec(), a_kid.clone())
85-
.unwrap()
86-
.build();
87-
provider.add_document(None, &doc).unwrap();
88-
89-
Builder::new()
90-
.with_metadata_field(SupportedField::Id(id))
91-
.with_metadata_field(SupportedField::Ver(UuidV7::new()))
92-
.add_signature(|m| c_sk.sign(&m).to_vec(), c_kid.clone())
93-
.unwrap()
94-
.build()
95-
} => false ;
96-
"Latest Version Catalyst Signed Document signed by one collaborator"
97-
)]
9850
#[test_case(
9951
|_| {
10052
let id = UuidV7::new();
@@ -167,34 +119,6 @@ use crate::{
167119
} => false ;
168120
"Latest Version Catalyst Signed Document signed by first author and not added collaborator"
169121
)]
170-
#[test_case(
171-
|provider| {
172-
let (a_sk, _, a_kid) = create_dummy_key_pair(RoleId::Role0);
173-
let (c1_sk, _, c1_kid) = create_dummy_key_pair(RoleId::Role0);
174-
let id = UuidV7::new();
175-
let doc = Builder::new()
176-
.with_metadata_field(SupportedField::Id(id))
177-
.with_metadata_field(SupportedField::Ver(id))
178-
.with_metadata_field(SupportedField::Collaborators(vec![c1_kid.clone()].into()))
179-
.add_signature(|m| a_sk.sign(&m).to_vec(), a_kid.clone())
180-
.unwrap()
181-
.build();
182-
provider.add_document(None, &doc).unwrap();
183-
184-
let (c2_sk, _, c2_kid) = create_dummy_key_pair(RoleId::Role0);
185-
Builder::new()
186-
.with_metadata_field(SupportedField::Id(id))
187-
.with_metadata_field(SupportedField::Ver(UuidV7::new()))
188-
.add_signature(|m| a_sk.sign(&m).to_vec(), a_kid.clone())
189-
.unwrap()
190-
.add_signature(|m| c1_sk.sign(&m).to_vec(), c1_kid.clone())
191-
.unwrap()
192-
.add_signature(|m| c2_sk.sign(&m).to_vec(), c2_kid.clone())
193-
.unwrap()
194-
.build()
195-
} => false ;
196-
"Latest Version Catalyst Signed Document signed by first author and one collaborator and one unknown collaborator"
197-
)]
198122
#[tokio::test]
199123
async fn ownership_test(
200124
doc_gen: impl FnOnce(&mut TestCatalystProvider) -> CatalystSignedDocument

specs/definitions/signed_docs/docs/generic_parameters.cue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ _parameters_payload_description: """
6060
"Brand Admin",
6161
]
6262
}
63-
update: collaborators: true
63+
update: collaborators: "collaborators"
6464
}
6565

6666
authors: {

specs/definitions/signed_docs/docs/proposal.cue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ docs: #DocumentDefinitions & {
9191
"Proposer",
9292
]
9393

94-
update: collaborators: true
94+
update: collaborators: "collaborators"
9595
}
9696

9797
authors: "Steven Johnson": "[email protected]"

specs/definitions/signed_docs/docs/proposal_submission_action.cue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ docs: #DocumentDefinitions & {
135135
]
136136
}
137137

138-
referenced: true
139-
140-
update: collaborators: true
138+
update: collaborators: "ref"
141139
}
142140

143141
versions: [

specs/definitions/signed_docs/signers.cue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ _allAdminRoles: or(_allAdminRolesList)
4848
admin?: #allowedAdminRoles
4949
}
5050

51+
// Listed collaborators can post updated versions based on the metadata field as a source of collaborators information
52+
#collaboratorsDef: "collaborators" | "ref" | *"excluded" | "what_the_fuck"
53+
5154
#allowedUpdaters: {
52-
collaborators: "collaborators" | "ref" | *"excluded" // Listed collaborators can post updated versions based on the metadata field as a source of collaborators information
55+
collaborators: #collaboratorsDef
5356
author: bool | *true // The original author can post updated versions
5457
}
5558

specs/signed_doc.json

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@
501501
},
502502
"update": {
503503
"author": true,
504-
"collaborators": true
504+
"collaborators": "collaborators"
505505
}
506506
},
507507
"type": "3e4808cc-c86e-467b-9702-d60baa9d1fca",
@@ -622,7 +622,8 @@
622622
"user": []
623623
},
624624
"update": {
625-
"author": true
625+
"author": true,
626+
"collaborators": "excluded"
626627
}
627628
},
628629
"type": "fd3c1735-80b1-4eea-8d63-5f436d97ea31",
@@ -757,7 +758,7 @@
757758
},
758759
"update": {
759760
"author": true,
760-
"collaborators": true
761+
"collaborators": "collaborators"
761762
}
762763
},
763764
"type": "0110ea96-a555-47ce-8408-36efe6ed6f7c",
@@ -883,7 +884,8 @@
883884
"user": []
884885
},
885886
"update": {
886-
"author": true
887+
"author": true,
888+
"collaborators": "excluded"
887889
}
888890
},
889891
"type": "7e8f5fa2-44ce-49c8-bfd5-02af42c179a3",
@@ -1018,7 +1020,7 @@
10181020
},
10191021
"update": {
10201022
"author": true,
1021-
"collaborators": true
1023+
"collaborators": "collaborators"
10221024
}
10231025
},
10241026
"type": "48c20109-362a-4d32-9bba-e0a9cf8b45be",
@@ -1144,7 +1146,8 @@
11441146
"user": []
11451147
},
11461148
"update": {
1147-
"author": true
1149+
"author": true,
1150+
"collaborators": "excluded"
11481151
}
11491152
},
11501153
"type": "65b1e8b0-51f1-46a5-9970-72cdf26884be",
@@ -1273,7 +1276,8 @@
12731276
]
12741277
},
12751278
"update": {
1276-
"author": true
1279+
"author": true,
1280+
"collaborators": "excluded"
12771281
}
12781282
},
12791283
"type": "84a4b502-3b7e-47fd-84e4-6fee08794bd7",
@@ -1397,7 +1401,8 @@
13971401
]
13981402
},
13991403
"update": {
1400-
"author": true
1404+
"author": true,
1405+
"collaborators": "excluded"
14011406
}
14021407
},
14031408
"type": "764f17fb-cc50-4979-b14a-b213dbac5994",
@@ -1527,7 +1532,7 @@
15271532
},
15281533
"update": {
15291534
"author": true,
1530-
"collaborators": true
1535+
"collaborators": "collaborators"
15311536
}
15321537
},
15331538
"type": "788ff4c6-d65a-451f-bb33-575fe056b411",
@@ -1655,7 +1660,8 @@
16551660
"user": []
16561661
},
16571662
"update": {
1658-
"author": true
1663+
"author": true,
1664+
"collaborators": "excluded"
16591665
}
16601666
},
16611667
"type": "08a1e16d-354d-4f64-8812-4692924b113b",
@@ -1871,7 +1877,8 @@
18711877
"user": []
18721878
},
18731879
"update": {
1874-
"author": true
1880+
"author": true,
1881+
"collaborators": "excluded"
18751882
}
18761883
},
18771884
"type": "cb99b9bd-681a-49d8-9836-89107c02e8ef",
@@ -2009,7 +2016,7 @@
20092016
},
20102017
"update": {
20112018
"author": true,
2012-
"collaborators": true
2019+
"collaborators": "collaborators"
20132020
}
20142021
},
20152022
"type": "7808d2ba-d511-40af-84e8-c0d1625fdfdc",
@@ -2152,7 +2159,8 @@
21522159
]
21532160
},
21542161
"update": {
2155-
"author": true
2162+
"author": true,
2163+
"collaborators": "excluded"
21562164
}
21572165
},
21582166
"type": "b679ded3-0e7c-41ba-89f8-da62a17898ea",
@@ -2280,7 +2288,8 @@
22802288
"user": []
22812289
},
22822290
"update": {
2283-
"author": true
2291+
"author": true,
2292+
"collaborators": "excluded"
22842293
}
22852294
},
22862295
"type": "0b8424d4-ebfd-46e3-9577-1775a69d290c",
@@ -2412,7 +2421,8 @@
24122421
"user": []
24132422
},
24142423
"update": {
2415-
"author": true
2424+
"author": true,
2425+
"collaborators": "excluded"
24162426
}
24172427
},
24182428
"type": "0ce8ab38-9258-4fbc-a62e-7faa6e58318f",
@@ -2539,7 +2549,8 @@
25392549
]
25402550
},
25412551
"update": {
2542-
"author": true
2552+
"author": true,
2553+
"collaborators": "excluded"
25432554
}
25442555
},
25452556
"type": "a552451a-8e5b-409d-83a0-21eac26bbf8c",
@@ -2723,15 +2734,14 @@
27232734
}
27242735
},
27252736
"signers": {
2726-
"referenced": true,
27272737
"roles": {
27282738
"user": [
27292739
"Proposer"
27302740
]
27312741
},
27322742
"update": {
27332743
"author": true,
2734-
"collaborators": true
2744+
"collaborators": "ref"
27352745
}
27362746
},
27372747
"type": "5e60e623-ad02-4a1b-a1ac-406db978ee48",
@@ -2869,7 +2879,8 @@
28692879
]
28702880
},
28712881
"update": {
2872-
"author": true
2882+
"author": true,
2883+
"collaborators": "excluded"
28732884
}
28742885
},
28752886
"type": "bf9abd97-5d1f-4429-8e80-740fea371a9c",
@@ -2988,7 +2999,8 @@
29882999
"user": []
29893000
},
29903001
"update": {
2991-
"author": true
3002+
"author": true,
3003+
"collaborators": "excluded"
29923004
}
29933005
},
29943006
"type": "431561a5-9c2b-4de1-8e0d-78eb4887e35d",
@@ -3129,7 +3141,8 @@
31293141
]
31303142
},
31313143
"update": {
3132-
"author": true
3144+
"author": true,
3145+
"collaborators": "excluded"
31333146
}
31343147
},
31353148
"type": "0f2c86a2-ffda-40b0-ad38-23709e1c10b3",
@@ -3250,7 +3263,8 @@
32503263
"user": []
32513264
},
32523265
"update": {
3253-
"author": true
3266+
"author": true,
3267+
"collaborators": "excluded"
32543268
}
32553269
},
32563270
"type": "564cbea3-44d3-4303-b75a-d9fdda7e5a80",

0 commit comments

Comments
 (0)