acapy_agent.messaging package
Subpackages
- acapy_agent.messaging.credential_definitions package
- acapy_agent.messaging.decorators package
- Submodules
- acapy_agent.messaging.decorators.attach_decorator module
- acapy_agent.messaging.decorators.base module
BaseDecoratorSetBaseDecoratorSet.add_model()BaseDecoratorSet.copy()BaseDecoratorSet.extract_decorators()BaseDecoratorSet.field()BaseDecoratorSet.fieldsBaseDecoratorSet.has_field()BaseDecoratorSet.load_decorator()BaseDecoratorSet.modelsBaseDecoratorSet.prefixBaseDecoratorSet.remove_field()BaseDecoratorSet.remove_model()BaseDecoratorSet.to_dict()
DecoratorError
- acapy_agent.messaging.decorators.default module
- acapy_agent.messaging.decorators.localization_decorator module
- acapy_agent.messaging.decorators.please_ack_decorator module
- acapy_agent.messaging.decorators.service_decorator module
- acapy_agent.messaging.decorators.signature_decorator module
- acapy_agent.messaging.decorators.thread_decorator module
- acapy_agent.messaging.decorators.timing_decorator module
- acapy_agent.messaging.decorators.trace_decorator module
- acapy_agent.messaging.decorators.transport_decorator module
- acapy_agent.messaging.jsonld package
- acapy_agent.messaging.models package
- Submodules
- acapy_agent.messaging.models.base module
- acapy_agent.messaging.models.base_record module
BaseExchangeRecordBaseExchangeSchemaBaseRecordBaseRecord.DEFAULT_CACHE_TTLBaseRecord.EVENT_NAMESPACEBaseRecord.LOG_STATE_FLAGBaseRecord.MetaBaseRecord.RECORD_ID_NAMEBaseRecord.RECORD_TOPICBaseRecord.RECORD_TYPEBaseRecord.STATE_DELETEDBaseRecord.TAG_NAMESBaseRecord.clear_cached_key()BaseRecord.delete_record()BaseRecord.emit_event()BaseRecord.from_storage()BaseRecord.get_attributes_by_prefix()BaseRecord.get_cached_key()BaseRecord.get_tag_map()BaseRecord.log_state()BaseRecord.post_save()BaseRecord.prefix_tag_filter()BaseRecord.query()BaseRecord.record_tagsBaseRecord.record_valueBaseRecord.retrieve_by_id()BaseRecord.retrieve_by_tag_filter()BaseRecord.save()BaseRecord.set_cached_key()BaseRecord.storage_recordBaseRecord.strip_tag_prefix()BaseRecord.tagsBaseRecord.value
BaseRecordSchemamatch_post_filter()
- acapy_agent.messaging.models.openapi module
- acapy_agent.messaging.models.paginated_query module
- acapy_agent.messaging.schemas package
Submodules
acapy_agent.messaging.agent_message module
Agent message base class and schema.
- class acapy_agent.messaging.agent_message.AgentMessage(_id: str | None = None, _type: str | None = None, _version: str | None = None, _decorators: BaseDecoratorSet | None = None)[source]
Bases:
BaseModel,BaseMessageAgent message base class.
- property Handler: type
Accessor for the agent message’s handler class.
- Returns:
Handler class
- class Meta[source]
Bases:
objectAgentMessage metadata.
- handler_class = None
- message_type = None
- schema_class = None
- add_trace_decorator(target: str = 'log', full_thread: bool = True)[source]
Create a new trace decorator.
- Parameters:
target – The trace target
full_thread – Full thread flag
- add_trace_report(val: TraceReport | dict)[source]
Append a new trace report.
- Parameters:
val – The trace target
- assign_thread_from(msg: AgentMessage)[source]
Copy thread information from a previous message.
- Parameters:
msg – The received message containing optional thread information
- assign_thread_id(thid: str | None = None, pthid: str | None = None)[source]
Assign a specific thread ID.
- Parameters:
thid – The thread identifier
pthid – The parent thread identifier
- assign_trace_decorator(context, trace)[source]
Copy trace from a json structure.
- Parameters:
context – context object
trace – string containing trace json structure
- assign_trace_from(msg: AgentMessage)[source]
Copy trace information from a previous message.
- Parameters:
msg – The received message containing optional trace information
- assign_version(version: str)[source]
Assign a specific version.
- Parameters:
version – The version to assign
- assign_version_from(msg: AgentMessage)[source]
Copy version information from a previous message.
- Parameters:
msg – The received message containing version information to copy
- classmethod deserialize(value: dict, msg_format: DIDCommVersion = DIDCommVersion.v1, **kwargs)[source]
Return message object deserialized from value in format specified.
- get_signature(field_name: str) SignatureDecorator[source]
Get the signature for a named field.
- Parameters:
field_name – Field name to get the signature for
- Returns:
A SignatureDecorator for the requested field name
- serialize(msg_format: DIDCommVersion = DIDCommVersion.v1, **kwargs)[source]
Return serialized message in format specified.
- set_signature(field_name: str, signature: SignatureDecorator)[source]
Add or replace the signature for a named field.
- Parameters:
field_name – Field to set signature on
signature – Signature for the field
- async sign_field(field_name: str, signer_verkey: str, wallet: BaseWallet, timestamp=None) SignatureDecorator[source]
Create and store a signature for a named field.
- Parameters:
field_name – Field to sign
signer_verkey – Verkey of signer
wallet – Wallet to use for signature
timestamp – Optional timestamp for signature
- Returns:
A SignatureDecorator for newly created signature
- Raises:
ValueError – If field_name doesn’t exist on this message
- async verify_signatures(wallet: BaseWallet) bool[source]
Verify all associated field signatures.
- Parameters:
wallet – Wallet to use in verification
- Returns:
True if all signatures verify, else false
- async verify_signed_field(field_name: str, wallet: BaseWallet, signer_verkey: str | None = None) str[source]
Verify a specific field signature.
- Parameters:
field_name – The field name to verify
wallet – Wallet to use for the verification
signer_verkey – Verkey of signer to use
- Returns:
The verkey of the signer
- Raises:
ValueError – If field_name does not exist on this message
ValueError – If the verification fails
ValueError – If the verkey of the signature does not match the
provided verkey –
- exception acapy_agent.messaging.agent_message.AgentMessageError(*args, error_code: str | None = None, **kwargs)[source]
Bases:
BaseModelErrorBase exception for agent message issues.
- class acapy_agent.messaging.agent_message.AgentMessageSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchemaAgentMessage schema.
- class Meta[source]
Bases:
objectAgentMessageSchema metadata.
- model_class = None
- signed_fields = None
- check_dump_decorators(obj, **kwargs)
Pre-dump hook to validate and load the message decorators.
- Parameters:
obj – The AgentMessage object
kwargs – Additional keyword arguments
- Raises:
BaseModelError – If a decorator does not validate
- dump_decorators(data, **kwargs)
Post-dump hook to write the decorators to the serialized output.
- Parameters:
data – The serialized data
kwargs – Additional keyword arguments
- Returns:
The modified data
- extract_decorators(data: Mapping, **kwargs)
Pre-load hook to extract the decorators and check the signed fields.
- Parameters:
data – Incoming data to parse
kwargs – Additional keyword arguments
- Returns:
Parsed and modified data
- Raises:
ValidationError – If a field signature does not correlate
to a field in the message –
ValidationError – If the message defines both a field signature
and a value for the same field –
ValidationError – If there is a missing field signature
- populate_decorators(obj, **kwargs)
Post-load hook to populate decorators on the message.
- Parameters:
obj – The AgentMessage object
kwargs – Additional keyword arguments
- Returns:
The AgentMessage object with populated decorators
- replace_signatures(data, **kwargs)
Post-dump hook to write the signatures to the serialized output.
- Parameters:
data – The serialized data
kwargs – Additional keyword arguments
- Returns:
The modified data
acapy_agent.messaging.base_handler module
acapy_agent.messaging.base_message module
Base message.
- class acapy_agent.messaging.base_message.BaseMessage[source]
Bases:
ABCAbstract base class for messages.
This formally defines a “minimum viable message” and provides an unopinionated class for plugins to extend in whatever way makes sense in the context of the plugin.
- abstract property Handler: Type[BaseHandler]
Return reference to handler class.
- abstractmethod classmethod deserialize(value: dict, msg_format: DIDCommVersion = DIDCommVersion.v1)[source]
Return message object deserialized from value in format specified.
- abstractmethod serialize(msg_format: DIDCommVersion = DIDCommVersion.v1) dict[source]
Return serialized message in format specified.
acapy_agent.messaging.error module
Messaging-related error classes and codes.
acapy_agent.messaging.message_type module
Utilities for working with Message Types and Versions.
- class acapy_agent.messaging.message_type.MessageType(doc_uri: str, protocol: str, version: MessageVersion, name: str)[source]
Bases:
objectMessage type.
- PATTERN: ClassVar[Pattern] = re.compile('^(.*?)/([a-z0-9._-]+)/(\\d[^/]*)/([a-z0-9._-]+)$')
- doc_uri: str
- name: str
- protocol: str
- version: MessageVersion
- with_version(version: str | MessageVersion | Tuple[int, int]) MessageType[source]
Return a new message type with the specified version.
- class acapy_agent.messaging.message_type.MessageTypeStr(value: str)[source]
Bases:
strMessage type string.
- property doc_uri: str
Return the message type document URI.
- property name: str
Return the message type name.
- property parsed: MessageType
Return the parsed message type.
- property protocol: str
Return the message type protocol.
- property protocol_identifier: ProtocolIdentifier
Return the message type protocol identifier.
- property version: MessageVersion
Return the message type version.
- with_version(version: str | MessageVersion | Tuple[int, int]) MessageTypeStr[source]
Return a new message type string with the specified version.
- class acapy_agent.messaging.message_type.MessageVersion(major: int, minor: int)[source]
Bases:
objectMessage type version.
- PATTERN: ClassVar[Pattern] = re.compile('^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$')
- compatible(other: MessageVersion) bool[source]
Test whether this version is compatible with another.
- major: int
- minor: int
- class acapy_agent.messaging.message_type.ProtocolIdentifier(doc_uri: str, protocol: str, version: MessageVersion)[source]
Bases:
objectProtocol identifier.
- FROM_MESSAGE_TYPE_PATTERN: ClassVar[Pattern] = re.compile('^(.*?)/([a-z0-9._-]+)/(\\d[^/]*).*$')
- PATTERN: ClassVar[Pattern] = re.compile('^(.*?)/([a-z0-9._-]+)/(\\d[^/]*)$')
- doc_uri: str
- classmethod from_message_type(message_type: str | MessageType) ProtocolIdentifier[source]
Create a protocol identifier from a message type.
- classmethod from_str(value: str) ProtocolIdentifier[source]
Parse a protocol identifier string.
- protocol: str
- property stem: str
Return the protocol stem, including doc_uri, protocol, and major version.
- version: MessageVersion
- with_version(version: str | MessageVersion | Tuple[int, int]) ProtocolIdentifier[source]
Return a new protocol identifier with the specified version.
acapy_agent.messaging.request_context module
acapy_agent.messaging.responder module
acapy_agent.messaging.util module
Utils for messages.
- acapy_agent.messaging.util.canon(raw_attr_name: str) str[source]
Canonicalize input attribute name for indy proofs and credential offers.
- Parameters:
raw_attr_name – raw attribute name
- Returns:
canonicalized attribute name
- acapy_agent.messaging.util.datetime_to_str(dt: str | datetime | None) str | None[source]
Convert a datetime object to an indy-standard datetime string.
- Parameters:
dt – May be a string or datetime to allow automatic conversion
- acapy_agent.messaging.util.encode(orig: Any) str[source]
Encode a credential value as an int.
Encode credential attribute value, purely stringifying any int32 and leaving numeric int32 strings alone, but mapping any other input to a stringified 256-bit (but not 32-bit) integer. Predicates in indy-sdk operate on int32 values properly only when their encoded values match their raw values.
- Parameters:
orig – original value to encode
- Returns:
encoded value
- acapy_agent.messaging.util.epoch_to_str(epoch: int) str[source]
Convert epoch seconds to indy-standard datetime string.
- Parameters:
epoch – epoch seconds
- acapy_agent.messaging.util.get_proto_default_version(versions: List[Dict[str, Any]], major_version: int = 1) str[source]
Return default protocol version from version definition list.
- acapy_agent.messaging.util.str_to_datetime(dt: str | datetime) datetime[source]
Convert an indy-standard datetime string to a datetime.
Using a fairly lax regex pattern to match slightly different formats. In Python 3.7 datetime.fromisoformat might be used.
- Parameters:
dt – May be a string or datetime to allow automatic conversion
acapy_agent.messaging.v2_agent_message module
DIDComm V2 Agent message base class and schema.
- class acapy_agent.messaging.v2_agent_message.V2AgentMessage(message, *args, **kwargs)[source]
Bases:
BaseMessageDIDComm V2 message base class.
- property Handler
Message handler.
- deserialize(value: dict, msg_format: DIDCommVersion = DIDCommVersion.v2)[source]
Deserialize a message.
- serialize(msg_format: DIDCommVersion = DIDCommVersion.v1) dict[source]
Serialize a message.
acapy_agent.messaging.valid module
Validators for schema fields.
- class acapy_agent.messaging.valid.AnonCredsCredDefId(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against anoncreds credential definition identifier specification.
- EXAMPLE = 'did:(method):3:CL:20:tag'
- PATTERN = '^(.+$)'
- class acapy_agent.messaging.valid.AnonCredsCredRevId(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against anoncreds credential revocation identifier specification.
- EXAMPLE = '12345'
- PATTERN = '^[1-9][0-9]*$'
- class acapy_agent.messaging.valid.AnonCredsDID(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against anoncreds DID.
- EXAMPLE = 'did:(method):WgWxqztrNooG92RXvxSTWv'
- METHOD = '([a-zA-Z0-9_]+)'
- METHOD_ID = '([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)'
- NETWORK = '(:[a-zA-Z0-9_.%-]+)?'
- PATTERN = re.compile('^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)')
- class acapy_agent.messaging.valid.AnonCredsRevRegId(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against anoncreds revocation registry identifier specification.
- EXAMPLE = 'did:(method):4:did:<method>:3:CL:20:tag:CL_ACCUM:0'
- PATTERN = '^(.+$)'
- class acapy_agent.messaging.valid.AnonCredsSchemaId(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against indy schema identifier specification.
- EXAMPLE = 'did:(method):2:schema_name:1.0'
- PATTERN = '^(.+$)'
- class acapy_agent.messaging.valid.Base58SHA256Hash(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against base58 encoding of SHA-256 hash.
- EXAMPLE = 'H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV'
- PATTERN = '^[base58.alphabet.decode]{43,44}$'
- class acapy_agent.messaging.valid.Base64(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate base64 value.
- EXAMPLE = 'ey4uLn0='
- PATTERN = '^[a-zA-Z0-9+/]*={0,2}$'
- class acapy_agent.messaging.valid.Base64URL(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate base64 value.
- EXAMPLE = 'ey4uLn0='
- PATTERN = '^[-_a-zA-Z0-9]*={0,2}$'
- class acapy_agent.messaging.valid.Base64URLNoPad(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate base64 value.
- EXAMPLE = 'ey4uLn0'
- PATTERN = '^[-_a-zA-Z0-9]*$'
- class acapy_agent.messaging.valid.CredentialContext(*args: Any, **kwargs: Any)[source]
Bases:
ValidatorCredential Context.
- EXAMPLE = ['https://www.w3.org/2018/credentials/v1', 'https://www.w3.org/2018/credentials/examples/v1']
- FIRST_CONTEXT = 'https://www.w3.org/2018/credentials/v1'
- VALID_CONTEXTS = ['https://www.w3.org/2018/credentials/v1', 'https://www.w3.org/ns/credentials/v2']
- class acapy_agent.messaging.valid.CredentialStatus(*args: Any, **kwargs: Any)[source]
Bases:
ValidatorCredential status.
- EXAMPLE = {'id': 'https://example.com/credentials/status/3#94567', 'statusListCredential': 'https://example.com/credentials/status/3', 'statusListIndex': '94567', 'statusPurpose': 'revocation', 'type': 'BitstringStatusListEntry'}
- class acapy_agent.messaging.valid.CredentialSubject(*args: Any, **kwargs: Any)[source]
Bases:
ValidatorCredential subject.
- EXAMPLE = {'alumniOf': {'id': 'did:example:c276e12ec21ebfeb1f712ebc6f1'}, 'id': 'did:example:ebfeb1f712ebc6f1c276e12ec21'}
- class acapy_agent.messaging.valid.CredentialType(*args: Any, **kwargs: Any)[source]
Bases:
ValidatorCredential Type.
- CREDENTIAL_TYPE = 'VerifiableCredential'
- EXAMPLE = ['VerifiableCredential', 'AlumniCredential']
- class acapy_agent.messaging.valid.DIDKey(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against DID key specification.
- EXAMPLE = 'did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH'
- PATTERN = re.compile('^did:key:z[base58.alphabet.decode]+$')
- class acapy_agent.messaging.valid.DIDKeyOrRef(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against DID key specification.
- EXAMPLE = 'did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH'
- PATTERN = re.compile('^did:key:z[base58.alphabet.decode]+(?:#z[base58.alphabet.decode]+)?$')
- class acapy_agent.messaging.valid.DIDKeyRef(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value as DID key reference.
- EXAMPLE = 'did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH#z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH'
- PATTERN = re.compile('^did:key:z[base58.alphabet.decode]+#z[base58.alphabet.decode]+$')
- class acapy_agent.messaging.valid.DIDPosture(*args: Any, **kwargs: Any)[source]
Bases:
OneOfValidate value against defined DID postures.
- EXAMPLE = 'wallet_only'
- class acapy_agent.messaging.valid.DIDValidation(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against any valid DID spec.
- EXAMPLE = 'did:peer:WgWxqztrNooG92RXvxSTWv'
- FRAGMENT = '(\\#.*)?$'
- METHOD = '([a-zA-Z0-9_]+)'
- METHOD_ID = '([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)'
- NETWORK = '(:[a-zA-Z0-9_.%-]+)?'
- PARAMS = '((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)'
- PATH = '(\\/[^#?]*)?'
- PATTERN = re.compile('^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\\/[^#?]*)?([?][^#]*)?(\\#.*)?$$')
- QUERY = '([?][^#]*)?'
- class acapy_agent.messaging.valid.DIDWeb(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against did:web specification.
- EXAMPLE = 'did:web:example.com'
- PATTERN = re.compile('^(did:web:)([a-zA-Z0-9%._-]*:)*[a-zA-Z0-9%._-]+$')
- class acapy_agent.messaging.valid.DIDWebvh(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against did:webvh specification.
- EXAMPLE = 'did:webvh:QmP9VWaTCHcyztDpRj9XSHvZbmYe3m9HZ61KoDtZgWaXVU:example.com%3A5000'
- PATTERN = re.compile('^(did:webvh:)([a-zA-Z0-9%._-]*:)*[a-zA-Z0-9%._-]+$')
- class acapy_agent.messaging.valid.DictOrDictListField(*args: Any, **kwargs: Any)[source]
Bases:
FieldDict or Dict List field for Marshmallow.
- class acapy_agent.messaging.valid.Endpoint(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against endpoint URL on any scheme.
- EXAMPLE = 'https://myhost:8021'
- PATTERN = '^[A-Za-z0-9\\.\\-\\+]+://([A-Za-z0-9][.A-Za-z0-9-_]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$'
- class acapy_agent.messaging.valid.EndpointType(*args: Any, **kwargs: Any)[source]
Bases:
OneOfValidate value against allowed endpoint/service types.
- EXAMPLE = 'Endpoint'
- class acapy_agent.messaging.valid.ISO8601DateTime(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against ISO 8601 datetime format.
- EXAMPLE = '2021-12-31T23:59:59Z'
- PATTERN = '^\\d{4}-\\d\\d-\\d\\d[T ]\\d\\d:\\d\\d(?:\\:(?:\\d\\d(?:\\.\\d{1,6})?))?(?:[+-]\\d\\d:?\\d\\d|Z|)$'
- class acapy_agent.messaging.valid.IndyCredDefId(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against indy credential definition identifier specification.
- EXAMPLE = 'WgWxqztrNooG92RXvxSTWv:3:CL:20:tag'
- PATTERN = '^([base58.alphabet.decode]{21,22}):3:CL:(([1-9][0-9]*)|([base58.alphabet.decode]{21,22}:2:.+:[0-9.]+)):(.+)?$'
- class acapy_agent.messaging.valid.IndyCredRevId(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against indy credential revocation identifier specification.
- EXAMPLE = '12345'
- PATTERN = '^[1-9][0-9]*$'
- class acapy_agent.messaging.valid.IndyDID(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against indy DID.
- EXAMPLE = 'did:indy:sovrin:WRfXPg8dantKVubE3HX8pw'
- PATTERN = re.compile('^(did:(sov|indy):)?[base58.alphabet.decode]{21,22}$')
- class acapy_agent.messaging.valid.IndyExtraWQL(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value as potential extra WQL query in cred search for proof req.
- EXAMPLE = '{"0_drink_uuid": {"attr::drink::value": "martini"}}'
- PATTERN = '^{\\s*".*?"\\s*:\\s*{.*?}\\s*(,\\s*".*?"\\s*:\\s*{.*?}\\s*)*\\s*}$'
- class acapy_agent.messaging.valid.IndyOrKeyDID(*args: Any, **kwargs: Any)[source]
Bases:
RegexpIndy or Key DID class.
- EXAMPLE = 'did:indy:sovrin:WRfXPg8dantKVubE3HX8pw'
- PATTERN = '^did:key:z[base58.alphabet.decode]+$|^(did:(sov|indy):)?[base58.alphabet.decode]{21,22}$'
- class acapy_agent.messaging.valid.IndyRevRegId(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against indy revocation registry identifier specification.
- EXAMPLE = 'WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0'
- PATTERN = '^([base58.alphabet.decode]{21,22}):4:([base58.alphabet.decode]{21,22}):3:CL:(([1-9][0-9]*)|([base58.alphabet.decode]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$)'
- class acapy_agent.messaging.valid.IndyRevRegSize(*args: Any, **kwargs: Any)[source]
Bases:
RangeValidate value as indy revocation registry size.
- EXAMPLE = 1000
- class acapy_agent.messaging.valid.IndySchemaId(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against indy schema identifier specification.
- EXAMPLE = 'WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0'
- PATTERN = '^[base58.alphabet.decode]{21,22}:2:.+:[0-9.]+$'
- class acapy_agent.messaging.valid.IndyWQL(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value as potential WQL query.
- EXAMPLE = '{"attr::name::value": "Alex"}'
- PATTERN = '^{.*}$'
- class acapy_agent.messaging.valid.IntEpoch(*args: Any, **kwargs: Any)[source]
Bases:
RangeValidate value against (integer) epoch format.
- EXAMPLE = 1640995199
- class acapy_agent.messaging.valid.JSONWebToken(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate JSON Web Token.
- EXAMPLE = 'eyJhbGciOiJFZERTQSJ9.eyJhIjogIjAifQ.dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk'
- PATTERN = '^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]*\\.[a-zA-Z0-9_-]+$'
- class acapy_agent.messaging.valid.JWSHeaderKid(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against JWS header kid.
- EXAMPLE = 'did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4'
- PATTERN = '^did:(?:key:z[base58.alphabet.decode]+|sov:[base58.alphabet.decode]{21,22}(;.*)?(\\?.*)?#.+)$'
- class acapy_agent.messaging.valid.MajorMinorVersion(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against major minor version specification.
- EXAMPLE = '1.0'
- PATTERN = '^[0-9.]+$'
- class acapy_agent.messaging.valid.MaybeIndyDID(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against any valid DID spec or a short Indy DID.
- EXAMPLE = 'did:peer:WgWxqztrNooG92RXvxSTWv'
- PATTERN = re.compile('^(did:(sov|indy):)?[base58.alphabet.decode]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\\/[^#?]*)?([?][^#]*)?(\\#)
- class acapy_agent.messaging.valid.NaturalNumber(*args: Any, **kwargs: Any)[source]
Bases:
RangeValidate value as positive integer.
- EXAMPLE = 10
- class acapy_agent.messaging.valid.NonSDList(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate NonSD List.
- EXAMPLE = ['name', 'address', 'address.street_address', 'nationalities[1:3]']
- PATTERN = '[a-z0-9:\\[\\]_\\.@?\\(\\)]'
- class acapy_agent.messaging.valid.NumericStrAny(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against any number numeric string.
- EXAMPLE = '-1'
- PATTERN = '^-?[0-9]*$'
- class acapy_agent.messaging.valid.NumericStrNatural(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against natural number numeric string.
- EXAMPLE = '1'
- PATTERN = '^[1-9][0-9]*$'
- class acapy_agent.messaging.valid.NumericStrWhole(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against whole number numeric string.
- EXAMPLE = '0'
- PATTERN = '^[0-9]*$'
- class acapy_agent.messaging.valid.Predicate(*args: Any, **kwargs: Any)[source]
Bases:
OneOfValidate value against predicate.
- EXAMPLE = '>='
- class acapy_agent.messaging.valid.PresentationType(*args: Any, **kwargs: Any)[source]
Bases:
ValidatorPresentation Type.
- EXAMPLE = ['VerifiablePresentation']
- PRESENTATION_TYPE = 'VerifiablePresentation'
- class acapy_agent.messaging.valid.RFC3339DateTime(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against RFC3339 datetime format.
- EXAMPLE = '2010-01-01T19:23:24Z'
- PATTERN = '^([0-9]{4})-([0-9]{2})-([0-9]{2})([Tt ]([0-9]{2}):([0-9]{2}):([0-9]{2})(\\.[0-9]+)?)?(([Zz]|([+-])([0-9]{2}):([0-9]{2})))?$'
- class acapy_agent.messaging.valid.RawPublicEd25519VerificationKey2018(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against (Ed25519VerificationKey2018) raw public key.
- EXAMPLE = 'H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV'
- PATTERN = '^[base58.alphabet.decode]{43,44}$'
- class acapy_agent.messaging.valid.RoutingKey(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate between indy or did key.
Validate value against indy (Ed25519VerificationKey2018) raw public key or DID key specification.
- EXAMPLE = 'did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH'
- PATTERN = re.compile('^did:key:z[base58.alphabet.decode]+$|^[base58.alphabet.decode]{43,44}$')
- class acapy_agent.messaging.valid.SDJSONWebToken(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate SD-JSON Web Token.
- EXAMPLE = 'eyJhbGciOiJFZERTQSJ9.eyJhIjogIjAifQ.dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk~WyJEM3BUSFdCYWNRcFdpREc2TWZKLUZnIiwgIkRFIl0~WyJPMTFySVRjRTdHcXExYW9oRkd0aDh3IiwgIlNBIl0~WyJkVmEzX1JlTGNsWTU0R1FHZm5oWlRnIiwgInVwZGF0ZWRfYXQiLCAxNTcwMDAwMDAwXQ'
- PATTERN = '^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]*\\.[a-zA-Z0-9_-]+(?:~[a-zA-Z0-9._-]+)*~?$'
- class acapy_agent.messaging.valid.SHA256Hash(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate (binhex-encoded) SHA256 value.
- EXAMPLE = '617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb'
- PATTERN = '^[a-fA-F0-9+/]{64}$'
- class acapy_agent.messaging.valid.StrOrDictField(*args: Any, **kwargs: Any)[source]
Bases:
FieldURI or Dict field for Marshmallow.
- class acapy_agent.messaging.valid.StrOrNumberField(*args: Any, **kwargs: Any)[source]
Bases:
FieldString or Number field for Marshmallow.
- class acapy_agent.messaging.valid.UUIDFour(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate UUID4: 8-4-4-4-12 hex digits, the 13th of which being 4.
- EXAMPLE = '3fa85f64-5717-4562-b3fc-2c963f66afa6'
- PATTERN = '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}'
- class acapy_agent.messaging.valid.Uri(*args: Any, **kwargs: Any)[source]
Bases:
RegexpValidate value against URI on any scheme.
- EXAMPLE = 'https://www.w3.org/2018/credentials/v1'
- PATTERN = '\\w+:(\\/?\\/?)[^\\s]+'
- class acapy_agent.messaging.valid.UriOrDictField(*args: Any, **kwargs: Any)[source]
Bases:
StrOrDictFieldURI or Dict field for Marshmallow.