Skip to content

Commit

Permalink
Merge pull request #2461 from anwalker293/fix/didexchange-responder-t…
Browse files Browse the repository at this point in the history
…erminal-state-to-active

fix: issue #2434: Change DIDExchange States to Match rfc160
  • Loading branch information
dbluhm authored Sep 6, 2023
2 parents 3a0552c + b8b043e commit 85d68b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
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

0 comments on commit 85d68b1

Please sign in to comment.