zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

commit 618af4445850ec5f52576c91f79b7f293e906ca3
parent 51208680ec275eec8e0d98e6a4424a6991920cec
Author: srfsh <dev@srf.sh>
Date:   Tue, 19 Jul 2022 18:26:46 +0300

restroom: update verify_graphql to reflect recent changes

Diffstat:
Msrc/zenflows/restroom.ex | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/zenflows/restroom.ex b/src/zenflows/restroom.ex @@ -33,15 +33,15 @@ def byte_equal?(left, right) do end @doc """ -Given the GraphQL `body`, its `signature`, and the `pubkeys` -of the user who executes the query, verify that everything matches. +Given the GraphQL `body`, its `signature`, and `pubkey` of the user who +executes the query, verify that everything matches. """ -@spec verify_graphql?(binary(), String.t(), binary()) :: boolean() -def verify_graphql?(body, signature, pubkeys) do +@spec verify_graphql?(binary(), String.t(), String.t()) :: boolean() +def verify_graphql?(body, signature, pubkey) do data = %{ "graphql" => Base.encode64(body), - "eddsa signature" => signature, - "pubkeys" => Base.encode64(pubkeys), + "eddsa_signature" => signature, + "eddsa_public_key" => pubkey, } case exec("verify_graphql", data) do {:ok, %{"output" => ["VALID SIGNATURE"]}} -> true