Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fix-216-credentia…
Browse files Browse the repository at this point in the history
…l-api
  • Loading branch information
ianco committed Feb 24, 2020
2 parents b5a80c4 + d816653 commit bc4fc7b
Show file tree
Hide file tree
Showing 30 changed files with 295 additions and 95 deletions.
8 changes: 6 additions & 2 deletions aries_cloudagent/admin/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AdminModulesSchema(Schema):
"""Schema for the modules endpoint."""

result = fields.List(
fields.Str(description="admin module"), description="List of admin modules",
fields.Str(description="admin module"), description="List of admin modules"
)


Expand Down Expand Up @@ -377,7 +377,11 @@ async def websocket_handler(self, request):
receive = loop.create_task(ws.receive())

if send.done():
msg = send.result()
try:
msg = send.result()
except asyncio.TimeoutError:
msg = None

if msg is None:
# we send fake pings because the JS client
# can't detect real ones
Expand Down
9 changes: 9 additions & 0 deletions aries_cloudagent/protocols/actionmenu/message_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@
MENU_REQUEST = f"{PROTOCOL_URI}/menu-request"
PERFORM = f"{PROTOCOL_URI}/perform"

NEW_PROTOCOL_URI = "https://didcomm.org/action-menu/1.0"

NEW_MENU = f"{NEW_PROTOCOL_URI}/menu"
NEW_MENU_REQUEST = f"{NEW_PROTOCOL_URI}/menu-request"
NEW_PERFORM = f"{NEW_PROTOCOL_URI}/perform"

PROTOCOL_PACKAGE = "aries_cloudagent.protocols.actionmenu"

MESSAGE_TYPES = {
MENU: f"{PROTOCOL_PACKAGE}.messages.menu.Menu",
MENU_REQUEST: (f"{PROTOCOL_PACKAGE}.messages.menu_request.MenuRequest"),
PERFORM: f"{PROTOCOL_PACKAGE}.messages.perform.Perform",
NEW_MENU: f"{PROTOCOL_PACKAGE}.messages.menu.Menu",
NEW_MENU_REQUEST: (f"{PROTOCOL_PACKAGE}.messages.menu_request.MenuRequest"),
NEW_PERFORM: f"{PROTOCOL_PACKAGE}.messages.perform.Perform",
}

CONTROLLERS = {PROTOCOL_URI: f"{PROTOCOL_PACKAGE}.controller.Controller"}
2 changes: 1 addition & 1 deletion aries_cloudagent/protocols/actionmenu/messages/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Meta:

model_class = Menu

