Skip to content

Commit 98b60c1

Browse files
committed
All of the sendables
1 parent 267bb41 commit 98b60c1

File tree

10 files changed

+324
-227
lines changed

10 files changed

+324
-227
lines changed

keyhive_core/src/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl<F: FutureForm, S: AsyncSigner<F>, T: ContentRef, L: MembershipListener<F, S
5858
{
5959
#[allow(clippy::type_complexity)]
6060
#[instrument(level = "debug", skip(ciphertext_store))]
61-
pub async fn now_decryptable<P, C: CiphertextStore<T, P>>(
61+
pub async fn now_decryptable<P, C: CiphertextStore<F, T, P>>(
6262
new_events: &[Event<F, S, T, L>],
6363
ciphertext_store: &C,
6464
) -> Result<HashMap<DocumentId, Vec<Arc<EncryptedContent<P, T>>>>, C::GetCiphertextError> {

keyhive_core/src/invocation.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use keyhive_crypto::{
1111
use serde::{Deserialize, Serialize};
1212
use std::sync::Arc;
1313

14+
#[allow(clippy::type_complexity)]
1415
#[derive(Debug, PartialEq, Eq, Hash)]
1516
#[derive_where(Clone; T)]
1617
pub struct Invocation<

keyhive_core/src/keyhive.rs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ use crate::{
4040
},
4141
stats::Stats,
4242
store::{
43-
ciphertext::{memory::MemoryCiphertextStore, CausalDecryptionState, CiphertextStore},
43+
ciphertext::{
44+
memory::MemoryCiphertextStore, CausalDecryptionState, CiphertextStore,
45+
CiphertextStoreExt,
46+
},
4447
delegation::DelegationStore,
4548
revocation::RevocationStore,
4649
},
@@ -82,7 +85,7 @@ pub struct Keyhive<
8285
S: AsyncSigner<F> + Clone,
8386
T: ContentRef = [u8; 32],
8487
P: for<'de> Deserialize<'de> = Vec<u8>,
85-
C: CiphertextStore<T, P> + Clone = MemoryCiphertextStore<T, P>,
88+
C: CiphertextStore<F, T, P> + CiphertextStoreExt<F, T, P> + Clone = MemoryCiphertextStore<T, P>,
8689
L: MembershipListener<F, S, T> = NoListener,
8790
R: rand::CryptoRng = rand::rngs::OsRng,
8891
> {
@@ -129,7 +132,7 @@ impl<
129132
S: AsyncSigner<F> + Clone,
130133
T: ContentRef,
131134
P: for<'de> Deserialize<'de>,
132-
C: CiphertextStore<T, P> + Clone,
135+
C: CiphertextStore<F, T, P> + CiphertextStoreExt<F, T, P> + Clone,
133136
L: MembershipListener<F, S, T>,
134137
R: rand::CryptoRng + rand::RngCore,
135138
> Keyhive<F, S, T, P, C, L, R>
@@ -529,7 +532,7 @@ impl<
529532
&self,
530533
doc: Arc<Mutex<Document<F, S, T, L>>>,
531534
encrypted: &EncryptedContent<P, T>,
532-
) -> Result<CausalDecryptionState<T, P>, DocCausalDecryptionError<T, P, C>>
535+
) -> Result<CausalDecryptionState<T, P>, DocCausalDecryptionError<F, T, P, C>>
533536
where
534537
T: for<'de> Deserialize<'de>,
535538
P: Serialize + Clone,
@@ -562,6 +565,7 @@ impl<
562565
}
563566

564567
#[instrument(skip_all)]
568+
#[allow(clippy::type_complexity)]
565569
pub async fn reachable_members(
566570
&self,
567571
membered: Membered<F, S, T, L>,
@@ -597,6 +601,7 @@ impl<
597601
caps
598602
}
599603

604+
#[allow(clippy::type_complexity)]
600605
#[instrument(skip_all)]
601606
pub async fn membered_reachable_by_agent(
602607
&self,
@@ -1181,6 +1186,7 @@ impl<
11811186
None
11821187
}
11831188

1189+
#[allow(clippy::type_complexity)]
11841190
#[instrument(skip_all)]
11851191
pub async fn static_event_to_event(
11861192
&self,
@@ -1209,6 +1215,7 @@ impl<
12091215
}
12101216
}
12111217

1218+
#[allow(clippy::type_complexity)]
12121219
#[instrument(skip_all)]
12131220
async fn static_delegation_to_delegation(
12141221
&self,
@@ -2210,7 +2217,7 @@ impl<
22102217
S: AsyncSigner<F> + Clone,
22112218
T: ContentRef + Debug,
22122219
P: for<'de> Deserialize<'de>,
2213-
C: CiphertextStore<T, P> + Clone,
2220+
C: CiphertextStore<F, T, P> + CiphertextStoreExt<F, T, P> + Clone,
22142221
L: MembershipListener<F, S, T>,
22152222
R: rand::CryptoRng + rand::RngCore,
22162223
> Debug for Keyhive<F, S, T, P, C, L, R>
@@ -2234,7 +2241,7 @@ impl<
22342241
S: AsyncSigner<F> + Clone,
22352242
T: ContentRef + Clone,
22362243
P: for<'de> Deserialize<'de> + Clone,
2237-
C: CiphertextStore<T, P> + Clone,
2244+
C: CiphertextStore<F, T, P> + CiphertextStoreExt<F, T, P> + Clone,
22382245
L: MembershipListener<F, S, T>,
22392246
R: rand::CryptoRng + rand::RngCore + Clone,
22402247
> ForkAsync for Keyhive<F, S, T, P, C, L, R>
@@ -2263,7 +2270,7 @@ impl<
22632270
S: AsyncSigner<F> + Clone,
22642271
T: ContentRef + Clone,
22652272
P: for<'de> Deserialize<'de> + Clone,
2266-
C: CiphertextStore<T, P> + Clone,
2273+
C: CiphertextStore<F, T, P> + CiphertextStoreExt<F, T, P> + Clone,
22672274
L: MembershipListener<F, S, T>,
22682275
R: rand::CryptoRng + rand::RngCore + Clone,
22692276
> MergeAsync for Arc<Mutex<Keyhive<F, S, T, P, C, L, R>>>
@@ -2315,7 +2322,7 @@ impl<
23152322
S: AsyncSigner<F> + Clone,
23162323
T: ContentRef,
23172324
P: for<'de> Deserialize<'de>,
2318-
C: CiphertextStore<T, P> + Clone,
2325+
C: CiphertextStore<F, T, P> + CiphertextStoreExt<F, T, P> + Clone,
23192326
L: MembershipListener<F, S, T>,
23202327
R: rand::CryptoRng + rand::RngCore,
23212328
> Verifiable for Keyhive<F, S, T, P, C, L, R>

keyhive_core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
nonstandard_style
99
)]
1010
#![deny(unreachable_pub)]
11+
#![allow(clippy::type_complexity)]
1112

