Skip to content

Commit

Permalink
Delete OOB utility function
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas ONeil <lucasoneil@gmail.com>
  • Loading branch information
loneil committed Mar 5, 2024
1 parent 89b30e1 commit a327e04
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions load-agent/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,15 @@ const pingMediator = async (agent) => {
}
}

let deleteOobRecordById = async (agent, id) => {
try {
const resp = await agent.oob.deleteById(id);

} catch (error) {
process.stderr.write('ERROR'+ '\n' + error + '\n')
}
};

let receiveInvitation = async (agent, invitationUrl) => {
// wait for the connection
let timeout = config.verified_timeout_seconds * 1000
Expand Down Expand Up @@ -510,6 +519,12 @@ rl.on('line', async (line) => {
process.stdout.write(
JSON.stringify({ error: 0, result: 'Ping Mediator' }) + '\n'
)
} else if (command['cmd'] == 'deleteOobRecordById') {
await deleteOobRecordById(agent, command['id'])

process.stdout.write(
JSON.stringify({ error: 0, result: 'Delete OOB Record' }) + '\n'
)
} else if (command['cmd'] == 'receiveInvitation') {
let connection = await receiveInvitation(agent, command['invitationUrl'])

Expand Down
8 changes: 8 additions & 0 deletions load-agent/locustClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,14 @@ def issuer_getinvite(self):
def issuer_getliveness(self):
return self.issuer.is_up()

@stopwatch
def delete_oob(self, id):
self.run_command({"cmd": "deleteOobRecordById", "id": id})

line = self.readjsonline()

return ""

@stopwatch
def accept_invite(self, invite):
try:
Expand Down

0 comments on commit a327e04

Please sign in to comment.