KERIA App API¶
keria.app.agenting¶
KERIA keria.app.agenting module
- class keria.app.agenting.Admitter(hby, witq, psr, agentHab, exc, admits)[source]¶
- recur(tyme)[source]¶
Do ‘recur’ context actions. Override in subclass. Regular method that perform repetitive actions once per invocation. Assumes resource setup in .enter() and resource takedown in .exit() (see ReDoer below for example of .recur that is a generator method)
- Returns completion state of recurrence actions.
True means done False means continue
- Parameters:
here. (Doist feeds its .tyme through .send to .do yield which passes it) –
.recur maybe implemented by a subclass either as a non-generator method or a generator method. This stub here is as a non-generator method. The base class .do detects which type:
- If non-generator .do method runs .recur method once per iteration
until .recur returns (True)
- If generator .do method runs .recur with (yield from) until .recur
returns (see ReDoer for example of generator .recur)
- class keria.app.agenting.Agency(name, bran, base='', configFile=None, configDir=None, adb=None, temp=False)[source]¶
- class keria.app.agenting.Agent(hby, rgy, agentHab, agency, caid, **opts)[source]¶
The top level object and DoDoer representing a Habery for a remote controller and all associated processing
- class keria.app.agenting.BootEnd(agency)[source]¶
Resource class for creating datastore in cloud ahab
- on_post(req, rep)[source]¶
Inception event POST endpoint
Give me a new Agent. Create Habery using ctrlPRE as database name, agentHab that anchors the caid and returns the KEL of agentHAB Stores ControllerPRE -> AgentPRE in database
- Parameters:
req (Request) – falcon.Request HTTP request object
rep (Response) – falcon.Response HTTP response object
- class keria.app.agenting.Delegator(agentHab, swain, anchors)[source]¶
- recur(tyme=None)[source]¶
Do ‘recur’ context actions. Override in subclass. Regular method that perform repetitive actions once per invocation. Assumes resource setup in .enter() and resource takedown in .exit() (see ReDoer below for example of .recur that is a generator method)
- Returns completion state of recurrence actions.
True means done False means continue
- Parameters:
here. (Doist feeds its .tyme through .send to .do yield which passes it) –
.recur maybe implemented by a subclass either as a non-generator method or a generator method. This stub here is as a non-generator method. The base class .do detects which type:
- If non-generator .do method runs .recur method once per iteration
until .recur returns (True)
- If generator .do method runs .recur with (yield from) until .recur
returns (see ReDoer for example of generator .recur)
- class keria.app.agenting.ExchangeCueDoer(seeker, cues, queries)[source]¶
- recur(tyme=None)[source]¶
Do ‘recur’ context actions. Override in subclass. Regular method that perform repetitive actions once per invocation. Assumes resource setup in .enter() and resource takedown in .exit() (see ReDoer below for example of .recur that is a generator method)
- Returns completion state of recurrence actions.
True means done False means continue
- Parameters:
here. (Doist feeds its .tyme through .send to .do yield which passes it) –
.recur maybe implemented by a subclass either as a non-generator method or a generator method. This stub here is as a non-generator method. The base class .do detects which type:
- If non-generator .do method runs .recur method once per iteration
until .recur returns (True)
- If generator .do method runs .recur with (yield from) until .recur
returns (see ReDoer for example of generator .recur)
- class keria.app.agenting.ExchangeSender(hby, agentHab, exc, exchanges)[source]¶
- recur(tyme, deeds=None)[source]¶
Do ‘recur’ context actions. Equivalent of Doist.recur
- Parameters:
tyme (float) –
- is output of send fed to do yield, The root scheduler
Doist feeds its .tyme which propagates down the chain of DoDoers Because tymist is injected by doist or dodoer, self.tyme is same as tyme. So may use either which is more convenient.
- deeds (deque): tuples of form (dog, retyme, doer).
If not provided uses .deeds. Parameterization here of deeds enables some special cases.
- Returns completion state of recurrence actions.
True means done False means continue
Cycle once through deeds deque and update in place
Each cycle checks all generators dogs in deeds deque and runs if retyme past.
- class keria.app.agenting.Granter(hby, rgy, agentHab, exc, grants)[source]¶
- recur(tyme, deeds=None)[source]¶
Do ‘recur’ context actions. Equivalent of Doist.recur
- Parameters:
tyme (float) –
- is output of send fed to do yield, The root scheduler
Doist feeds its .tyme which propagates down the chain of DoDoers Because tymist is injected by doist or dodoer, self.tyme is same as tyme. So may use either which is more convenient.
- deeds (deque): tuples of form (dog, retyme, doer).
If not provided uses .deeds. Parameterization here of deeds enables some special cases.
- Returns completion state of recurrence actions.
True means done False means continue
Cycle once through deeds deque and update in place
Each cycle checks all generators dogs in deeds deque and runs if retyme past.
- class keria.app.agenting.HealthEnd[source]¶
Health resource for determining that a container is live
- class keria.app.agenting.ParserDoer(kvy, parser)[source]¶
- recur(tyme=None)[source]¶
Do ‘recur’ context actions. Override in subclass. Regular method that perform repetitive actions once per invocation. Assumes resource setup in .enter() and resource takedown in .exit() (see ReDoer below for example of .recur that is a generator method)
- Returns completion state of recurrence actions.
True means done False means continue
- Parameters:
here. (Doist feeds its .tyme through .send to .do yield which passes it) –
.recur maybe implemented by a subclass either as a non-generator method or a generator method. This stub here is as a non-generator method. The base class .do detects which type:
- If non-generator .do method runs .recur method once per iteration
until .recur returns (True)
- If generator .do method runs .recur with (yield from) until .recur
returns (see ReDoer for example of generator .recur)
- class keria.app.agenting.SeekerDoer(seeker, cues)[source]¶
- recur(tyme=None)[source]¶
Do ‘recur’ context actions. Override in subclass. Regular method that perform repetitive actions once per invocation. Assumes resource setup in .enter() and resource takedown in .exit() (see ReDoer below for example of .recur that is a generator method)
- Returns completion state of recurrence actions.
True means done False means continue
- Parameters:
here. (Doist feeds its .tyme through .send to .do yield which passes it) –
.recur maybe implemented by a subclass either as a non-generator method or a generator method. This stub here is as a non-generator method. The base class .do detects which type:
- If non-generator .do method runs .recur method once per iteration
until .recur returns (True)
- If generator .do method runs .recur with (yield from) until .recur
returns (see ReDoer for example of generator .recur)
- class keria.app.agenting.Witnesser(receiptor, witners)[source]¶
- recur(tyme=None)[source]¶
Do ‘recur’ context actions. Override in subclass. Regular method that perform repetitive actions once per invocation. Assumes resource setup in .enter() and resource takedown in .exit() (see ReDoer below for example of .recur that is a generator method)
- Returns completion state of recurrence actions.
True means done False means continue
- Parameters:
here. (Doist feeds its .tyme through .send to .do yield which passes it) –
.recur maybe implemented by a subclass either as a non-generator method or a generator method. This stub here is as a non-generator method. The base class .do detects which type:
- If non-generator .do method runs .recur method once per iteration
until .recur returns (True)
- If generator .do method runs .recur with (yield from) until .recur
returns (see ReDoer for example of generator .recur)
- keria.app.agenting.createHttpServer(port, app, keypath=None, certpath=None, cafilepath=None)[source]¶
Create an HTTP or HTTPS server depending on whether TLS key material is present
- Parameters:
port (int) – port to listen on for all HTTP(s) server instances
app (falcon.App) – application instance to pass to the http.Server instance
keypath (string) – the file path to the TLS private key
certpath (string) – the file path to the TLS signed certificate (public key)
cafilepath (string) – the file path to the TLS CA certificate chain file
- Returns:
hio.core.http.Server
keria.app.aiding¶
KERIA keria.app.aiding module
- class keria.app.aiding.AgentResourceEnd(agency, authn)[source]¶
Resource class for getting agent specific launch information
- class keria.app.aiding.ChallengeCollectionEnd[source]¶
Resource for Challenge/Response Endpoints
- static on_get(req, rep)[source]¶
Challenge GET endpoint
- Parameters:
req – falcon.Request HTTP request
rep – falcon.Response HTTP response
— summary: Get random list of words for a 2 factor auth challenge description: Get the list of identifiers associated with this agent tags:
Challenge/Response
- Parameters:
in (-) –
query name: strength schema:
type: int
description: cryptographic strength of word list required: false
- responses:
- 200:
description: An array of random words content:
- application/json:
- schema:
description: Random word list type: object properties:
- words:
type: array description: random challenge word list items:
type: string
- class keria.app.aiding.ChallengeResourceEnd[source]¶
Resource for Challenge/Response Endpoints
- static on_post(req, rep, name)[source]¶
Challenge POST endpoint
- Parameters:
req – falcon.Request HTTP request
rep – falcon.Response HTTP response
name – human readable name of identifier to use to sign the challenge/response
— summary: Sign challenge message and forward to peer identifier description: Sign a challenge word list received out of bands and send exn peer to peer message
to recipient
- tags:
Challenge/Response
- Parameters:
in (-) –
path name: name schema:
type: string
required: true description: Human readable alias for the identifier to create
- requestBody:
required: true content:
- application/json:
- schema:
description: Challenge response properties:
- recipient:
type: string description: human readable alias recipient identifier to send signed challenge to
- words:
type: array description: challenge in form of word list items:
type: string
- responses:
- 202:
description: Success submission of signed challenge/response
- class keria.app.aiding.ChallengeVerifyResourceEnd[source]¶
Resource for Challenge/Response Verification Endpoints
- static on_post(req, rep, source)[source]¶
Challenge POST endpoint
- Parameters:
req – falcon.Request HTTP request
rep – falcon.Response HTTP response
source – qb64 AID of of source of signed response to verify
— summary: Sign challenge message and forward to peer identifier description: Sign a challenge word list received out of bands and send exn peer to peer message
to recipient
- tags:
Challenge/Response
- Parameters:
in (-) –
path name: name schema:
type: string
required: true description: Human readable alias for the identifier to create
- requestBody:
required: true content:
- application/json:
- schema:
description: Challenge response properties:
- recipient:
type: string description: human readable alias recipient identifier to send signed challenge to
- words:
type: array description: challenge in form of word list items:
type: string
- responses:
- 202:
description: Success submission of signed challenge/response
- static on_put(req, rep, source)[source]¶
Challenge PUT accept endpoint
- Parameters:
req – falcon.Request HTTP request
rep – falcon.Response HTTP response
source – qb64 AID of of source of signed response to verify
— summary: Mark challenge response exn message as signed description: Mark challenge response exn message as signed tags:
Challenge/Response
- Parameters:
in (-) –
path name: name schema:
type: string
required: true description: Human readable alias for the identifier to create
- requestBody:
required: true content:
- application/json:
- schema:
description: Challenge response properties:
- aid:
type: string description: aid of signer of accepted challenge response
- said:
type: array description: SAID of challenge message signed items:
type: string
- responses:
- 202:
description: Success submission of signed challenge/response
- class keria.app.aiding.IdentifierCollectionEnd[source]¶
Resource class for creating and managing identifiers
- class keria.app.aiding.IdentifierOOBICollectionEnd[source]¶
This class represents the OOBI subresource collection endpoint for identifiers
keria.app.credentialing¶
KERIA keria.app.credentialing module
services and endpoint for ACDC credential managements
- class keria.app.credentialing.CredentialQueryCollectionEnd[source]¶
This class provides a collection endpoint for creating credential queries.
I fully admit that the semantics here are a big stretch. I would rather have this as a GET against the credential collection endpoint, but the nature of the complicated input to this endpoint dictate a BODY and certain client libraries (and possibly reverse proxies) don’t support a BODY in a GET request. So I’m moving the credential query code to this endpoint class and mapping to …/credentials/queries and making it a post against that path and calling it “creating a creaential query”. Meh.
- static on_post(req, rep)[source]¶
Credentials GET endpoint
- Parameters:
req – falcon.Request HTTP request
rep – falcon.Response HTTP response
— summary: List credentials in credential store (wallet) description: List issued or received credentials current verified tags:
Credentials
- Parameters:
in (-) –
path name: aid schema:
type: string
required: true description: identifier to load credentials for
in –
query name: type schema:
type: string
description: type of credential to return, [issued|received] required: true
in –
query name: schema schema:
type: string
description: schema to filter by if provided required: false
- responses:
- 200:
description: Credential list. content:
- application/json:
- schema:
description: Credentials type: array items:
type: object
- class keria.app.credentialing.RegistryCollectionEnd(identifierResource)[source]¶
ReST API for admin of credential issuance and revocation registries
- static on_get(req, rep, name)[source]¶
Registries GET endpoint
- Parameters:
req – falcon.Request HTTP request
rep – falcon.Response HTTP response
name (str) – human readable name for AID
— summary: List credential issuance and revocation registies description: List credential issuance and revocation registies tags:
Registries
- responses:
- 200:
description: array of current credential issuance and revocation registies
- on_post(req, rep, name)[source]¶
Registries POST endpoint
- Parameters:
req – falcon.Request HTTP request
rep – falcon.Response HTTP response
name (str) – AID of Hab to load credentials for
— summary: Request to create a credential issuance and revocation registry description: Request to create a credential issuance and revocation registry tags:
Registries
- requestBody:
required: true content:
- application/json:
- schema:
type: object properties:
- name:
type: string description: name of the new registry
- alias:
type: string description: name of identifier to associate as the issuer of the new credential registry
- toad:
type: integer description: Backer receipt threshold
- nonce:
type: string description: qb64 encoded ed25519 random seed for registry
- noBackers:
type: boolean required: False description: True means to not allow seperate backers from identifier’s witnesses.
- baks:
type: array items:
type: string
description: List of qb64 AIDs of witnesses to be used for the new group identifier.
- estOnly:
type: boolean required: false default: false description: True means to not allow interaction events to anchor credential events.
- responses:
- 202:
description: registry inception request has been submitted
- keria.app.credentialing.signPaths(hab, pather, sigers)[source]¶
Sign the SAD or SAIDs with the keys from the Habitat.
Sign the SADs or SAIDs of the SADs as identified by the paths.
- Parameters:
hab (Habitat) – environment used to sign the SAD
pather (Pather) – Pather for the signatures
sigers (list) – list of signatures over the paths
- Returns:
pathed signature tuples
- Return type:
list
keria.app.indirecting¶
KERIA keria.app.indirecting module
simple indirect mode demo support classes
- class keria.app.indirecting.HttpEnd(agency)[source]¶
HTTP handler that accepts and KERI events POSTed as the body of a request with all attachments to the message as a CESR attachment HTTP header. KEL Messages are processed and added to the database of the provided Habitat.
This also handles req, exn and tel messages that respond with a KEL replay.
- on_post(req, rep)[source]¶
Handles POST for KERI event messages.
- Parameters:
req (Request) –
rep (Response) –
— summary: Accept KERI events with attachment headers and parse description: Accept KERI events with attachment headers and parse. tags:
Events
- requestBody:
required: true content:
- application/json:
- schema:
type: object description: KERI event message
- responses:
- 204:
description: KEL EXN, QRY, RPY event accepted.
- on_put(req, rep)[source]¶
Handles PUT for KERI mbx event messages.
- Parameters:
req (Request) –
rep (Response) –
— summary: Accept KERI events with attachment headers and parse description: Accept KERI events with attachment headers and parse. tags:
Events
- requestBody:
required: true content:
- application/json:
- schema:
type: object description: KERI event message
- responses:
- 200:
description: Mailbox query response for server sent events
- 204:
description: KEL or EXN event accepted.
keria.app.notifying¶
KERIA keria.app.notifying module
keria.app.presenting¶
keria.app.specing¶
- class keria.app.specing.AgentSpecResource(app, title, version='1.0.1', openapi_version='3.1.0')[source]¶
OpenAPI Description Resource for the KERI and ACDC ReST interface
Contains all the endpoint descriptions for the KERI admin interface including: 1. Creating and managing autonomic identifiers (AIDs) including multi-signature groups. 2. Creating and managing authentic chained data containers (ACDCs)