The remote Keymanager API was not using the URLs indicated in the spec

This commit is contained in:
Zahary Karadjov 2022-03-02 17:43:52 +02:00
parent 3ffab01b07
commit 4c01b77773
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
2 changed files with 12 additions and 12 deletions

View File

@ -188,7 +188,7 @@ proc installKeymanagerHandlers*(router: var RestRouter, node: BeaconNode) =
return RestApiResponse.jsonResponsePlain(response)
# https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/ListRemoteKeys
router.api(MethodGet, "/api/eth/v1/remotekey") do () -> RestApiResponse:
router.api(MethodGet, "/api/eth/v1/remotekeys") do () -> RestApiResponse:
let authStatus = checkAuthorization(request, node)
if authStatus.isErr():
return RestApiResponse.jsonError(Http401, InvalidAuthorization,
@ -197,7 +197,7 @@ proc installKeymanagerHandlers*(router: var RestRouter, node: BeaconNode) =
return RestApiResponse.jsonResponsePlain(response)
# https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/ImportRemoteKeys
router.api(MethodPost, "/api/eth/v1/remotekey") do (
router.api(MethodPost, "/api/eth/v1/remotekeys") do (
contentBody: Option[ContentBody]) -> RestApiResponse:
let authStatus = checkAuthorization(request, node)
if authStatus.isErr():
@ -239,7 +239,7 @@ proc installKeymanagerHandlers*(router: var RestRouter, node: BeaconNode) =
return RestApiResponse.jsonResponsePlain(response)
# https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/DeleteRemoteKeys
router.api(MethodDelete, "/api/eth/v1/remotekey") do (
router.api(MethodDelete, "/api/eth/v1/remotekeys") do (
contentBody: Option[ContentBody]) -> RestApiResponse:
let authStatus = checkAuthorization(request, node)
if authStatus.isErr():
@ -294,15 +294,15 @@ proc installKeymanagerHandlers*(router: var RestRouter, node: BeaconNode) =
router.redirect(
MethodGet,
"/eth/v1/remotekey",
"/api/eth/v1/remotekey")
"/eth/v1/remotekeys",
"/api/eth/v1/remotekeys")
router.redirect(
MethodPost,
"/eth/v1/remotekey",
"/api/eth/v1/remotekey")
"/eth/v1/remotekeys",
"/api/eth/v1/remotekeys")
router.redirect(
MethodDelete,
"/eth/v1/remotekey",
"/api/eth/v1/remotekey")
"/eth/v1/remotekeys",
"/api/eth/v1/remotekeys")

View File

@ -54,18 +54,18 @@ proc listKeys*(client: RestClientRef,
raiseUnknownStatusError(resp)
proc listRemoteKeysPlain*(): RestPlainResponse {.
rest, endpoint: "/eth/v1/remotekey",
rest, endpoint: "/eth/v1/remotekeys",
meth: MethodGet.}
## https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/ListRemoteKeys
proc importRemoteKeysPlain*(body: ImportRemoteKeystoresBody
): RestPlainResponse {.
rest, endpoint: "/eth/v1/remotekey",
rest, endpoint: "/eth/v1/remotekeys",
meth: MethodPost.}
## https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/ImportRemoteKeys
proc deleteRemoteKeysPlain*(body: DeleteKeystoresBody): RestPlainResponse {.
rest, endpoint: "/eth/v1/remotekey",
rest, endpoint: "/eth/v1/remotekeys",
meth: MethodDelete.}
## https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/DeleteRemoteKeys