aries_cloudagent.protocols.present_proof.v2_0 package

aries_cloudagent.protocols.present_proof.v2_0.problem_report_for_record(record: Union[aries_cloudagent.connections.models.conn_record.ConnRecord, aries_cloudagent.protocols.present_proof.v2_0.models.pres_exchange.V20PresExRecord], desc_en: str) → aries_cloudagent.protocols.present_proof.v2_0.messages.pres_problem_report.V20PresProblemReport[source]

Create problem report for record.

Parameters:
  • record – connection or exchange record
  • desc_en – description text to include in problem report
aries_cloudagent.protocols.present_proof.v2_0.report_problem(err: aries_cloudagent.core.error.BaseError, desc_en: str, http_error_class, record: Union[aries_cloudagent.connections.models.conn_record.ConnRecord, aries_cloudagent.protocols.present_proof.v2_0.models.pres_exchange.V20PresExRecord], outbound_handler: Coroutine)[source]

Send problem report response and raise corresponding HTTP error.

Parameters:
  • err – error for internal diagnostics
  • desc_en – description text to include in problem report (response)
  • http_error_class – HTTP error to raise
  • record – record to cite by thread in problem report
  • outbound_handler – outbound message handler

Subpackages

Submodules

aries_cloudagent.protocols.present_proof.v2_0.controller module

Protocol controller for present proof v2_0.

class aries_cloudagent.protocols.present_proof.v2_0.controller.Controller(protocol: str)[source]

Bases: object

Present proof v2_0 protocol controller.

determine_goal_codes() → Sequence[str][source]

Return defined goal_codes.

aries_cloudagent.protocols.present_proof.v2_0.manager module

Classes to manage presentations.

