KERI End API¶
keri.end.ending¶
keri.end.ending module
ReST API endpoints
- class keri.end.ending.AdminEnd(hby, **kwa)[source]¶
ReST API for admin of service endpoints
- __init__(hby, **kwa)[source]¶
- Parameters:
hab (habbing.Hab) – instance of local habitat
tymth (function) – tymth for superclass (inherited)
- class keri.end.ending.Inputage(name, fields, created, keyid, alg, expires, nonce, context)¶
- alg¶
Alias for field number 4
- context¶
Alias for field number 7
- created¶
Alias for field number 2
- expires¶
Alias for field number 5
- fields¶
Alias for field number 1
- keyid¶
Alias for field number 3
- name¶
Alias for field number 0
- nonce¶
Alias for field number 6
- class keri.end.ending.LocationEnd(hby, **kwa)[source]¶
ReST API for Service Endpoint database for each Service Endpoint Identifier prefix
- __init__(hby, **kwa)[source]¶
- Parameters:
hab (habbing.Hab) – instance of local habitat
tymth (function) – tymth for superclass (inherited)
- class keri.end.ending.Mimage(json, mgpk, cbor, cesr)¶
- cbor¶
Alias for field number 2
- cesr¶
Alias for field number 3
- json¶
Alias for field number 0
- mgpk¶
Alias for field number 1
- class keri.end.ending.OOBIEnd(hby: Habery, default=None)[source]¶
REST API for OOBI endpoints
- class keri.end.ending.PointEnd(hby, **kwa)[source]¶
ReST API for SEID (Service Endpoint IDentifier) database for each identifier prefix
- __init__(hby, **kwa)[source]¶
- Parameters:
hab (habbing.Hab) – instance of local habitat
tymth (function) – tymth for superclass (inherited)
- class keri.end.ending.Signage(markers, indexed, signer, ordinal, digest, kind)¶
- digest¶
Alias for field number 4
- indexed¶
Alias for field number 1
- kind¶
Alias for field number 5
- markers¶
Alias for field number 0
- ordinal¶
Alias for field number 3
- signer¶
Alias for field number 2
- keri.end.ending.desiginput(value)[source]¶
Verify the signature header based on values as identified in signature-input header
- Parameters:
value (Request) – falcon request object
Returns:
- keri.end.ending.designature(value)[source]¶
- Parse signature header str value where value is RFC8941 compliant
(Structured Field Values for HTTP) formatted str of of Signage group. Each signage group is separated by a comma. Each group is parameter list of label=value items separated by ; The signer and indexed are special parameters in each group. This format is compatible with HTTP servers that merge multiple signature headers into one header by iteratively appending the comma separated value from each Signature header.
RFC8941 structured Field Values for HTTP
- Returns:
- items are Signage namedtuples,
(markers, indexed, signer, ordinal, kind)
- where:
- markers (Union[list, dict]): When dict each item (key, val) has
key as str identifier of marker and has val as instance of either coring.Siger or coring.Cigar. When list each item is instance of either coring.Siger or coring.Cigar. All markers must be of same class
- indexed (bool): True means marker values are indexed signatures
using coring.Siger. False means marker values are unindexed signatures using coring.Cigar. None means auto detect from first marker value class. All markers must be of same class.
- signer (str): optional identifier of signage. May be a
multi-sig group identifier. Default is None. When None or empty signer is not included in header value
- ordinal (str): optional ordinal hex str of int that is an ordinal
such as sequence number to further identify the keys used for the signatures. Usually when indexed with signer and digest
- digest (str): optional CESR Base64 serialization of a digest to
further identify the keys used for the signatures. Usually when indexed with signer and ordinal
kind (str): serialization kind of the markers and other primitives
signatures (list): Siger or Cigar instances
- Return type:
signages (list)
- keri.end.ending.loadEnds(app, hby, *, tymth=None, default=None, static=False)[source]¶
Load endpoints for app with shared resource dependencies This function provides the endpoint resource instances with references to the needed shared dependencies:
tymth: virtual time reference injection function from Tymist subclass hab: local habitat
- Parameters:
app (falcon.App) – Falcon Rest app for endpoint route registration
hby (Habery) – glocal database environment
tymth (callable) – reference to tymist (Doist, DoDoer) virtual time reference
default (str)
static (bool)
- keri.end.ending.setup(name='who', temp=False, tymth=None, isith=None, count=1, remotePort=5621, localPort=5620, webPort=8081)[source]¶
Setup and return doers list to run controller
- keri.end.ending.siginput(name, method, path, headers, fields, hab=None, signers=None, expires=None, nonce=None, alg=None, keyid=None, context=None)[source]¶
Create an HTTP Signature-Input Header :param context: Optional implementation specific context for the signature :type context: str :param keyid: Optional key identifier used to sign the request :type keyid: str :param alg: Algorithm used when generating the signature :type alg: str :param nonce: Uniqque salty nonce for signing the request :type nonce: str :param expires: iso8601 formated date string indicating exiration of header signature :type expires: str :param signers: Optional signer objects used to sign the values :type signers: list :param hab: Optional Hab used to sign the values. One of signers or Hab is required :type hab: Hab :param fields: Fields in request to sign. Includes special fields as well as Header fields :type fields: str :param headers: HTTP request headers :type headers: dict :param path: HTTP request path :type path: str :param method: HTTP request method (POST, GET, PUT, etc) :type method: str :param name: name of item :type name: str
- Returns:
header (dict): {‘Signature-Input’: ‘value’} where value is RFC8941 compliant (Structured Field Values for HTTP) formatted str of of Signature Input group. sigers (Unqualified): unqualified base64 encoded signature
- keri.end.ending.signature(signages)[source]¶
Creates Signature HTTP header item from signages list
RFC8941 Structured Field Values for HTTP
- Returns:
{‘Signature’: ‘value’} where value is RFC8941 compliant (Structured Field Values for HTTP) formatted str of of Signage group. Each signage group is separated by a comma. Each group is parameter list of label=value items separated by ; The signer and indexed are special parameters in each group. This format is compatible with HTTP servers that merge multiple signature headers into one header by iteratively appending the comma separated value from each Signature header.
- Return type:
header (dict)
- Parameters:
signages (list) –
- items are Signage namedtuples,
(markers, indexed, signer, ordinal, kind)
- where:
- markers (Union[list, dict]): When dict each item (key, val) has
key as str identifier of marker and has val as instance of either coring.Siger or coring.Cigar. When list each item is instance of either coring.Siger or coring.Cigar. All markers must be of same class
- indexed (bool): True means marker values are indexed signatures
using coring.Siger. False means marker values are unindexed signatures using coring.Cigar. None means auto detect from first marker value class. All markers must be of same class.
- signer (str): optional identifier of signage. May be a
multi-sig group identifier. Default is None. When None or empty signer is not included in header value
- ordinal (str): optional ordinal hex str of int that is an ordinal
such as sequence number to further identify the keys used for the signatures. Usually when indexed with signer and digest
- digest (str): optional CESR Base64 serialization of a digest to
further identify the keys used for the signatures. Usually when indexed with signer and ordinal
kind (str): serialization kind of the markers and other primitives
keri.end.priming¶
keri.end.priming module
Prime (preload) setup witnesses, watchers, etc