Skip to content
Juvix imports

module arch.node.engines.reads_for_messages;

import prelude open;
import arch.node.types.identities open;

Reads For Messages

Message interface

type ReadsForMsg :=
| ReadsForRequest {
externalIdentityA : ExternalIdentity;
externalIdentityB : ExternalIdentity
}
| ReadsForResponse {
readsFor : Bool;
err : Option String
}
| SubmitReadsForEvidenceRequest {evidence : ReadsForEvidence}
| SubmitReadsForEvidenceResponse {err : Option String}
| QueryReadsForEvidenceRequest {externalIdentity : ExternalIdentity}
| QueryReadsForEvidenceResponse {
externalIdentity : ExternalIdentity;
evidence : Set ReadsForEvidence;
err : Option String
};

ReadsForRequest message

ReadsForRequest

ReadsForRequest {
  externalIdentityA : ExternalIdentity;
  externalIdentityB : ExternalIdentity
}

A ReadsForRequest queries whether externalIdentityA can read data encrypted to externalIdentityB.

  • externalIdentityA: The identity attempting to read the data.
  • externalIdentityB: The identity for whom the data was originally encrypted.

ReadsForResponse message

ReadsForResponse

ReadsForResponse {
  readsFor : Bool;
  err : Option String
}

A ReadsForResponse indicates whether the reads_for relationship exists.

  • readsFor: True if externalIdentityA can read for externalIdentityB, False otherwise.
  • err: An error message if the query failed.

SubmitReadsForEvidenceRequest message

SubmitReadsForEvidenceRequest

SubmitReadsForEvidenceRequest {
  evidence : ReadsForEvidence
}

A SubmitReadsForEvidenceRequest submits evidence of a reads_for relationship.

  • evidence: The evidence supporting the reads_for relationship.

SubmitReadsForEvidenceResponse message

SubmitReadsForEvidenceResponse

SubmitReadsForEvidenceResponse {
  err : Option String
}

A SubmitReadsForEvidenceResponse acknowledges the submission of evidence.

  • err: An error message if the submission failed.

QueryReadsForEvidenceRequest message

QueryReadsForEvidenceRequest

QueryReadsForEvidenceRequest {
  externalIdentity : ExternalIdentity
}

A QueryReadsForEvidenceRequest queries all reads_for evidence related to an identity.

  • externalIdentity: The identity for which to retrieve evidence.

QueryReadsForEvidenceResponse message

QueryReadsForEvidenceResponse

QueryReadsForEvidenceResponse {
  externalIdentity : ExternalIdentity;
  evidence : Set ReadsForEvidence;
  err : Option String
}

A QueryReadsForEvidenceResponse provides the requested evidence.

  • evidence: A set of ReadsForEvidence related to the identity.
  • err: An error message if the query failed.

Message sequence diagrams

Submitting Reads For Evidence

sequenceDiagram
    participant Client
    participant ReadsForEngine

    Client->>ReadsForEngine: SubmitReadsForEvidenceRequest
    Note over ReadsForEngine: Verify and store evidence
    ReadsForEngine->>Client: SubmitReadsForEvidenceResponse
Submitting reads_for evidence

Querying Reads For Relationship

sequenceDiagram
    participant Client
    participant ReadsForEngine

    Client->>ReadsForEngine: ReadsForRequest (A reads for B?)
    Note over ReadsForEngine: Check stored evidence
    ReadsForEngine->>Client: ReadsForResponse
Querying a reads_for relationship

Querying Reads For Evidence

sequenceDiagram
    participant Client
    participant ReadsForEngine

    Client->>ReadsForEngine: QueryReadsForEvidenceRequest (for X)
    Note over ReadsForEngine: Retrieve relevant evidence
    ReadsForEngine->>Client: QueryReadsForEvidenceResponse
Querying reads_for evidence for an identity

Engine Components

  • Reads For Engine Environment
  • Reads For Engine Dynamics