class aries_cloudagent.protocols.present_proof.v2_0.manager.V20PresManager(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: object

Class for managing presentations.

create_bound_request(pres_ex_record: aries_cloudagent.protocols.present_proof.v2_0.models.pres_exchange.V20PresExRecord, request_data: dict = None, comment: str = None)[source]

Create a presentation request bound to a proposal.

Parameters:
  • pres_ex_record – Presentation exchange record for which to create presentation request
  • comment – Optional human-readable comment pertaining to request creation
Returns:

A tuple (updated presentation exchange record, presentation request message)

create_exchange_for_proposal(connection_id: str, pres_proposal_message: aries_cloudagent.protocols.present_proof.v2_0.messages.pres_proposal.V20PresProposal, auto_present: bool = None, auto_remove: bool = None)[source]

Create a presentation exchange record for input presentation proposal.

Parameters:
  • connection_id – connection identifier
  • pres_proposal_message – presentation proposal to serialize to exchange record
  • auto_present – whether to present proof upon receiving proof request (default to configuration setting)
  • auto_remove – whether to remove this presentation exchange upon completion
Returns:

Presentation exchange record, created

create_exchange_for_request(connection_id: str, pres_request_message: aries_cloudagent.protocols.present_proof.v2_0.messages.pres_request.V20PresRequest, auto_verify: bool = None, auto_remove: bool = None)[source]

Create a presentation exchange record for input presentation request.

Parameters:
  • connection_id – connection identifier
  • pres_request_message – presentation request to use in creating exchange record, extracting indy proof request and thread id
  • auto_verify – whether to auto-verify presentation exchange
  • auto_remove – whether to remove this presentation exchange upon completion
Returns:

Presentation exchange record, updated

create_pres(pres_ex_record: aries_cloudagent.protocols.present_proof.v2_0.models.pres_exchange.V20PresExRecord, request_data: dict = {}, *, comment: str = None) → Tuple[aries_cloudagent.protocols.present_proof.v2_0.models.pres_exchange.V20PresExRecord, aries_cloudagent.protocols.present_proof.v2_0.messages.pres.V20Pres][source]

Create a presentation.

Parameters:
  • pres_ex_record – record to update
  • requested_credentials – indy formatted requested_credentials
  • comment – optional human-readable comment
  • format – presentation format

Example requested_credentials format, mapping proof request referents (uuid) to wallet referents (cred id):

{
    "self_attested_attributes": {
        "j233ffbc-bd35-49b1-934f-51e083106f6d": "value"
    },
    "requested_attributes": {
        "6253ffbb-bd35-49b3-934f-46e083106f6c": {
            "cred_id": "5bfa40b7-062b-4ae0-a251-a86c87922c0e",
            "revealed": true
        }
    },
    "requested_predicates": {
        "bfc8a97d-60d3-4f21-b998-85eeabe5c8c0": {
            "cred_id": "5bfa40b7-062b-4ae0-a251-a86c87922c0e"
        }
    }
}
Returns:A tuple (updated presentation exchange record, presentation message)
receive_pres(message: aries_cloudagent.protocols.present_proof.v2_0.messages.pres.V20Pres, connection_record: Optional[aries_cloudagent.connections.models.conn_record.ConnRecord], oob_record: Optional[aries_cloudagent.protocols.out_of_band.v1_0.models.oob_record.OobRecord])[source]

Receive a presentation, from message in context on manager creation.

Returns:presentation exchange record, retrieved and updated
receive_pres_ack(message: aries_cloudagent.protocols.present_proof.v2_0.messages.pres_ack.V20PresAck, conn_record: aries_cloudagent.connections.models.conn_record.ConnRecord)[source]

Receive a presentation ack, from message in context on manager creation.

Returns:presentation exchange record, retrieved and updated
receive_pres_proposal(message: aries_cloudagent.protocols.present_proof.v2_0.messages.pres_proposal.V20PresProposal, conn_record: aries_cloudagent.connections.models.conn_record.ConnRecord)[source]

Receive a presentation proposal from message in context on manager creation.

Returns:Presentation exchange record, created
receive_pres_request(pres_ex_record: aries_cloudagent.protocols.present_proof.v2_0.models.pres_exchange.V20PresExRecord)[source]

Receive a presentation request.

Parameters:pres_ex_record – presentation exchange record with request to receive
Returns:The presentation exchange record, updated
receive_problem_report(message: aries_cloudagent.protocols.present_proof.v2_0.messages.pres_problem_report.V20PresProblemReport, connection_id: str)[source]

Receive problem report.

Returns:presentation exchange record, retrieved and updated
send_pres_ack(pres_ex_record: aries_cloudagent.protocols.present_proof.v2_0.models.pres_exchange.V20PresExRecord, responder: Optional[aries_cloudagent.messaging.responder.BaseResponder] = None)[source]

Send acknowledgement of presentation receipt.

Parameters:pres_ex_record – presentation exchange record with thread id
verify_pres(pres_ex_record: aries_cloudagent.protocols.present_proof.v2_0.models.pres_exchange.V20PresExRecord, responder: Optional[aries_cloudagent.messaging.responder.BaseResponder] = None)[source]

Verify a presentation.

Parameters:pres_ex_record – presentation exchange record with presentation request and presentation to verify
Returns:presentation exchange record, updated
exception aries_cloudagent.protocols.present_proof.v2_0.manager.V20PresManagerError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Presentation error.

aries_cloudagent.protocols.present_proof.v2_0.message_types module

Message and inner object type identifiers for present-proof protocol v2.0.

aries_cloudagent.protocols.present_proof.v2_0.routes module

Admin routes for presentations.

class aries_cloudagent.protocols.present_proof.v2_0.routes.V20CredentialsFetchQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for credentials fetch request query string.

count

Used by autodoc_mock_imports.

extra_query

Used by autodoc_mock_imports.

referent

Used by autodoc_mock_imports.

start

Used by autodoc_mock_imports.

class aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresCreateRequestRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.utils.tracing.AdminAPIMessageTracingSchema

Request schema for creating a proof request free of any connection.

auto_remove

Used by autodoc_mock_imports.

auto_verify

Used by autodoc_mock_imports.

comment

Used by autodoc_mock_imports.

presentation_request

Used by autodoc_mock_imports.

trace

Used by autodoc_mock_imports.

class aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresExIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters for request taking presentation exchange id.

pres_ex_id

Used by autodoc_mock_imports.

class aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresExRecordListQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for presentation exchange list query.

connection_id

Used by autodoc_mock_imports.

role

Used by autodoc_mock_imports.

state

Used by autodoc_mock_imports.

thread_id

Used by autodoc_mock_imports.

class aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresExRecordListSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for a presentation exchange query.

results

Used by autodoc_mock_imports.

class aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresProblemReportRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for sending problem report.

description

Used by autodoc_mock_imports.

class aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresProposalByFormatSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Schema for presentation proposal per format.

dif

Used by autodoc_mock_imports.

indy

Used by autodoc_mock_imports.

validate_fields(data, **kwargs)[source]

Validate schema fields: data must have at least one format.

Parameters:data – The data to validate
Raises:ValidationError – if data has no formats
class aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresProposalRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.utils.tracing.AdminAPIMessageTracingSchema

Request schema for sending a presentation proposal admin message.

auto_present

Used by autodoc_mock_imports.

auto_remove

Used by autodoc_mock_imports.

comment

Used by autodoc_mock_imports.

connection_id

Used by autodoc_mock_imports.

presentation_proposal

Used by autodoc_mock_imports.

trace

Used by autodoc_mock_imports.

class aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresRequestByFormatSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Presentation request per format.

dif

Used by autodoc_mock_imports.

indy

Used by autodoc_mock_imports.

validate_fields(data, **kwargs)[source]

Validate schema fields: data must have at least one format.

Parameters:data – The data to validate
Raises:ValidationError – if data has no formats
class aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresSendRequestRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresCreateRequestRequestSchema

Request schema for sending a proof request on a connection.

connection_id

Used by autodoc_mock_imports.

class aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresSpecByFormatRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.utils.tracing.AdminAPIMessageTracingSchema

Presentation specification schema by format, for send-presentation request.

auto_remove

Used by autodoc_mock_imports.

dif

Used by autodoc_mock_imports.

indy

Used by autodoc_mock_imports.

validate_fields(data, **kwargs)[source]

Validate schema fields: specify exactly one format.

Parameters:data – The data to validate
Raises:ValidationError – if data does not have exactly one format.
class aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresentProofModuleResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for Present Proof Module.

class aries_cloudagent.protocols.present_proof.v2_0.routes.V20PresentationSendRequestToProposalSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.utils.tracing.AdminAPIMessageTracingSchema

Request schema for sending a proof request bound to a proposal.

auto_remove

Used by autodoc_mock_imports.

auto_verify

Used by autodoc_mock_imports.

trace

Used by autodoc_mock_imports.

aries_cloudagent.protocols.present_proof.v2_0.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Amend swagger API.

aries_cloudagent.protocols.present_proof.v2_0.routes.present_proof_create_request(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Request handler for creating a free presentation request.

The presentation request will not be bound to any proposal or existing connection.

Parameters:request – aiohttp request object
Returns:The presentation exchange details
aries_cloudagent.protocols.present_proof.v2_0.routes.present_proof_credentials_list(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Request handler for searching applicable credential records.

Parameters:request – aiohttp request object
Returns:The credential list response
aries_cloudagent.protocols.present_proof.v2_0.routes.present_proof_list(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Request handler for searching presentation exchange records.

Parameters:request – aiohttp request object
Returns:The presentation exchange list response
aries_cloudagent.protocols.present_proof.v2_0.routes.present_proof_problem_report(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Request handler for sending problem report.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.present_proof.v2_0.routes.present_proof_remove(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Request handler for removing a presentation exchange record.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.present_proof.v2_0.routes.present_proof_retrieve(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Request handler for fetching a single presentation exchange record.

Parameters:request – aiohttp request object
Returns:The presentation exchange record response
aries_cloudagent.protocols.present_proof.v2_0.routes.present_proof_send_bound_request(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Request handler for sending a presentation request bound to a proposal.

Parameters:request – aiohttp request object
Returns:The presentation exchange details
aries_cloudagent.protocols.present_proof.v2_0.routes.present_proof_send_free_request(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Request handler for sending a presentation request free from any proposal.

Parameters:request – aiohttp request object
Returns:The presentation exchange details
aries_cloudagent.protocols.present_proof.v2_0.routes.present_proof_send_presentation(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Request handler for sending a presentation.

Parameters:request – aiohttp request object
Returns:The presentation exchange details
aries_cloudagent.protocols.present_proof.v2_0.routes.present_proof_send_proposal(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Request handler for sending a presentation proposal.

Parameters:request – aiohttp request object
Returns:The presentation exchange details
aries_cloudagent.protocols.present_proof.v2_0.routes.present_proof_verify_presentation(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Request handler for verifying a presentation request.

Parameters:request – aiohttp request object
Returns:The presentation exchange details
aries_cloudagent.protocols.present_proof.v2_0.routes.process_vcrecords_return_list(vc_records: Sequence[aries_cloudagent.storage.vc_holder.vc_record.VCRecord], record_ids: set) → Tuple[Sequence[aries_cloudagent.storage.vc_holder.vc_record.VCRecord], set][source]

Return list of non-duplicate VCRecords.

aries_cloudagent.protocols.present_proof.v2_0.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fc0440bd4c0>)[source]

Register routes.

aries_cloudagent.protocols.present_proof.v2_0.routes.retrieve_uri_list_from_schema_filter(schema_uri_groups: Sequence[Sequence[aries_cloudagent.protocols.present_proof.dif.pres_exch.SchemaInputDescriptor]]) → Sequence[str][source]

Retrieve list of schema uri from uri_group.