summaryrefslogtreecommitdiff
path: root/src/vyconfd.ml
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2025-04-16 14:51:36 -0500
committerJohn Estabrook <jestabro@vyos.io>2025-05-12 11:26:41 -0500
commitc6a09cc9fce42323d86d2f4e161a894cdc970a24 (patch)
tree0d82f98183bbf16d6a4a6d5c5c4d32c29eb3f24f /src/vyconfd.ml
parentc508c8c66c76488337745cf151d9570c42e38a3b (diff)
downloadvyconf-c6a09cc9fce42323d86d2f4e161a894cdc970a24.tar.gz
vyconf-c6a09cc9fce42323d86d2f4e161a894cdc970a24.zip
T7363: track process id in session data
In practice, this may be passed in the request as the ppid, as needed for CLI applications to coordinate with the ambient config session. For other uses, the client pid will suffice.
Diffstat (limited to 'src/vyconfd.ml')
-rw-r--r--src/vyconfd.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vyconfd.ml b/src/vyconfd.ml
index 9eaee6b..b0b4e52 100644
--- a/src/vyconfd.ml
+++ b/src/vyconfd.ml
@@ -51,8 +51,9 @@ let make_session_token () =
let setup_session world req =
let token = make_session_token () in
let user = "unknown user" in
+ let pid = req.client_pid in
let client_app = Option.value req.client_application ~default:"unknown client" in
- let () = Hashtbl.add sessions token (Session.make world client_app user) in
+ let () = Hashtbl.add sessions token (Session.make world client_app user pid) in
{response_tmpl with output=(Some token)}
let find_session token = Hashtbl.find sessions token