Skip to content

Commit

Permalink
Remove unused oob APIs, move code to libvcx_core (#1039)
Browse files Browse the repository at this point in the history
* Remove unused oob APIs, move code to `libvcx_core` (#1039)

Signed-off-by: Patrik Stas <[email protected]>
  • Loading branch information
Patrik-Stas authored Nov 7, 2023
1 parent c046838 commit 9bb6bf5
Show file tree
Hide file tree
Showing 27 changed files with 644 additions and 962 deletions.
7 changes: 3 additions & 4 deletions agents/node/vcxagent-core/src/services/service-out-of-band.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { OutOfBandSender, OutOfBandReceiver } = require('@hyperledger/node-vcx-wrapper')
const { OutOfBandSender, OutOfBandReceiver, Connection } = require('@hyperledger/node-vcx-wrapper')

module.exports.createServiceOutOfBand = function createServiceOutOfBand ({ logger, saveConnection, loadConnection }) {
function _createOobSender (message, label) {
Expand All @@ -21,9 +21,8 @@ module.exports.createServiceOutOfBand = function createServiceOutOfBand ({ logge
}

async function createConnectionFromOobMsg (connectionId, oobMsg) {
const oob = OutOfBandReceiver.createWithMessage(oobMsg)
const connection = await oob.buildConnection()
await connection.connect('{}')
const connection = await Connection.createWithInvite({ id: 'foo', invite: oobMsg })
await connection.connect()
await saveConnection(connectionId, connection)
}

Expand Down
7 changes: 0 additions & 7 deletions agents/node/vcxagent-core/test/out-of-band.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ describe('test out of band communication', () => {
expect(payloadAlice.content).toBe('Hello Alice')
})

it('Alice reuses a connection already established by Faber', async () => {
const { alice, faber } = await createPairedAliceAndFaberViaOobMsg()
const msg = await faber.createOobMessageWithDid()
const reused = await alice.createOrReuseConnectionUsingOobMsg(msg)
expect(reused).toBe(true)
})

it('Faber issues credential via OOB', async () => {
try {
const { alice, faber } = await createAliceAndFaber()
Expand Down
19 changes: 0 additions & 19 deletions agents/node/vcxagent-core/test/utils/alice.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,6 @@ module.exports.createAlice = async function createAlice (serviceEndpoint = 'http
await vcxAgent.agentShutdownVcx()
}

async function createOrReuseConnectionUsingOobMsg (oobMsg) {
logger.info('createOrReuseConnectionUsingOobMsg >> Alice going to create or reuse connection using oob message')
logger.debug(`createOrReuseConnectionUsingOobMsg >> oobMsg = ${oobMsg}`)
await vcxAgent.agentInitVcx()
let reused = false

if (await vcxAgent.serviceOutOfBand.connectionExists([connectionId], oobMsg)) {
await vcxAgent.serviceOutOfBand.reuseConnectionFromOobMsg(connectionId, oobMsg)
reused = true
} else {
await vcxAgent.serviceOutOfBand.createConnectionFromOobMsg(connectionId, oobMsg)
}

await vcxAgent.agentShutdownVcx()
return reused
}

async function updateConnection (expectedNextState) {
logger.info(`Alice is going to update connection, expecting new state of ${expectedNextState}`)
await vcxAgent.agentInitVcx()
Expand Down Expand Up @@ -263,8 +246,6 @@ module.exports.createAlice = async function createAlice (serviceEndpoint = 'http
createNonmediatedConnectionFromInvite,
nonmediatedConnectionProcessResponse,
createConnectionUsingOobMessage,
createNonmediatedConnectionUsingOobMessage,
createOrReuseConnectionUsingOobMsg,
acceptOobCredentialOffer,
updateConnection,
handleMessage,
Expand Down
69 changes: 0 additions & 69 deletions aries_vcx/src/handlers/issuance/mediated_holder.rs

This file was deleted.

110 changes: 0 additions & 110 deletions aries_vcx/src/handlers/issuance/mediated_issuer.rs

This file was deleted.

2 changes: 0 additions & 2 deletions aries_vcx/src/handlers/issuance/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
pub mod holder;
pub mod issuer;
pub mod mediated_holder;
pub mod mediated_issuer;
Loading

0 comments on commit 9bb6bf5

Please sign in to comment.