Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alias field to didexchange invitation UI #1561

Merged
merged 2 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aries_cloudagent/protocols/didexchange/v1_0/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ async def create_request_implicit(
my_endpoint: str = None,
mediation_id: str = None,
use_public_did: bool = False,
alias: str = None,
) -> ConnRecord:
"""
Create and send a request against a public DID only (no explicit invitation).
Expand Down Expand Up @@ -199,7 +200,7 @@ async def create_request_implicit(
invitation_key=None,
invitation_msg_id=None,
accept=None,
alias=my_label,
alias=alias,
their_public_did=their_public_did,
connection_protocol=DIDX_PROTO,
)
Expand Down
7 changes: 7 additions & 0 deletions aries_cloudagent/protocols/didexchange/v1_0/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ class DIDXCreateRequestImplicitQueryStringSchema(OpenAPISchema):
description="Qualified public DID to which to request connection",
**GENERIC_DID,
)
alias = fields.Str(
description="Alias for connection",
required=False,
example="Barry",
)
my_endpoint = fields.Str(description="My URL endpoint", required=False, **ENDPOINT)
my_label = fields.Str(
description="Label for connection request", required=False, example="Broker"
Expand Down Expand Up @@ -183,6 +188,7 @@ async def didx_create_request_implicit(request: web.BaseRequest):
my_label = request.query.get("my_label") or None
my_endpoint = request.query.get("my_endpoint") or None
mediation_id = request.query.get("mediation_id") or None
alias = request.query.get("alias") or None
use_public_did = json.loads(request.query.get("use_public_did", "null"))

profile = context.profile
Expand All @@ -194,6 +200,7 @@ async def didx_create_request_implicit(request: web.BaseRequest):
my_endpoint=my_endpoint,
mediation_id=mediation_id,
use_public_did=use_public_did,
alias=alias,
)
except StorageNotFoundError as err:
raise web.HTTPNotFound(reason=err.roll_up) from err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ async def test_create_request_implicit(self):
my_label=None,
my_endpoint=None,
mediation_id=mediation_record._id,
alias="Tester",
)

assert conn_rec
Expand All @@ -260,6 +261,7 @@ async def test_create_request_implicit_use_public_did(self):
my_endpoint=None,
mediation_id=mediation_record._id,
use_public_did=True,
alias="Tester",
)

assert info_public.did == conn_rec.my_did
Expand All @@ -272,6 +274,7 @@ async def test_create_request_implicit_no_public_did(self):
my_endpoint=None,
mediation_id=None,
use_public_did=True,
alias="Tester",
)

assert "No public DID configured" in str(context.exception)
Expand Down