def validate(response: Message, req_id: str): response.check_for_attrs( [ ('@type', DIDExchange.RESPONSE), '~thread', 'connection' ] ) Message.check_for_attrs_in_message( [ (Message.THREAD_ID, req_id) ], response['~thread'] ) Message.check_for_attrs_in_message( [ DIDDoc.DID, DIDDoc.DID_DOC ], response[DIDExchange.CONNECTION] ) DIDDoc.validate(response[DIDExchange.CONNECTION][DIDDoc.DID_DOC])
def validate(msg: Message): msg.check_for_attrs( [ ('@type', AckMessage.ACK), 'status', '~thread', ] )
def validate_pre_sig(response: Message): response.check_for_attrs( [ ('@type', DIDExchange.RESPONSE), '~thread', 'connection~sig' ] )
def validate(msg: Message): msg.check_for_attrs( [ ('@type', RoutingMessage.FORWARD), 'to', 'msg', ] )
def validate(msg: Message): msg.check_for_attrs([ ('@type', BasicMessage.MESSAGE), '~l10n', 'sent_time', 'content', ]) Message.check_for_attrs_in_message([('locale', 'en')], msg['~l10n'])