make sshsigchain the only portable sigchain format
This commit is contained in:
parent
9e5871d02a
commit
73500e1944
15 changed files with 812 additions and 1603 deletions
|
|
@ -4,8 +4,8 @@ use geth_db::{CrSqliteChangeBatch, DbResource};
|
|||
use geth_discovery::{DiscoveredPeer, PeerCard};
|
||||
use geth_document::{DocumentResource, DocumentState};
|
||||
use geth_keychain::{
|
||||
KeychainAllowedSigner, KeychainCheckpoint, KeychainOp, KeychainOpSignature,
|
||||
KeychainSigchainEntry, KeychainSigchainReport, NodeEnrollmentRequest, NodeRecord,
|
||||
KeychainAllowedSigner, KeychainOp, KeychainOpSignature, KeychainSigchainReport,
|
||||
NodeEnrollmentRequest, NodeRecord,
|
||||
};
|
||||
use geth_kv::{KvEntry, KvResource, KvSyncEntry};
|
||||
use geth_overlay::{
|
||||
|
|
@ -266,34 +266,11 @@ pub enum ControlRequest {
|
|||
allowed_signers_path: Option<PathBuf>,
|
||||
principal: Option<String>,
|
||||
},
|
||||
KeychainSigchainExport {
|
||||
out: Option<PathBuf>,
|
||||
},
|
||||
KeychainPublishBundle {
|
||||
out: PathBuf,
|
||||
base_url: Option<String>,
|
||||
signing_key_path: PathBuf,
|
||||
admin_key_path: Option<PathBuf>,
|
||||
snapshots: Vec<String>,
|
||||
},
|
||||
KeychainVerifySigchain {
|
||||
input: PathBuf,
|
||||
},
|
||||
KeychainImportSigchain {
|
||||
input: PathBuf,
|
||||
},
|
||||
KeychainVerifyCheckpoint {
|
||||
checkpoint: PathBuf,
|
||||
signature: PathBuf,
|
||||
sigchain: PathBuf,
|
||||
allowed_signers: PathBuf,
|
||||
base_url: Option<String>,
|
||||
principal: Option<String>,
|
||||
},
|
||||
KeychainFetch {
|
||||
url: String,
|
||||
out: Option<PathBuf>,
|
||||
import: bool,
|
||||
chain_id: String,
|
||||
root_key_path: PathBuf,
|
||||
namespace: Option<String>,
|
||||
},
|
||||
KeychainExplain {
|
||||
op_id: String,
|
||||
|
|
@ -764,46 +741,15 @@ pub enum ControlResponse {
|
|||
principal: Option<String>,
|
||||
note: String,
|
||||
},
|
||||
KeychainSigchainExported {
|
||||
entries: Vec<KeychainSigchainEntry>,
|
||||
jsonl: String,
|
||||
out: Option<PathBuf>,
|
||||
note: String,
|
||||
},
|
||||
KeychainBundlePublished {
|
||||
out: PathBuf,
|
||||
base_url: String,
|
||||
allowed_signers_path: PathBuf,
|
||||
sigchain_path: PathBuf,
|
||||
checkpoint_path: PathBuf,
|
||||
checkpoint_signature_path: PathBuf,
|
||||
checkpoint: KeychainCheckpoint,
|
||||
snapshots: Vec<KeychainPublishedSnapshot>,
|
||||
note: String,
|
||||
},
|
||||
KeychainSigchainFileVerified {
|
||||
KeychainSigchainVerified {
|
||||
input: PathBuf,
|
||||
report: KeychainSigchainReport,
|
||||
note: String,
|
||||
},
|
||||
KeychainSigchainImported {
|
||||
input: PathBuf,
|
||||
ops_imported: usize,
|
||||
signatures_imported: usize,
|
||||
invalid_ops_rejected: usize,
|
||||
note: String,
|
||||
},
|
||||
KeychainCheckpointVerified {
|
||||
checkpoint: KeychainCheckpoint,
|
||||
verified: bool,
|
||||
principal: Option<String>,
|
||||
note: String,
|
||||
},
|
||||
KeychainFetched {
|
||||
url: String,
|
||||
out: PathBuf,
|
||||
checkpoint: KeychainCheckpoint,
|
||||
imported: Option<KeychainFetchImportReport>,
|
||||
chain_id: String,
|
||||
records: usize,
|
||||
head: String,
|
||||
active_admin_keys: usize,
|
||||
users: usize,
|
||||
devices: usize,
|
||||
nodes: usize,
|
||||
note: String,
|
||||
},
|
||||
KeychainExplained {
|
||||
|
|
@ -1151,22 +1097,6 @@ pub enum ControlResponse {
|
|||
},
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct KeychainFetchImportReport {
|
||||
pub ops_imported: usize,
|
||||
pub signatures_imported: usize,
|
||||
pub invalid_ops_rejected: usize,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct KeychainPublishedSnapshot {
|
||||
pub name: String,
|
||||
pub source: PathBuf,
|
||||
pub path: PathBuf,
|
||||
pub signature_path: PathBuf,
|
||||
pub namespace: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct StatusResponse {
|
||||
pub home: PathBuf,
|
||||
|
|
@ -1834,8 +1764,8 @@ mod tests {
|
|||
use super::*;
|
||||
use serde_json::{Map, Value, json};
|
||||
|
||||
const CONTROL_REQUEST_VARIANTS: usize = 123;
|
||||
const CONTROL_RESPONSE_VARIANTS: usize = 115;
|
||||
const CONTROL_REQUEST_VARIANTS: usize = 118;
|
||||
const CONTROL_RESPONSE_VARIANTS: usize = 110;
|
||||
const PEER_CONTROL_REQUEST_VARIANTS: usize = 19;
|
||||
const PEER_CONTROL_RESPONSE_VARIANTS: usize = 20;
|
||||
const PIPE_WIRE_REQUEST_VARIANTS: usize = 3;
|
||||
|
|
@ -2126,11 +2056,6 @@ mod tests {
|
|||
"devices": 1,
|
||||
"nodes": 1
|
||||
}),
|
||||
"KeychainFetchImportReport" => json!({
|
||||
"ops_imported": 1,
|
||||
"signatures_imported": 1,
|
||||
"invalid_ops_rejected": 0
|
||||
}),
|
||||
"ResourceDescriptor" => json!({
|
||||
"id": "resource:sample",
|
||||
"kind": "kv",
|
||||
|
|
@ -2269,27 +2194,6 @@ mod tests {
|
|||
"accepted_head": null,
|
||||
"note": "sample"
|
||||
}),
|
||||
"KeychainSigchainEntry" => json!({
|
||||
"op": sample_for_type("KeychainOp"),
|
||||
"signatures": []
|
||||
}),
|
||||
"KeychainCheckpoint" => json!({
|
||||
"version": 1,
|
||||
"profile": {
|
||||
"keychain_signature_namespace": "geth.keychain.v1@geth.local",
|
||||
"node_enrollment_request_namespace": "geth.node-enrollment-request.v1@geth.local",
|
||||
"default_admin_principal": "geth-admin"
|
||||
},
|
||||
"base_url": "https://example.invalid",
|
||||
"head": null,
|
||||
"ops": 1,
|
||||
"signatures": 1,
|
||||
"sigchain_bytes": 1,
|
||||
"sigchain_hash": "hash",
|
||||
"allowed_signers_hash": "hash",
|
||||
"reduced_view_hash": "hash",
|
||||
"generated_at": 1
|
||||
}),
|
||||
"AuthExplanation" => json!({
|
||||
"subject": "node:peer",
|
||||
"resource": "resource:sample",
|
||||
|
|
|
|||
Loading…
Reference in a new issue