qualia_core_db/bundle/stream/policy/remote/
mod.rs1mod codec;
5mod decision;
6mod policy;
7mod recognition;
8mod issuer;
9mod grant;
10mod current;
11
12pub use codec::{
13 decode_decision_ticket, encode_decision_ticket_into, ticket_package_len, DecisionTicketFields,
14 DisclosureAction, DECISION_TICKET_BYTES, MAX_TICKET_PACKAGE_BYTES,
15};
16pub use decision::{check_recipient_against_independent, DisclosureDecision, IndependentAdmission};
17pub use policy::{
18 bind_policy_to_closure, decode_disclosure_policy, encode_disclosure_policy_into, ClosureBudget,
19 DisclosurePolicyFields, DisclosurePolicyView, SourceCoverage, MAX_CLOSURE_LABELS,
20 MAX_DISCLOSURE_POLICY_BYTES,
21};
22pub use recognition::{
23 AllowedOps, ControllerRecognition, RecognitionAdmin, RecognitionEnrollment, RecognitionHandle,
24 RecognizedController, MAX_RECOGNIZED,
25};
26pub use issuer::fresh_challenge;
27#[cfg(not(target_arch = "wasm32"))]
28pub use issuer::{issue_disclosure, IssueBuffers, IssueRequest, IssuedLengths, ManagedSigners};
29pub use grant::{
30 install_remote_disclosure, InstallRequest, RemoteDisclosureGrant, VerifierChallengeSlot,
31};
32
33#[cfg(test)]
34mod lifecycle_tests;
35
36use super::PolicyError;
37use crate::crypto::network::errors::CryptoError;
38use crate::governance::consent_contract::ConsentLedger;
39use crate::net::qdnf::authority::PolicyOutcome;
40use crate::net::qdnf::policy_labels::VerifiedLabel;
41use crate::sensing::signed_scope::SignedSensingScope;
42
43pub use crate::crypto::network::object_stream::{
46 RecipientRecord, RECIPIENT_BYTES, RECIPIENT_PURPOSE,
47};
48
49pub const DISCLOSURE_DECISION_PURPOSE: &[u8] = b"qbdl-stream-protected-v1/disclosure-decision";
51pub const MAX_DECISION_LEASE_SECS: u64 = 30;
52pub const REMOTE_AUTHORIZATION_BYTES: usize = RECIPIENT_BYTES;
53
54pub fn refuse_wire_role_install(_role: u8) -> PolicyError {
56 PolicyError::Crypto(CryptoError::Unauthorized)
57}
58
59pub fn refuse_delegation_chain(_chain: &[u8]) -> PolicyError {
61 PolicyError::Crypto(CryptoError::Unsupported)
62}
63
64pub fn refuse_all_subjects_consented_flag(_flag: bool) -> PolicyError {
66 PolicyError::Reference
67}
68
69pub fn refuse_verified_label_as_issuer(_label: &VerifiedLabel) -> PolicyError {
71 PolicyError::Reference
72}
73
74pub fn refuse_consent_ledger_as_pq_source_auth(_ledger: &ConsentLedger) -> PolicyError {
76 PolicyError::Crypto(CryptoError::Unsupported)
77}
78
79pub fn refuse_signed_sensing_scope_as_whole_source(_scope: &SignedSensingScope) -> PolicyError {
81 PolicyError::Crypto(CryptoError::Unsupported)
82}
83
84pub fn refuse_policy_outcome(outcome: PolicyOutcome) -> PolicyError {
86 let _ = outcome;
87 PolicyError::Reference
88}
89
90pub fn refuse_bool_authority(_allow: bool) -> PolicyError {
92 PolicyError::Reference
93}
94
95#[cfg(test)]
96mod tests;