From cf1620a6383fdb87642cb3ce5f31526caf83bb7f Mon Sep 17 00:00:00 2001 From: ~midsum-salrux Date: Fri, 13 Oct 2023 10:44:54 -0400 Subject: [PATCH 1/2] Add sigpam for testing --- desk/app/genuine.hoon | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desk/app/genuine.hoon b/desk/app/genuine.hoon index bfe42936..26dbc1b2 100644 --- a/desk/app/genuine.hoon +++ b/desk/app/genuine.hoon @@ -42,6 +42,8 @@ =/ line i.t.site.full-line ?+ method.request (give-payload id not-found:gen:server) %'GET' + ~& ["from URL" line] + ~& ["from state" (scot %uw secret)] (give-payload id (json-response:gen:server b+=(line (scot %uw secret)))) == == From fe1d88b90b89f1fdca61dcb6635c704eb5b25ef1 Mon Sep 17 00:00:00 2001 From: ~midsum-salrux Date: Fri, 13 Oct 2023 11:12:46 -0400 Subject: [PATCH 2/2] New serialization scheme to avoid mismatches from URL --- desk/app/genuine.hoon | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/desk/app/genuine.hoon b/desk/app/genuine.hoon index 26dbc1b2..96711408 100644 --- a/desk/app/genuine.hoon +++ b/desk/app/genuine.hoon @@ -3,6 +3,14 @@ ++ give-payload |= [id=@ta =simple-payload:http] (give-simple-payload:app:server id simple-payload) +:: without removing the dots, there are intermittent mismatches when reading +:: the secret from the URL +++ serialize + |= eny=@uvJ + %- crip + %+ skip (trip (scot %uw eny)) + |= =cord + =(cord '.') +$ card card:agent:gall +$ versioned-state $% state-0 @@ -42,9 +50,7 @@ =/ line i.t.site.full-line ?+ method.request (give-payload id not-found:gen:server) %'GET' - ~& ["from URL" line] - ~& ["from state" (scot %uw secret)] - (give-payload id (json-response:gen:server b+=(line (scot %uw secret)))) + (give-payload id (json-response:gen:server b+=(line (serialize secret)))) == == :: @@ -84,6 +90,6 @@ |= =path ^- (unit (unit cage)) ?+ path [~ ~] - [%x %secret ~] ``json+!>([%s (scot %uw secret)]) + [%x %secret ~] ``json+!>([%s (serialize secret)]) == --