Skip to content

Commit

Permalink
Fix decoding error when oob attachments contain json data (#11)
Browse files Browse the repository at this point in the history
Signed-off-by: conanoc <[email protected]>
  • Loading branch information
conanoc authored Dec 19, 2022
1 parent c5994e7 commit 067e0ee
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,19 @@ public class OutOfBandInvitation: AgentMessage {
if let encodedInvitation = encodedInvitation,
let data = Data(base64Encoded: encodedInvitation.base64urlToBase64()),
let message = String(data: data, encoding: .utf8) {
let replaced = replaceLegacyDidSovWithNewDidCommPrefix(message: message)
return try JSONDecoder().decode(OutOfBandInvitation.self, from: replaced.data(using: .utf8)!)
var replaced = replaceLegacyDidSovWithNewDidCommPrefix(message: message)
replaced = try serializeJsonAttatchments(message: replaced)
return try JSONDecoder().decode(OutOfBandInvitation.self, from: replaced.data(using: .utf8)!)
} else {
throw AriesFrameworkError.frameworkError("InvitationUrl is invalid. It needs to contain one, and only one, of the following parameters; `oob`")
}
}

public static func fromJson(_ json: String) throws -> OutOfBandInvitation {
// ACA-Py may use the legacy did:sov: prefix, especially in the handshake_protocols field.
let message = replaceLegacyDidSovWithNewDidCommPrefix(message: json)
var message = replaceLegacyDidSovWithNewDidCommPrefix(message: json)

message = try serializeJsonAttatchments(message: message)
return try JSONDecoder().decode(OutOfBandInvitation.self, from: message.data(using: .utf8)!)
}

Expand Down Expand Up @@ -140,4 +143,36 @@ public class OutOfBandInvitation: AgentMessage {

return message.replacingOccurrences(of: didSovPrefix, with: didCommPrefix)
}

static func serializeJsonAttatchments(message: String) throws -> String {
guard var invitation = try JSONSerialization.jsonObject(with: message.data(using: .utf8)!, options: []) as? [String: Any] else {
throw AriesFrameworkError.frameworkError("Invitation is not a valid json")
}
guard let type = invitation["@type"] as? String, type.starts(with: "https://didcomm.org/out-of-band/") else {
throw AriesFrameworkError.frameworkError("Invitation is not an out-of-band invitation. Type is \(invitation["@type"] ?? "nil")")
}

let attachments = invitation["requests~attach"] as? [[String: Any]] ?? []
var serializedRequests: [[String: Any]] = []
for attachment in attachments {
if let data = attachment["data"] as? [String: Any], let json = data["json"] as? [String: Any] {
var attachment = attachment
var data = data
let serialized = try JSONSerialization.data(withJSONObject: json, options: [])
data["json"] = String(data: serialized, encoding: .utf8)
attachment["data"] = data
serializedRequests.append(attachment)
} else {
serializedRequests.append(attachment)
}
}

invitation["requests~attach"] = serializedRequests
let serialized = try JSONSerialization.data(withJSONObject: invitation, options: [])
if let serializedMessage = String(data: serialized, encoding: .utf8) {
return serializedMessage
} else {
throw AriesFrameworkError.frameworkError("Failed to convert invitation message data to string.")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,11 @@ class OutOfBandInvitationTest: XCTestCase {
XCTAssertEqual(invitation.goalCode, "issue-vc")
XCTAssertEqual(invitation.requests?.count, 1)
}

func testJsonEmbeddingInvitation() throws {
let url = "http://127.0.0.1:8000?oob=eyJAdHlwZSI6ICJodHRwczovL2RpZGNvbW0ub3JnL291dC1vZi1iYW5kLzEuMC9pbnZpdGF0aW9uIiwgIkBpZCI6ICI2Y2E1ZDQ1NC1lNzdiLTQzMmItOThiOC01NDA4ZGFkZWJlMDIiLCAicmVxdWVzdHN-YXR0YWNoIjogW3siQGlkIjogInJlcXVlc3QtMCIsICJtaW1lLXR5cGUiOiAiYXBwbGljYXRpb24vanNvbiIsICJkYXRhIjogeyJqc29uIjogeyJAdHlwZSI6ICJodHRwczovL2RpZGNvbW0ub3JnL2lzc3VlLWNyZWRlbnRpYWwvMS4wL29mZmVyLWNyZWRlbnRpYWwiLCAiQGlkIjogImZiYzVhNjNlLTE2ODktNDYxNi05NGNmLThkZTE4ZmZkMjQ5NSIsICJ-dGhyZWFkIjogeyJwdGhpZCI6ICI2Y2E1ZDQ1NC1lNzdiLTQzMmItOThiOC01NDA4ZGFkZWJlMDIifSwgImNyZWRlbnRpYWxfcHJldmlldyI6IHsiQHR5cGUiOiAiaHR0cHM6Ly9kaWRjb21t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pNek9UVTNORE15TlRZeE1UUXdOelEzTURjeE9TSXNJQ0o0ZWw5allYQWlPaUFpTWpNM056azRNak0xT1RrM01UZ3lOVEU1TURFeU16STJNemcxTkRrek9EY3lOemd5Tmpjek5EWXlOall5TlRVMk1UY3hPVEV6TWpFd05qTXdPVFE0TnpFNU5UYzBOalV5TmpjeE5qVTRNREUwTlRNM09UY3hNams0TWprME9EVTBPRGN5TlRRNE5EazBNVFExTXpnd056WTNOakV5TmpNNU16YzNNalkzTnpZd01EVTVNamcwTURVMk1qWTVOVEk0TlRNeE9UVTROekkxTkRVME56a3lOall3TlRjMk9UazBPRGsyT1RRM01ERXhOakUwTVRjeE5qVXhOVEF3TVRrNU5qWXpPRFl4T1RReU1ESTFNamd5TVRVME1EQTRNamczT0RjNU9USXlNVFF4TXpjeU56YzVOekEyT1RnM09EQTVPRGd6T0RZek1EWXhPREk0TVRFd016WTFOREV4TURBNE5EVXdOalEwT0RBM05UYzFNamcyTlRrek1EQXpORE13TVRneE16Y3pNRFUxTURJNU1UTXhOVGMzT0RJME1URTVOREV6TVRrME9UUTJOell5TlRRM01qY3pOVEk0TlRjeU9UWXhOelV4TkRRME5UTTBPRGsyTlRnMU5ESXlNVE16TmpNME1URXpPRGt5TVRZM01qVTJOelk0TlRJMU1EQTVPVFExT0RFM09EQTBOall3TWpZeU1UQTVNalE0T0RJMU1qZzROemcwTkRRME1EZ3dOakk0TlRBNE1ERTBNamt5TnprM01qY3hNakV6TWpZNE9ETTBOekF4T1RrNU1qUTNNREEyTmpNeE5UZzJNakUyT1Rnd09URTBNekV5T0RrM05UY3pNRGd4TkRFME1qSTRNamM1TWpZNE5qQTBPVGs0T1RZd01qUTFPRGt3TURNek1UTTBOemd6TkRrNU9URXlOelV3TkRZeE5EVTBNREl5T1RNeE9ETTRORGcxTURJME5UVXlPRGN6TWpNNU5EWTROamc1TkRZME16QTJPVFUzT1RFNE16WTNPREV4TkRrd05qTXhPRE15TkRJM05ERTVNemcyTnpVek9ERXlNekkyTmpNNE5UVTRPRGd6TVRFeU9ERTVOamcyT1RrMk56WTRPVFl4TlRnek56Z3lOREUwTnpRMk1UY3hPVGswTXpJNU1UUTBOemd6TXpNeE5qTTBOVE00TURNM09ERTVOakV5TnpBMk5USTFPVEkwTlNJc0lDSjRjbDlqWVhBaU9pQmJXeUowYVcxbGMzUmhiWEFpTENBaU9UazRNamN6TkRRME5qTXpOakk1TmpnMU5UZzROamszT1RrME1UTXlOREl3TkRrNU9EQXdNRGd4TXpVeU9USTFOVGcyT0RVME5qY3hOalk0TnpVeU16STRNRFl3TmpVMk56RTNNVEV6TWpNd05EUXlNelV6TlRRNU16SXhNalkzTkRZNE1ETTJORGcxTXpNME5UVTVNamt6TVRrMU1UazNORGsyT1RJMU9ESTRPVE13TmpreE5UQTFOekl6TmpVNE1qWXlNekExTURneU9Ea3hNREl6TmpReE56YzNNakUyTVRFeU16RTROell5TkRrME9UUTRPVEkyTWpZeE5Ea3lORE14TVRjM05EQTFNemsyTXpNNU5ESXlPREl3TlRFMU16ZzROakF4TkRrNE5UUTVOelk0TWpRNE9EVTRNVEkxTmpZMk1EUTNOek14TnpFd05URTJPVFk1TURReE5ERTBNVGc0T1RZd05qWXdOVGs0TVRrMU1qY3lNakUwTXprNU56STRNVEEyT0RZM056Z3pNekV4TkRneU1qazNPRGcyTURrME56YzVOekkyTVRnM01UZ3dNems1TURrNE5EUTFNRE0zT0RreE1EQXhPVFV6TXpnME5UZ3hNemMyTnpBMU5qYzBNams0TkRreU1USTFNamd6TlRVME1UVTJOVFl3TmpNNE9UWTBOalUyT0RjME1UYzJNVEUzT1RrME9EQXdNemMxTURnMU5UQTJPVGswTkRZMk9ERTROalF4TkRNeE1UVTNORGt6T1RVeE5EZ3hOVFUyTlRFNU5qZzBNREU1T0RZNU1EWXdOelUyTWpNNU5qTTFNVEF4TURNek1qZ3dNekU0TkRRNE1URXlPREl3TVRrMU9EZzVOelk0TURVNU9UZzVORGcwTVRVM05EQTJPVFk0TkRFMU1ERTBOVE00TWpneU1URTFOVGd5TlRBeU9UVTFPRE16TXpjeE9USXhOemc0TkRFM09USTFNalV6T0RRME9EQXdNemM1TkRVME16YzBNak16TWprd016STBNRGd3T1RZME1qQTFNRGc0TlRVNE1UVTVOREEyTVRjeE9ERXhOVE0zTkRJME1qVTFOemcwTWprM09EYzNOVGMwTlRNeU9UTXpNakE0TnpZNU1UUTVNVFUwTURBd056TTNORE0xTmpZM01EY3dPVFV4TVRjek5UWTNOVGd3TWpZMk1qSTNPRFV6TmpZaVhTd2dXeUprWldkeVpXVWlMQ0FpTWpNM09UTTFNVFF3TWpZNE5UTTJNVFF3TmpRM01UYzROVFE1T0RVNU1qVTFORFF6TlRFd016azBPVEV3TWpBeU9UZzNNakl4TkRNM056a3lOakkxTVRrek9EazJORFF5TWpZNE9ERXpNek15TlRjeU16QTJOalF5TnpNNU56QTVOelV5TVRFeE56YzVOVEV3TXprMU5UYzBOVEE1TXpZMk5UVXdOVFkwTURRd01EazFNRFEyT0RRNU16QTFNVFEwTWpNek1qazBOemt5T1Rnd01EUXdPRGcwT0RNek5qRTRPVEV4TWpZME5EQTVNRFl4TXpBeU1qTXhNVE00TWpVd01UWTNOamsyT0RRM01EVXpOVEV6TURVM09URXhOamN6TURnNU16RXlNVFl4TkRRMk5ETTFNRGt5T1RVeE56STFPVGMxT1RrMU5ETXpOemcwTURZMU9EWXhOekl4TkRZM01USTNOVGcxTURFeU9UWXdOVFl3T1RNM01UQTRNak0wTVRBM016Z3pNVFUzTkRFNE5qRTJNRFV4TmprME1qazFNalV5TmpnNU1UVXhOalF4TlRVME5EUXhNREF4TkRNeE56RTJNVEF5TVRFeE9UazFNelUxTkRRM05EVXpOalF6TURBME9EWTJOVE16TVRVeE5USTNPVFEyTWpjMU5UZ3pNVGszTXprNE9EYzFNekl5T0RneE5EUXdOVFU1TWpneE9EY3pOakk1T0RVek1UYzNNek0yTVRneU1ERTVNRFEwTnpZNE5EWXlORGswT0RBMU16STBOell3TnpJek9UY3pOems0TXpReE1UTTFNamM0T0RnNE1UTTRNakE0TXpVd05qQXpNakEzTURFek1EVXhOemMwTmpneE9UZ3dNakUyTURVM056TTJNVFE0TWpRMk1USTROakU0TWpRMk16UXpOemMxTXpjeU1qTTVORGt4T0RnMU5qWTNOalF3T1RBMU1USTNOVFE0T1RVME5qZzBNalU1T1RrNU1UZ3dOVFEwT0RjNU9EWTRNVE0xTnpNd09EWTJNRFE1TURZMU5UQTRNek0yTlRJNU16YzJOVEEzTWpVME5ESTBOREEzTlRZME1qVXlOelV3TmpRNU9UVXhNRGcwTVRrMk1qQTFOVEUwTXpZME16VTJOVE16T1RNeE56azRNVE0wTmpjNE5ETTVOVE0zTkRZNE5EQXpOREUwT0RFMk5qUXpNamM1SWwwc0lGc2laR0YwWlNJc0lDSTROemM1TlRVNU1UUXlPRFV6T1RJNU5EZ3pOamd6TURZd056UTVNalUxTXprek16QXlNRGs0TWpFM01USXpNRFV4T1RjM01UUTFORE0wTURNME16RXpNVGt6TnpVek1ESTVPVFE0TVRJNU5qQTVPRFUwT1RNMU5UTXdOalV3T1Rnd016azFOREExT0RZNU9URTNORFUzT1RBeE16STBPVGczT0RrNU1UUXhOalV3TmpjeU5UWXhPRFl5TXpNeE16UTFNVEEwTVRJNU1qVTJNVEV6TlRjMk5UQTVNemN5T0RZMk5EUXlNemsyTURRNE9ETTNOVFkzTWpjMk16TXpNREUxTlRJMk5UUXdPVGt5TkRjNU16UXlNekEzTVRNek56VTNPRGczT1RNMk5UZzJPVEF5TlRRek1ESTJORGd6T0RRME5qQXlNVFl5TURVNU5UUTVNVEUwT1RRME9EQXhNell4TlRnME9ESXhORGd3TlRBek9EWTVOVGd3TnpBNU1UQTRNalkzTmpjMU1EVXdPRFUzTkRjM056Y3hOelkzT1RZeU5UTTVOalV6T0RFM05ERTRPRFExTVRRME16Y3pOVGcwTkRFNE56QXdNakF6TnpFM05EazFOamN4TlRVeE1USTFOVGc1T1RNd09USXdNemt6TmpNek9EazBOemd6TURjNU9E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XlPVGsxTWpReU5EQTBOVGMwTmpBNU16ZzRNekU0TURVNE56QTRNVEl5TmpBeE16WXpOekU1TlRjd056UTVNamswTkRNeE16RXlPREF5T1RjMU1UazBOVEV4TkRrd01qazFOalk1TnpJeE9EVTNNVGsxTXpJd05qRXdORFEzTlRRek5EQTNOVGN5TmpjM01ETXlOVFl5TWpJeU1UQTNOamN6TXpJMk5qVTJNREU1TWpNM05UQTBPVFE1TURZMk1UQXdNalk1TVRRek9USTBPVGd6TURNMU1ERTFOemMxTnpNNE9UWTNOelkyT0Rrd056QXdNVFEwTnpVek5UTXlORGcyTURNM056Z3pOekExT1RJME1ESXlNRFk1TlRJNE9UTTBOVEF4TnpVMk9Ea3hOamN5TXpNek56UXlNakEyTWpjME9ETTVOelU1TXpnMk16QXpNamcyTmprM01qVTVNVEl4TkRJNU5qazVNekE0TURjNU9EYzVPRFl4TmpFME16YzVOakkyTURFek16RTNORE0xTVRBd01EQTNORE16TlRBeE9EWXpOakUyTlRnM05qYzBNVE14TWpJMU16QTFNamN3TURVMU5UazFNamMyT0RreU1UWXpNemMzT0RZM09EazBNRFF5TURFM016QTVNRE14T1Rnd09EQTVNREl5T0RRek5EUTJPVGszTkRFeE16VXhORGcxTkRNeU16azBNVEEwTXpNNE1USXpNelUyT0RVNU16STBNakkwT1RZek1ESTFNemM0TlRRMU9ESXlPVGd3TURjeU5EWTFPRFUxT1Rjd09UYzVNVFkyT1Rnd01UWTVNalUyTkRFMU1UQTNNRFV6TXlKZExDQmJJbTFoYzNSbGNsOXpaV055WlhRaUxDQWlNVFU0TmprNU9UUXhNRE15T1RVek1UWTBPRGN3TnpjMk56WXdNVFl5TlRZeE9EVTVOemMwT1RNMk5USTVOVFl5TmpreE5qTXpORFUzTWpjNU5qTXhNak0xTkRBMk5qZzFPVFkxTkRJeE1ETTFOakUzTWpreU1qTXhOalExTkRVM05USXpNemcwTXpZNE1USXlPVFF5TURZeE9ESTFNVFl4TmpFMk9UVTROVEExTnpNNE1USTBPVGc0TlRFd09EQTJOemc0T0RRMk5UTXlNREF5TURJeE56STROREU1TXpJM09Ea3hOamcxTVRjeU1UazBPRFF6TlRRNE5ESXpOVE0xTWpZMk1EazNNRGN5TXpJNU56RXdOak01T1RFeU56QTBNalV6TmpBeU9EWXhNelkwTnpnd016WXpOVFEyTkRFeU1URXlPRGsyT1RneU1UZ3dORFl4TlRBd05UYzJPRFF3TWpNMk5qWTRORE14TWpZNE5qazNPRFUzT1RnNU1Ua3pOalExTXpZME1qZzVNekV6T1RBeU16RTVOVGs0TlRRNU1UUXhOREl3TkRNMk16TTFORFF4T0Rrd09EazNPRGM1TlRRek56UTNOek14TmpjNU16UTFOVFE1T1RBd05qZzNNakl6TmpjeE1EQXdNek14TnpZeE56QXdNamd6TURVNU1qUXpNVGczTXpVek1EVTVOalkzTmpZMk9EQXdOVE15TlRZNE5UUXlNVGcwTnpNM05UVTROalExTVRJNU56VTFPVGcxTlRnMU5EUTRNRE0zTkRNd05EYzBNamMxT0RneE1Ea3pNekkyTkRRek1EazJPRFkzT0RVeE56QXhPRFkwTlRnMU1UWTFNalU1T0RRME5qSXhNREV5TmpNeE16WTJOVE0zTXpVMk1URTFOemM0TWpBNU5qQTBORGswTnpZME9EQXlNakEzTVRnMk5UTTVORGM0TWpRNE9UazBOVEEwTWpFek1ERTJNalE0TWpRNU5qRXdNemcyTmpnMU1qUXlPREF4TmpVNE1USTNOamsyT1RJeE16STNNakU0TVRjek56QXpOemsxTkRNeE1URTFPVFEwT1RVeU5UY3pNRGt5TnpreU5ERTBOVGMwT1RBM056QTVNakl5TkRrMU1EZzBNVFF3TWpJNU56YzJNVEUwTnpJd05ERXdOall5TWpVME9ESTFOemszTnpZMU9ERTFOelU1TmpJNE5ERTVNeUpkWFgwc0lDSnViMjVqWlNJNklDSTNNRGs0T1RZME9EVXdPREUyTmpZeU16WXpNalkzTWpnaWZRPT0ifX1dLCAiY29tbWVudCI6ICJvb2IgaXNzdWFuY2UgdGVzdCJ9fX1dLCAiaGFuZHNoYWtlX3Byb3RvY29scyI6IFsiaHR0cHM6Ly9kaWRjb21tLm9yZy9jb25uZWN0aW9ucy8xLjAiXSwgImxhYmVsIjogIkFyaWVzIENsb3VkIEFnZW50IiwgInNlcnZpY2VzIjogW3siaWQiOiAiI2lubGluZSIsICJ0eXBlIjogImRpZC1jb21tdW5pY2F0aW9uIiwgInJlY2lwaWVudEtleXMiOiBbImRpZDprZXk6ejZNa2Z6aUFpWW9SWkUzV3d3TEI2aVBObVY0ZkhjNmJvUXJnc01ZVXFERGl6aGIzIl0sICJzZXJ2aWNlRW5kcG9pbnQiOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIn1dfQ=="
let invitation = try OutOfBandInvitation.fromUrl(url)

XCTAssertEqual(invitation.requests?.count, 1)
}
}

0 comments on commit 067e0ee

Please sign in to comment.