pub struct IdentifyResponse {
pub gateway_identity: Did,
pub sphere_identity: Did,
pub signature: String,
pub proof: String,
}
Expand description
The response from the “identify” API route; this is a signed response that allows the client to verify the authority of the API host
Fields§
§gateway_identity: Did
The DID of the API host
sphere_identity: Did
The DID of the “counterpart” sphere
signature: String
The signature of the API host over this payload, as base64-encoded bytes
proof: String
The proof that the API host was authorized by the “counterpart” sphere in the form of a UCAN JWT
Implementations§
Source§impl IdentifyResponse
impl IdentifyResponse
pub async fn sign<K>(
sphere_identity: &str,
key: &K,
proof: &Ucan,
) -> Result<Self>where
K: KeyMaterial,
Sourcepub async fn verify<S: UcanStore>(
&self,
did_parser: &mut DidParser,
store: &S,
) -> Result<()>
pub async fn verify<S: UcanStore>( &self, did_parser: &mut DidParser, store: &S, ) -> Result<()>
Verifies that the signature scheme on the payload. The signature is made by signing the bytes of the gateway’s key DID plus the bytes of the sphere DID that the gateway claims to manage. Remember: this sphere is not the user’s sphere, but rather the “counterpart” sphere created and modified by the gateway. Additionally, a proof is given that the gateway has been authorized to modify its own sphere.
This verification is intended to check two things:
- The gateway has control of the key that it represents with its DID
- The gateway is authorized to modify the sphere it claims to manage
Trait Implementations§
Source§impl Clone for IdentifyResponse
impl Clone for IdentifyResponse
Source§fn clone(&self) -> IdentifyResponse
fn clone(&self) -> IdentifyResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more