quorum-key-manager
quorum-key-manager copied to clipboard
Hard delete ethereum accounts not working
Describe the bug
We are testing QKM and we've found that the operation of hard delete (/destroy API endpoint) with Hashicorp Vault is not working, while other operations as list, creation and soft delete works properly.
Configuration
We are using last version of QKM: "consensys/quorum-key-manager:latest"
Steps to reproduce
- Run QKM properly connected to Hashicorp Vault
- Issue: `curl -X DELETE 'http://localhost:8080/stores/my-ethereum-store/ethereum/0x<EXISTING_ACCOUNT_TO_DELETE>/destroy'
Actual result
{"message":"ST100: failed to get deleted account","code":"ST100"}
Expected result
A message indicating that the account was deleted
Additional context
Logs
The QKM log shows the following:
key-manager_1 | 2022-08-30T12:13:36.806Z ERROR stores failed to get deleted account {"store_id": "my-ethereum-store", "address": "0x<EXISTING_ACCOUNT_TO_DELETE>", "error": "ST100: resource not found"}
Obviosly, the account does exist:
$ curl -X GET 'http://localhost:8080/stores/my-ethereum-store/ethereum/0x<EXISTING_ACCOUNT_TO_DELETE>'
# response
{"publicKey":"0x04f703a9fe6cba9e9f7bf639da7709179766948291a0630956a4521dde64e1642f7735db7b6d2eb090097528c56172fe4a835dc3e0778fd3ada99edb498cb8c454","compressedPublicKey":"0x02f703a9fe6cba9e9f7bf639da7709179766948291a0630956a4521dde64e1642f","createdAt":"2022-08-30T08:06:55.731586Z","updatedAt":"2022-08-30T08:06:55.731586Z","keyId":"my-eth-account","tags":{"property1":"string","property2":"string"},"address":"0x<EXISTING_ACCOUNT_TO_DELETE>","disabled":false}
You might find a successful response of destroy, once you operate soft deletion.
It seems that destroy does not do before soft deletion. https://github.com/ConsenSys/quorum-key-manager/blob/d509f52d9ab3d6476327415a6d276f4e570b50e2/src/stores/connectors/ethereum/destroy.go#L22