1213
pub mod ability;
1314
pub mod access;

keyhive_core/src/principal/document.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ use crate::{
2020
identifier::Identifier,
2121
},
2222
store::{
23-
ciphertext::{CausalDecryptionError, CausalDecryptionState, CiphertextStore, ErrorReason},
23+
ciphertext::{
24+
CausalDecryptionError, CausalDecryptionState, CiphertextStore, CiphertextStoreExt,
25+
ErrorReason,
26+
},
2427
delegation::DelegationStore,
2528
revocation::RevocationStore,
2629
},
@@ -499,13 +502,13 @@ impl<F: FutureForm, S: AsyncSigner<F>, T: ContentRef, L: MembershipListener<F, S
499502

500503
#[instrument(skip_all)]
501504
pub async fn try_causal_decrypt_content<
502-
C: CiphertextStore<T, P>,
505+
C: CiphertextStore<F, T, P> + CiphertextStoreExt<F, T, P>,
503506
P: for<'de> Deserialize<'de> + Serialize + Clone,
504507
>(
505508
&mut self,
506509
encrypted_content: &EncryptedContent<P, T>,
507510
store: C,
508-
) -> Result<CausalDecryptionState<T, P>, DocCausalDecryptionError<T, P, C>>
511+
) -> Result<CausalDecryptionState<T, P>, DocCausalDecryptionError<F, T, P, C>>
509512
where
510513
T: for<'de> Deserialize<'de>,
511514
{
@@ -516,7 +519,7 @@ impl<F: FutureForm, S: AsyncSigner<F>, T: ContentRef, L: MembershipListener<F, S
516519
let entrypoint_envelope: Envelope<T, Vec<u8>> = bincode::deserialize(
517520
raw_entrypoint.as_slice(),
518521
)
519-
.map_err(|e| CausalDecryptionError::<T, P, C> {
522+
.map_err(|e| CausalDecryptionError::<F, T, P, C> {
520523
progress: acc.clone(),
521524
cannot: HashMap::from_iter([(
522525
encrypted_content.content_ref.clone(),
@@ -682,9 +685,9 @@ pub enum GenerateDocError {
682685
}
683686

684687
#[derive(Debug, Error)]
685-
pub enum DocCausalDecryptionError<T: ContentRef, P, C: CiphertextStore<T, P>> {
688+
pub enum DocCausalDecryptionError<F: FutureForm, T: ContentRef, P, C: CiphertextStore<F, T, P>> {
686689
#[error(transparent)]
687-
CausalDecryptionError(#[from] CausalDecryptionError<T, P, C>),
690+
CausalDecryptionError(#[from] CausalDecryptionError<F, T, P, C>),
688691

689692
#[error("{0}")]
690693
GetCiphertextError(C::GetCiphertextError),

keyhive_core/src/principal/group.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,10 @@ use thiserror::Error;
7474
/// A collection of agents with no associated content.
7575
///
7676
/// Groups are stateful agents. It is possible the delegate control over them,
77-
7877
/// and they can be delegated to. This produces transitives lines of authority
79-
8078
/// through the network of [`Agent`]s.
81-
8279
#[derive(Clone, Derivative)]
8380
#[derive_where(Debug; T)]
84-
8581
pub struct Group<
8682
F: FutureForm,
8783
S: AsyncSigner<F>,

0 commit comments

Comments
 (0)