http(s) remote signer returns the list of authorized keys when authentification is required

This commit is contained in:
Pierre Boutillier 2018-06-15 15:59:44 +02:00 committed by Benjamin Canou
parent 6b2d730a4e
commit fd2ac89cb4

View File

@ -22,10 +22,10 @@ let run (cctxt : #Client_context.wallet) ~hosts ?magic_bytes ~require_auth mode
let dir = let dir =
RPC_directory.register0 dir Signer_services.authorized_keys begin fun () () -> RPC_directory.register0 dir Signer_services.authorized_keys begin fun () () ->
if require_auth then if require_auth then
return None
else
Handler.Authorized_key.load cctxt >>=? fun keys -> Handler.Authorized_key.load cctxt >>=? fun keys ->
return (Some (keys |> List.split |> snd |> List.map Signature.Public_key.hash)) return (Some (keys |> List.split |> snd |> List.map Signature.Public_key.hash))
else
return None
end in end in
Lwt.catch Lwt.catch
(fun () -> (fun () ->