Move identity::signatures to json_signatures module

This commit is contained in:
silverpill 2023-03-14 20:47:27 +00:00
parent 8b8f1bb678
commit 1d4bb200d2
7 changed files with 22 additions and 16 deletions

View file

@ -11,7 +11,10 @@ use crate::identity::{
claims::create_identity_claim, claims::create_identity_claim,
did::Did, did::Did,
minisign::verify_minisign_identity_proof, minisign::verify_minisign_identity_proof,
signatures::{PROOF_TYPE_ID_EIP191, PROOF_TYPE_ID_MINISIGN}, };
use crate::json_signatures::proofs::{
PROOF_TYPE_ID_EIP191,
PROOF_TYPE_ID_MINISIGN,
}; };
use crate::models::profiles::types::{ use crate::models::profiles::types::{
ExtraField, ExtraField,

View file

@ -10,14 +10,17 @@ use crate::http_signatures::verify::{
verify_http_signature, verify_http_signature,
HttpSignatureVerificationError as HttpSignatureError, HttpSignatureVerificationError as HttpSignatureError,
}; };
use crate::identity::{did::Did, signatures::ProofType}; use crate::identity::did::Did;
use crate::json_signatures::verify::{ use crate::json_signatures::{
get_json_signature, proofs::ProofType,
verify_ed25519_json_signature, verify::{
verify_eip191_json_signature, get_json_signature,
verify_rsa_json_signature, verify_ed25519_json_signature,
JsonSignatureVerificationError as JsonSignatureError, verify_eip191_json_signature,
JsonSigner, verify_rsa_json_signature,
JsonSignatureVerificationError as JsonSignatureError,
JsonSigner,
},
}; };
use crate::models::{ use crate::models::{
profiles::queries::get_profile_by_remote_actor_id, profiles::queries::get_profile_by_remote_actor_id,

View file

@ -3,4 +3,3 @@ pub mod did;
pub mod did_key; pub mod did_key;
pub mod did_pkh; pub mod did_pkh;
pub mod minisign; pub mod minisign;
pub mod signatures;

View file

@ -15,11 +15,11 @@ use mitra_utils::{
use crate::identity::{ use crate::identity::{
did_key::DidKey, did_key::DidKey,
did_pkh::DidPkh, did_pkh::DidPkh,
signatures::{ };
PROOF_TYPE_JCS_ED25519, use super::proofs::{
PROOF_TYPE_JCS_EIP191, PROOF_TYPE_JCS_ED25519,
PROOF_TYPE_JCS_RSA, PROOF_TYPE_JCS_EIP191,
}, PROOF_TYPE_JCS_RSA,
}; };
pub(super) const PROOF_KEY: &str = "proof"; pub(super) const PROOF_KEY: &str = "proof";

View file

@ -1,2 +1,3 @@
pub mod create; pub mod create;
pub mod proofs;
pub mod verify; pub mod verify;

View file

@ -19,13 +19,13 @@ use crate::identity::{
did_key::DidKey, did_key::DidKey,
did_pkh::DidPkh, did_pkh::DidPkh,
minisign::verify_ed25519_signature, minisign::verify_ed25519_signature,
signatures::ProofType,
}; };
use super::create::{ use super::create::{
IntegrityProof, IntegrityProof,
PROOF_KEY, PROOF_KEY,
PROOF_PURPOSE, PROOF_PURPOSE,
}; };
use super::proofs::ProofType;
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
pub enum JsonSigner { pub enum JsonSigner {