The remote Keymanager API was not using the URLs indicated in the spec
This commit is contained in:
parent
3ffab01b07
commit
4c01b77773
|
@ -188,7 +188,7 @@ proc installKeymanagerHandlers*(router: var RestRouter, node: BeaconNode) =
|
||||||
return RestApiResponse.jsonResponsePlain(response)
|
return RestApiResponse.jsonResponsePlain(response)
|
||||||
|
|
||||||
# https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/ListRemoteKeys
|
# 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)
|
let authStatus = checkAuthorization(request, node)
|
||||||
if authStatus.isErr():
|
if authStatus.isErr():
|
||||||
return RestApiResponse.jsonError(Http401, InvalidAuthorization,
|
return RestApiResponse.jsonError(Http401, InvalidAuthorization,
|
||||||
|
@ -197,7 +197,7 @@ proc installKeymanagerHandlers*(router: var RestRouter, node: BeaconNode) =
|
||||||
return RestApiResponse.jsonResponsePlain(response)
|
return RestApiResponse.jsonResponsePlain(response)
|
||||||
|
|
||||||
# https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/ImportRemoteKeys
|
# 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:
|
contentBody: Option[ContentBody]) -> RestApiResponse:
|
||||||
let authStatus = checkAuthorization(request, node)
|
let authStatus = checkAuthorization(request, node)
|
||||||
if authStatus.isErr():
|
if authStatus.isErr():
|
||||||
|
@ -239,7 +239,7 @@ proc installKeymanagerHandlers*(router: var RestRouter, node: BeaconNode) =
|
||||||
return RestApiResponse.jsonResponsePlain(response)
|
return RestApiResponse.jsonResponsePlain(response)
|
||||||
|
|
||||||
# https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/DeleteRemoteKeys
|
# 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:
|
contentBody: Option[ContentBody]) -> RestApiResponse:
|
||||||
let authStatus = checkAuthorization(request, node)
|
let authStatus = checkAuthorization(request, node)
|
||||||
if authStatus.isErr():
|
if authStatus.isErr():
|
||||||
|
@ -294,15 +294,15 @@ proc installKeymanagerHandlers*(router: var RestRouter, node: BeaconNode) =
|
||||||
|
|
||||||
router.redirect(
|
router.redirect(
|
||||||
MethodGet,
|
MethodGet,
|
||||||
"/eth/v1/remotekey",
|
"/eth/v1/remotekeys",
|
||||||
"/api/eth/v1/remotekey")
|
"/api/eth/v1/remotekeys")
|
||||||
|
|
||||||
router.redirect(
|
router.redirect(
|
||||||
MethodPost,
|
MethodPost,
|
||||||
"/eth/v1/remotekey",
|
"/eth/v1/remotekeys",
|
||||||
"/api/eth/v1/remotekey")
|
"/api/eth/v1/remotekeys")
|
||||||
|
|
||||||
router.redirect(
|
router.redirect(
|
||||||
MethodDelete,
|
MethodDelete,
|
||||||
"/eth/v1/remotekey",
|
"/eth/v1/remotekeys",
|
||||||
"/api/eth/v1/remotekey")
|
"/api/eth/v1/remotekeys")
|
||||||
|
|
|
@ -54,18 +54,18 @@ proc listKeys*(client: RestClientRef,
|
||||||
raiseUnknownStatusError(resp)
|
raiseUnknownStatusError(resp)
|
||||||
|
|
||||||
proc listRemoteKeysPlain*(): RestPlainResponse {.
|
proc listRemoteKeysPlain*(): RestPlainResponse {.
|
||||||
rest, endpoint: "/eth/v1/remotekey",
|
rest, endpoint: "/eth/v1/remotekeys",
|
||||||
meth: MethodGet.}
|
meth: MethodGet.}
|
||||||
## https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/ListRemoteKeys
|
## https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/ListRemoteKeys
|
||||||
|
|
||||||
proc importRemoteKeysPlain*(body: ImportRemoteKeystoresBody
|
proc importRemoteKeysPlain*(body: ImportRemoteKeystoresBody
|
||||||
): RestPlainResponse {.
|
): RestPlainResponse {.
|
||||||
rest, endpoint: "/eth/v1/remotekey",
|
rest, endpoint: "/eth/v1/remotekeys",
|
||||||
meth: MethodPost.}
|
meth: MethodPost.}
|
||||||
## https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/ImportRemoteKeys
|
## https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/ImportRemoteKeys
|
||||||
|
|
||||||
proc deleteRemoteKeysPlain*(body: DeleteKeystoresBody): RestPlainResponse {.
|
proc deleteRemoteKeysPlain*(body: DeleteKeystoresBody): RestPlainResponse {.
|
||||||
rest, endpoint: "/eth/v1/remotekey",
|
rest, endpoint: "/eth/v1/remotekeys",
|
||||||
meth: MethodDelete.}
|
meth: MethodDelete.}
|
||||||
## https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/DeleteRemoteKeys
|
## https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/DeleteRemoteKeys
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue