[works] cleanups, wfc service architecture

- now using zj as a dep instead of just having it locally
- put WFC into its own service tree

  this surgery is not complete, but it has been started and the repo is
  currently not in a botched state

- deleted orphan "wsp" (web socket process) module
This commit is contained in:
Peter Harpending
2025-12-17 16:39:00 -08:00
parent 57e7254f8d
commit 8d5320e4e5
8 changed files with 47 additions and 820 deletions
+2 -10
View File
@@ -348,7 +348,7 @@ wfcin(Sock, #request{enctype = json,
{fd_httpd_utils:jsbad(ErrorMessage), Ctx0}
end,
% update cache with new context
ok = fd_cache:set(Cookie, NewCtx),
ok = fd_wfcd_cache:set(Cookie, NewCtx),
Body = zj:encode(RespObj),
Response = #response{headers = [{"content-type", "application/json"},
{"set-cookie", ["wfc=", Cookie]}],
@@ -366,17 +366,9 @@ wfcin(Sock, Request) ->
Context :: wfc_eval_context:context().
ctx(#{<<"wfc">> := Cookie}) ->
case fd_cache:query(Cookie) of
case fd_wfcd_cache:query(Cookie) of
{ok, Context} -> {Cookie, Context};
error -> {Cookie, wfc_eval_context:default()}
end;
ctx(_) ->
{fd_httpd_utils:new_cookie(), wfc_eval_context:default()}.