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

fix: issue #2434: Change DIDExchange States to Match rfc160 #2461

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
2 changes: 1 addition & 1 deletion aries_cloudagent/connections/models/conn_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ async def delete_record(self, session: ProfileSession):
async def abandon(self, session: ProfileSession, *, reason: Optional[str] = None):
"""Set state to abandoned."""
reason = reason or "Connectin abandoned"
self.state = ConnRecord.State.ABANDONED.rfc23
self.state = ConnRecord.State.ABANDONED.rfc160
self.error_msg = reason
await self.save(session, reason=reason)

Expand Down
20 changes: 10 additions & 10 deletions aries_cloudagent/protocols/didexchange/v1_0/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ async def receive_invitation(
invitation_msg_id=invitation._id,
their_label=invitation.label,
their_role=ConnRecord.Role.RESPONDER.rfc23,
state=ConnRecord.State.INVITATION.rfc23,
state=ConnRecord.State.INVITATION.rfc160,
accept=accept,
alias=alias,
their_public_did=their_public_did,
Expand Down Expand Up @@ -164,7 +164,7 @@ async def receive_invitation(
connection_id=conn_rec.connection_id,
)

conn_rec.state = ConnRecord.State.REQUEST.rfc23
conn_rec.state = ConnRecord.State.REQUEST.rfc160
async with self.profile.session() as session:
await conn_rec.save(session, reason="Sent connection request")
else:
Expand Down Expand Up @@ -249,7 +249,7 @@ async def create_request_implicit(
use_public_did=bool(my_public_info),
)
conn_rec.request_id = request._id
conn_rec.state = ConnRecord.State.REQUEST.rfc23
conn_rec.state = ConnRecord.State.REQUEST.rfc160
async with self.profile.session() as session:
await conn_rec.save(session, reason="Created connection request")
responder = self.profile.inject_or(BaseResponder)
Expand Down Expand Up @@ -371,7 +371,7 @@ async def create_request(

# Update connection state
conn_rec.request_id = request._id
conn_rec.state = ConnRecord.State.REQUEST.rfc23
conn_rec.state = ConnRecord.State.REQUEST.rfc160
async with self.profile.session() as session:
await conn_rec.save(session, reason="Created connection request")

Expand Down Expand Up @@ -467,7 +467,7 @@ async def receive_request(
new_conn_rec = ConnRecord(
invitation_key=connection_key,
my_did=my_info.did,
state=ConnRecord.State.REQUEST.rfc23,
state=ConnRecord.State.REQUEST.rfc160,
accept=conn_rec.accept,
their_role=conn_rec.their_role,
connection_protocol=DIDX_PROTO,
Expand Down Expand Up @@ -523,7 +523,7 @@ async def receive_request(
if alias:
conn_rec.alias = alias
conn_rec.their_did = request.did
conn_rec.state = ConnRecord.State.REQUEST.rfc23
conn_rec.state = ConnRecord.State.REQUEST.rfc160
conn_rec.request_id = request._id
async with self.profile.session() as session:
await conn_rec.save(
Expand Down Expand Up @@ -556,7 +556,7 @@ async def receive_request(
invitation_key=connection_key,
invitation_msg_id=None,
request_id=request._id,
state=ConnRecord.State.REQUEST.rfc23,
state=ConnRecord.State.REQUEST.rfc160,
connection_protocol=DIDX_PROTO,
)
async with self.profile.session() as session:
Expand Down Expand Up @@ -799,7 +799,7 @@ async def accept_response(
await self.record_keys_for_public_did(response.did)

conn_rec.their_did = their_did
conn_rec.state = ConnRecord.State.RESPONSE.rfc23
conn_rec.state = ConnRecord.State.RESPONSE.rfc160
async with self.profile.session() as session:
await conn_rec.save(session, reason="Accepted connection response")

Expand All @@ -822,7 +822,7 @@ async def accept_response(
if responder:
await responder.send_reply(complete, connection_id=conn_rec.connection_id)

conn_rec.state = ConnRecord.State.COMPLETED.rfc23
conn_rec.state = ConnRecord.State.COMPLETED.rfc160
async with self.profile.session() as session:
await conn_rec.save(session, reason="Sent connection complete")
if session.settings.get("auto_disclose_features"):
Expand Down Expand Up @@ -884,7 +884,7 @@ async def accept_complete(
error_code=ProblemReportReason.COMPLETE_NOT_ACCEPTED.value,
)

conn_rec.state = ConnRecord.State.COMPLETED.rfc23
conn_rec.state = ConnRecord.State.COMPLETED.rfc160
async with self.profile.session() as session:
await conn_rec.save(session, reason="Received connection complete")
if session.settings.get("auto_disclose_features"):
Expand Down