Closed kukgini closed 5 months ago
I don't understand the SwiftLint error. someone could help?
The comment on line 1 is no longer necessary. You can remove it.
The DCO check can be handled in this PR. There's a guide on how to do it on the "Details" page.
func findConnectionByMessageThreadId(message: AgentMessage) async throws -> ConnectionRecord? {
let threadId = message.threadId
guard let oobRecord = try await agent.outOfBandService.findByAttachmentThreadId(threadId) else {
return nil
}
guard let invitationKey = try oobRecord.outOfBandInvitation.invitationKey() else {
return nil
}
let connection = await agent.connectionService.findByInvitationKey(invitationKey)
return connection
}
We are using message.threadId
to find the related oob-record here.
I've checked out the oob spec again and found this: The response to an out-of-band message MUST set its ~thread.pthid equal to the @id property of the out-of-band message.
And, we are assigning the pthid
to all outbound messages in MessageSender
according to the spec.
So, we'll be able to find the oob-record by message.parentThreadId
without introducing the attach_thread_id
tag.
@conanoc I didn't know that pthid
in credential-request
or presentation message
is same as oob @id
. When testing, I couldn't do that because this value was different. Are you saying that I need to set the oob @id
to pthid when creating a message?
We are assigning the pthid to all outbound messages in MessageSender: https://github.com/hyperledger/aries-framework-swift/blob/main/Sources/AriesFramework/agent/MessageSender.swift#L48 I guess the pthid of the messages(credential-request or presentation message) should be already the same as the oob id. (Note that the pthid is assigned just before the message is sent.)
You are right. I was confused oob invitation id with oob record id.
Good job.
The strange lint errors are gone now. I don't know what happened to swiftlint.
It seems like the only thing left to do is implement the testConnectionlessProofExchange()
function.
Looks good. Thanks.
To solve the issue #108 If Agent receives out-of-band message with attachment without handshake protocols, It precess the attachment and send message to counter party if necessary. When It send a message, It use the service decorator in the out-of-band message. By doing this Agent supports connection-less credential exchange and proof exchange.
Second approach. unit test is not implemented yet.