cob: Change APIs to take URIs for embeds
To facilitate edit actions, take URIs instead of the actual blobs. This means API callers don’t have to load all the blobs just for them to be re-hashed when an edit action is submitted.
There are some peculiarities when dealing with the Identity COB since
the embed is the identity document itself. We handle that special case.
12 files changed
+152
-144
034eb418
→
855327d3
modified radicle-cli/src/commands/patch/edit.rs
@@ -1,6 +1,6 @@
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -19,12 +19,11 @@ pub fn run(
|
|
|
|
|
|
| - | |
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -32,7 +31,6 @@ fn edit_root<G>(
|
|
|
|
|
|
| - | |
|
|
|
|
|
@@ -56,11 +54,7 @@ where
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
@@ -80,17 +74,12 @@ fn edit_revision<G>(
|
|
|
|
|
|
| - | |
|
|
|
|
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
modified radicle-cob/src/backend/git/change.rs
@@ -341,7 +341,7 @@ fn write_commit(
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -372,10 +372,10 @@ fn write_manifest(
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified radicle-cob/src/change/store.rs
@@ -45,7 +45,7 @@ pub struct Template<Id> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -191,6 +191,22 @@ pub struct Embed<T = Vec<u8>> {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified radicle-cob/src/object/collaboration/create.rs
@@ -18,7 +18,7 @@ pub struct Create {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified radicle-cob/src/object/collaboration/update.rs
@@ -34,7 +34,7 @@ pub struct Update {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified radicle/src/cob/common.rs
@@ -8,10 +8,8 @@ use base64::prelude::{Engine, BASE64_STANDARD};
|
|
|
|
|
|
| - | |
|
|
|
|
| - | |
|
|
|
|
|
@@ -348,24 +346,6 @@ impl TryFrom<&Uri> for DataUri {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
|
|
|
|
|
modified radicle/src/cob/identity.rs
@@ -3,7 +3,7 @@ use std::{fmt, ops::Deref, str::FromStr};
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -15,7 +15,7 @@ use crate::{
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -187,10 +187,12 @@ impl Identity {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -825,22 +827,26 @@ impl<R: ReadRepository> store::Transaction<Identity, R> {
|
|
|
|
|
|
| + | |
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
@@ -891,10 +897,10 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -912,8 +918,8 @@ where
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -929,7 +935,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -938,7 +944,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -947,7 +953,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -958,7 +964,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified radicle/src/cob/issue.rs
@@ -472,15 +472,13 @@ impl<R: ReadRepository> store::Transaction<Issue, R> {
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -506,15 +504,13 @@ impl<R: ReadRepository> store::Transaction<Issue, R> {
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -545,16 +541,15 @@ impl<R: ReadRepository> store::Transaction<Issue, R> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
|
|
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -613,7 +608,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -633,7 +628,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -646,7 +641,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -777,7 +772,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -785,7 +780,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1511,17 +1506,22 @@ mod test {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1552,34 +1552,35 @@ mod test {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1603,10 +1604,10 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
modified radicle/src/cob/issue/cache.rs
@@ -8,7 +8,7 @@ use crate::cob;
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -79,7 +79,7 @@ impl<'a, R, C> Cache<super::Issues<'a, R>, C> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified radicle/src/cob/patch.rs
@@ -475,7 +475,7 @@ impl Patch {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1410,7 +1410,7 @@ impl Revision {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1663,15 +1663,13 @@ impl<R: ReadRepository> store::Transaction<Patch, R> {
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1718,17 +1716,15 @@ impl<R: ReadRepository> store::Transaction<Patch, R> {
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1738,16 +1734,14 @@ impl<R: ReadRepository> store::Transaction<Patch, R> {
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1783,17 +1777,15 @@ impl<R: ReadRepository> store::Transaction<Patch, R> {
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1821,16 +1813,14 @@ impl<R: ReadRepository> store::Transaction<Patch, R> {
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -2011,7 +2001,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -2045,7 +2035,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -2079,7 +2069,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -2120,7 +2110,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -2140,7 +2130,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -2567,7 +2557,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified radicle/src/cob/store.rs
@@ -9,7 +9,7 @@ use radicle_cob::CollaborativeObject;
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -92,6 +92,10 @@ pub enum Error {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -148,12 +152,21 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -178,12 +191,21 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -263,7 +285,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -290,12 +312,12 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -311,7 +333,7 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified radicle/src/storage/git.rs
@@ -439,9 +439,13 @@ impl Repository {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|