title = fields.Str(required=False, description="Menu title", example="My Menu",)
title = fields.Str(required=False, description="Menu title", example="My Menu")
description = fields.Str(
required=False,
description="Introductory text for the menu",
Expand Down
7 changes: 6 additions & 1 deletion aries_cloudagent/protocols/basicmessage/message_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@

BASIC_MESSAGE = f"{PROTOCOL_URI}/message"

NEW_PROTOCOL_URI = "https://didcomm.org/basicmessage/1.0"

NEW_BASIC_MESSAGE = f"{NEW_PROTOCOL_URI}/message"

PROTOCOL_PACKAGE = "aries_cloudagent.protocols.basicmessage"

MESSAGE_TYPES = {
BASIC_MESSAGE: f"{PROTOCOL_PACKAGE}.messages.basicmessage.BasicMessage"
BASIC_MESSAGE: f"{PROTOCOL_PACKAGE}.messages.basicmessage.BasicMessage",
NEW_BASIC_MESSAGE: f"{PROTOCOL_PACKAGE}.messages.basicmessage.BasicMessage",
}
17 changes: 17 additions & 0 deletions aries_cloudagent/protocols/connections/message_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
CONNECTION_RESPONSE = f"{PROTOCOL_URI}/response"
PROBLEM_REPORT = f"{PROTOCOL_URI}/problem_report"

NEW_PROTOCOL_URI = "https://didcomm.org/connections/1.0"

NEW_CONNECTION_INVITATION = f"{NEW_PROTOCOL_URI}/invitation"
NEW_CONNECTION_REQUEST = f"{NEW_PROTOCOL_URI}/request"
NEW_CONNECTION_RESPONSE = f"{NEW_PROTOCOL_URI}/response"
NEW_PROBLEM_REPORT = f"{NEW_PROTOCOL_URI}/problem_report"

PROTOCOL_PACKAGE = "aries_cloudagent.protocols.connections"

MESSAGE_TYPES = {
Expand All @@ -20,4 +27,14 @@
f"{PROTOCOL_PACKAGE}.messages.connection_response.ConnectionResponse"
),
PROBLEM_REPORT: f"{PROTOCOL_PACKAGE}.messages.problem_report.ProblemReport",
NEW_CONNECTION_INVITATION: (
f"{PROTOCOL_PACKAGE}.messages.connection_invitation.ConnectionInvitation"
),
NEW_CONNECTION_REQUEST: (
f"{PROTOCOL_PACKAGE}.messages.connection_request.ConnectionRequest"
),
NEW_CONNECTION_RESPONSE: (
f"{PROTOCOL_PACKAGE}.messages.connection_response.ConnectionResponse"
),
NEW_PROBLEM_REPORT: f"{PROTOCOL_PACKAGE}.messages.problem_report.ProblemReport",
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class Meta:
model_class = ConnectionInvitation

label = fields.Str(
required=False, description="Optional label for connection", example="Bob",
required=False, description="Optional label for connection", example="Bob"
)
did = fields.Str(
required=False, description="DID for connection invitation", **INDY_DID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Meta:

model_class = ConnectionRequest

connection = fields.Nested(ConnectionDetailSchema, required=True,)
connection = fields.Nested(ConnectionDetailSchema, required=True)
label = fields.Str(
required=True,
description="Label for connection request",
Expand Down
19 changes: 19 additions & 0 deletions aries_cloudagent/protocols/credentials/message_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
CREDENTIAL_ISSUE = f"{PROTOCOL_URI}/credential-issue"
CREDENTIAL_STORED = f"{PROTOCOL_URI}/credential-stored"

NEW_PROTOCOL_URI = "https://didcomm.org/credential-issuance/0.1"

NEW_CREDENTIAL_OFFER = f"{NEW_PROTOCOL_URI}/credential-offer"
NEW_CREDENTIAL_REQUEST = f"{NEW_PROTOCOL_URI}/credential-request"
NEW_CREDENTIAL_ISSUE = f"{NEW_PROTOCOL_URI}/credential-issue"
NEW_CREDENTIAL_STORED = f"{NEW_PROTOCOL_URI}/credential-stored"

PROTOCOL_PACKAGE = "aries_cloudagent.protocols.credentials"

MESSAGE_TYPES = {
Expand All @@ -18,4 +25,16 @@
CREDENTIAL_STORED: (
f"{PROTOCOL_PACKAGE}.messages.credential_stored.CredentialStored"
),
NEW_CREDENTIAL_OFFER: (
f"{PROTOCOL_PACKAGE}.messages.credential_offer.CredentialOffer"
),
NEW_CREDENTIAL_REQUEST: (
f"{PROTOCOL_PACKAGE}.messages.credential_request.CredentialRequest"
),
NEW_CREDENTIAL_ISSUE: (
f"{PROTOCOL_PACKAGE}.messages.credential_issue.CredentialIssue"
),
NEW_CREDENTIAL_STORED: (
f"{PROTOCOL_PACKAGE}.messages.credential_stored.CredentialStored"
),
}
7 changes: 7 additions & 0 deletions aries_cloudagent/protocols/discovery/message_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
DISCLOSE = f"{PROTOCOL_URI}/disclose"
QUERY = f"{PROTOCOL_URI}/query"

NEW_PROTOCOL_URI = "https://didcomm.org/discover-features/1.0"

NEW_DISCLOSE = f"{NEW_PROTOCOL_URI}/disclose"
NEW_QUERY = f"{NEW_PROTOCOL_URI}/query"

PROTOCOL_PACKAGE = "aries_cloudagent.protocols.discovery"

MESSAGE_TYPES = {
DISCLOSE: f"{PROTOCOL_PACKAGE}.messages.disclose.Disclose",
QUERY: f"{PROTOCOL_PACKAGE}.messages.query.Query",
NEW_DISCLOSE: f"{PROTOCOL_PACKAGE}.messages.disclose.Disclose",
NEW_QUERY: f"{PROTOCOL_PACKAGE}.messages.query.Query",
}
13 changes: 13 additions & 0 deletions aries_cloudagent/protocols/introduction/message_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
INVITATION = f"{PROTOCOL_URI}/invitation"
FORWARD_INVITATION = f"{PROTOCOL_URI}/forward-invitation"

NEW_PROTOCOL_URI = "https://didcomm.org/introduction-service/0.1"

NEW_INVITATION_REQUEST = f"{NEW_PROTOCOL_URI}/invitation-request"
NEW_INVITATION = f"{NEW_PROTOCOL_URI}/invitation"
NEW_FORWARD_INVITATION = f"{NEW_PROTOCOL_URI}/forward-invitation"

PROTOCOL_PACKAGE = "aries_cloudagent.protocols.introduction"

MESSAGE_TYPES = {
Expand All @@ -16,4 +22,11 @@
FORWARD_INVITATION: (
f"{PROTOCOL_PACKAGE}.messages.forward_invitation.ForwardInvitation"
),
NEW_INVITATION_REQUEST: (
f"{PROTOCOL_PACKAGE}.messages.invitation_request.InvitationRequest"
),
NEW_INVITATION: f"{PROTOCOL_PACKAGE}.messages.invitation.Invitation",
NEW_FORWARD_INVITATION: (
f"{PROTOCOL_PACKAGE}.messages.forward_invitation.ForwardInvitation"
),
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Meta:

model_class = ForwardInvitation

invitation = fields.Nested(ConnectionInvitationSchema(), required=True,)
invitation = fields.Nested(ConnectionInvitationSchema(), required=True)
message = fields.Str(
required=False,
allow_none=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Meta:

model_class = Invitation

invitation = fields.Nested(ConnectionInvitationSchema(), required=True,)
invitation = fields.Nested(ConnectionInvitationSchema(), required=True)
message = fields.Str(
required=False,
description="Comments on the introduction",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
CREDENTIAL_ISSUE = f"{PROTOCOL_URI}/issue-credential"
CREDENTIAL_ACK = f"{PROTOCOL_URI}/ack"

NEW_PROTOCOL_URI = "https://didcomm.org/issue-credential/1.0"

# Message types

NEW_CREDENTIAL_PROPOSAL = f"{NEW_PROTOCOL_URI}/propose-credential"
NEW_CREDENTIAL_OFFER = f"{NEW_PROTOCOL_URI}/offer-credential"
NEW_CREDENTIAL_REQUEST = f"{NEW_PROTOCOL_URI}/request-credential"
NEW_CREDENTIAL_ISSUE = f"{NEW_PROTOCOL_URI}/issue-credential"
NEW_CREDENTIAL_ACK = f"{NEW_PROTOCOL_URI}/ack"

PROTOCOL_PACKAGE = "aries_cloudagent.protocols.issue_credential.v1_0"

MESSAGE_TYPES = {
Expand All @@ -21,7 +31,20 @@
f"{PROTOCOL_PACKAGE}.messages.credential_request.CredentialRequest"
),
CREDENTIAL_ISSUE: f"{PROTOCOL_PACKAGE}.messages.credential_issue.CredentialIssue",
CREDENTIAL_ACK: (f"{PROTOCOL_PACKAGE}.messages.credential_ack.CredentialAck"),
CREDENTIAL_ACK: f"{PROTOCOL_PACKAGE}.messages.credential_ack.CredentialAck",
NEW_CREDENTIAL_PROPOSAL: (
f"{PROTOCOL_PACKAGE}.messages.credential_proposal.CredentialProposal"
),
NEW_CREDENTIAL_OFFER: (
f"{PROTOCOL_PACKAGE}.messages.credential_offer.CredentialOffer"
),
NEW_CREDENTIAL_REQUEST: (
f"{PROTOCOL_PACKAGE}.messages.credential_request.CredentialRequest"
),
NEW_CREDENTIAL_ISSUE: (
f"{PROTOCOL_PACKAGE}.messages.credential_issue.CredentialIssue"
),
NEW_CREDENTIAL_ACK: f"{PROTOCOL_PACKAGE}.messages.credential_ack.CredentialAck",
}

# Inner object types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,36 +79,11 @@ class Meta:

comment = fields.Str(required=False, allow_none=False)
credential_proposal = fields.Nested(
CredentialPreviewSchema,
required=False,
allow_none=False,
)
schema_id = fields.Str(
required=False,
allow_none=False,
**INDY_SCHEMA_ID
)
schema_issuer_did = fields.Str(
required=False,
allow_none=False,
**INDY_DID
)
schema_name = fields.Str(
required=False,
allow_none=False,
)
schema_version = fields.Str(
required=False,
allow_none=False,
**INDY_VERSION
)
cred_def_id = fields.Str(
required=False,
allow_none=False,
**INDY_CRED_DEF_ID
)
issuer_did = fields.Str(
required=False,
allow_none=False,
**INDY_DID
CredentialPreviewSchema, required=False, allow_none=False
)
schema_id = fields.Str(required=False, allow_none=False, **INDY_SCHEMA_ID)
schema_issuer_did = fields.Str(required=False, allow_none=False, **INDY_DID)
schema_name = fields.Str(required=False, allow_none=False)
schema_version = fields.Str(required=False, allow_none=False, **INDY_VERSION)
cred_def_id = fields.Str(required=False, allow_none=False, **INDY_CRED_DEF_ID)
issuer_did = fields.Str(required=False, allow_none=False, **INDY_DID)
18 changes: 18 additions & 0 deletions aries_cloudagent/protocols/present_proof/v1_0/message_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
PRESENTATION = f"{PROTOCOL_URI}/presentation"
PRESENTATION_ACK = f"{PROTOCOL_URI}/ack"

NEW_PROTOCOL_URI = "https://didcomm.org/present-proof/1.0"

# New Message types

NEW_PRESENTATION_PROPOSAL = f"{NEW_PROTOCOL_URI}/propose-presentation"
NEW_PRESENTATION_REQUEST = f"{NEW_PROTOCOL_URI}/request-presentation"
NEW_PRESENTATION = f"{NEW_PROTOCOL_URI}/presentation"
NEW_PRESENTATION_ACK = f"{NEW_PROTOCOL_URI}/ack"

PROTOCOL_PACKAGE = "aries_cloudagent.protocols.present_proof.v1_0"

MESSAGE_TYPES = {
Expand All @@ -20,6 +29,15 @@
),
PRESENTATION: f"{PROTOCOL_PACKAGE}.messages.presentation.Presentation",
PRESENTATION_ACK: f"{PROTOCOL_PACKAGE}.messages.presentation_ack.PresentationAck",
NEW_PRESENTATION_PROPOSAL: (
f"{PROTOCOL_PACKAGE}.messages.presentation_proposal.PresentationProposal"
),
NEW_PRESENTATION_REQUEST: (
f"{PROTOCOL_PACKAGE}.messages.presentation_request.PresentationRequest"
),
NEW_PRESENTATION: f"{PROTOCOL_PACKAGE}.messages.presentation.Presentation",
NEW_PRESENTATION_ACK: f"{PROTOCOL_PACKAGE}.messages"
+ ".presentation_ack.PresentationAck",
}

# Inner object types
Expand Down
11 changes: 11 additions & 0 deletions aries_cloudagent/protocols/presentations/message_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
PRESENTATION_REQUEST = f"{PROTOCOL_URI}/presentation-request"
CREDENTIAL_PRESENTATION = f"{PROTOCOL_URI}/credential-presentation"

NEW_PROTOCOL_URI = "https://didcomm.org/credential-presentation/0.1"

NEW_PRESENTATION_REQUEST = f"{NEW_PROTOCOL_URI}/presentation-request"
NEW_CREDENTIAL_PRESENTATION = f"{NEW_PROTOCOL_URI}/credential-presentation"

PROTOCOL_PACKAGE = "aries_cloudagent.protocols.presentations"

MESSAGE_TYPES = {
Expand All @@ -14,4 +19,10 @@
CREDENTIAL_PRESENTATION: (
f"{PROTOCOL_PACKAGE}.messages.credential_presentation.CredentialPresentation"
),
NEW_PRESENTATION_REQUEST: (
f"{PROTOCOL_PACKAGE}.messages.presentation_request.PresentationRequest"
),
NEW_CREDENTIAL_PRESENTATION: (
f"{PROTOCOL_PACKAGE}.messages.credential_presentation.CredentialPresentation"
),
}
2 changes: 1 addition & 1 deletion aries_cloudagent/protocols/problem_report/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Meta:
example="did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/error-codes",
)
locale = fields.Str(
data_key="@locale", required=False, description="Locale", example="en-US",
data_key="@locale", required=False, description="Locale", example="en-US"
)
explain_ltxt = fields.Str(
data_key="explain-ltxt",
Expand Down
9 changes: 8 additions & 1 deletion aries_cloudagent/protocols/problem_report/message_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

PROBLEM_REPORT = f"{PROTOCOL_URI}/problem-report"

NEW_PROTOCOL_URI = "https://didcomm.org/notification/1.0"

NEW_PROBLEM_REPORT = f"{NEW_PROTOCOL_URI}/problem-report"

PROTOCOL_PACKAGE = "aries_cloudagent.protocols.problem_report"

MESSAGE_TYPES = {PROBLEM_REPORT: f"{PROTOCOL_PACKAGE}.message.ProblemReport"}
MESSAGE_TYPES = {
PROBLEM_REPORT: f"{PROTOCOL_PACKAGE}.message.ProblemReport",
NEW_PROBLEM_REPORT: f"{PROTOCOL_PACKAGE}.message.ProblemReport"
}
Loading

0 comments on commit bc4fc7b

Please sign in to comment.