From 11f50453fc1ce934451ca83dc237997464684cab Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 9 Feb 2022 11:48:08 -0500 Subject: [PATCH] Keymanager api postman test collection (#10209) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * initial commit * adding keymanager api repo url * updated postman collection * removing unused folder * removing validator build * Update hack/keymanager-api/README.md Co-authored-by: Radosław Kapka * Update hack/keymanager-api/README.md Co-authored-by: Radosław Kapka * Update hack/keymanager-api/README.md Co-authored-by: Radosław Kapka Co-authored-by: Radosław Kapka --- hack/keymanager-api/README.md | 25 ++++ .../keymanager-api.postman_collection.json | 125 ++++++++++++++++++ 2 files changed, 150 insertions(+) create mode 100644 hack/keymanager-api/README.md create mode 100644 hack/keymanager-api/keymanager-api.postman_collection.json diff --git a/hack/keymanager-api/README.md b/hack/keymanager-api/README.md new file mode 100644 index 000000000..c871276a9 --- /dev/null +++ b/hack/keymanager-api/README.md @@ -0,0 +1,25 @@ +# Keymanager API + +https://github.com/ethereum/keymanager-APIs + +## Postman + +You can use Postman to test the API. https://www.postman.com/ + +### Postman collection + +In this package you will find the Postman collection for the keymanager API. +You can import this collection in your own Postman instance to test the API. + +#### Updating the collection + +The collection will need to be exported and overwritten to update the collection. A PR should be created once the file +is updated. + +#### Authentication + +Our keymanager API requires a valid bearer token to run the keymanager. +You can retrieve this bearer token from the URL displayed when running `validator --web` +i.e. `http://127.0.0.1:7500/initialize?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.BEuFWr-FpKIlJEIjgmujTQJlJF2aJRaUfFiuTBYVL3k` +The token can be copied and pasted into the authorization tab of each Postman request to authenticate. + diff --git a/hack/keymanager-api/keymanager-api.postman_collection.json b/hack/keymanager-api/keymanager-api.postman_collection.json new file mode 100644 index 000000000..8a9beaac7 --- /dev/null +++ b/hack/keymanager-api/keymanager-api.postman_collection.json @@ -0,0 +1,125 @@ +{ + "info": { + "_postman_id": "631cafa7-0561-47b5-9084-3d2adec3f2de", + "name": "keymanager-api", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "/eth/v1/keystores", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.PkLPEA0OSzhONboQXe6J1kiEUZ5t2JpwGjiNTklV9uk", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "url": { + "raw": "localhost:7500/eth/v1/keystores", + "host": [ + "localhost" + ], + "port": "7500", + "path": [ + "eth", + "v1", + "keystores" + ] + } + }, + "response": [] + }, + { + "name": "/eth/v1/keystores", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.PkLPEA0OSzhONboQXe6J1kiEUZ5t2JpwGjiNTklV9uk", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"keystores\":[\n \"543534534543543543534\"\n ],\n \"passwords\":[\n \"hrtyt564634534\"\n ],\n \"slashing_protection\":null\n}" + }, + "url": { + "raw": "localhost:7500/eth/v1/keystores", + "host": [ + "localhost" + ], + "port": "7500", + "path": [ + "eth", + "v1", + "keystores" + ] + } + }, + "response": [] + }, + { + "name": "/eth/v1/keystores", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.PkLPEA0OSzhONboQXe6J1kiEUZ5t2JpwGjiNTklV9uk", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"pubkeys\": [\n \"0x8d65ffe7b65ee8e7c3e14a474a360f16722920ef8c0ef1da6f942fd6ddc3628c1edda7f57cf28d7ddc7fc9cb9745df60\"\n ]\n}" + }, + "url": { + "raw": "localhost:7500/eth/v1/keystores", + "host": [ + "localhost" + ], + "port": "7500", + "path": [ + "eth", + "v1", + "keystores" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file