From 3fd9149ca3f94b5041f800976fc17164c50ffe81 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 1 Jul 2019 00:03:31 +0200 Subject: document the manager a bit more --- p11p-daemon/src/p11p_remote_manager.erl | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/p11p-daemon/src/p11p_remote_manager.erl b/p11p-daemon/src/p11p_remote_manager.erl index b9b15b2..be921ee 100644 --- a/p11p-daemon/src/p11p_remote_manager.erl +++ b/p11p-daemon/src/p11p_remote_manager.erl @@ -1,10 +1,22 @@ -%% A remote manager is a gen_server for coordination of remotes for -%% all tokens. - -%% Spawn one remote per configured p11p module per configured virtual -%% token. Provide a lookup service for servers that need a remote to -%% send a request to, by keeping track of which module is current for -%% a given vtoken. +%% A remote manager is a genserver for coordination of remotes for all +%% tokens. + +%% Provide a lookup service for servers in need of a remote to send +%% requests to, by keeping track of which module is current for a +%% given vtoken and spawn a p11p_remote genserver "on demand". +%% +%% Provide a client event and a server event API for servers and +%% remotes, respectively, where events like "remote timing out" and +%% "p11 client hung up" can be reported. +%% + +%% Keep track of (successful) p11 requests which might cause state +%% changes in the token, like "logins". When switching token under the +%% feet of the p11 client, replay whatever is needed to the new +%% token. This goes for the p11-kit RPC protocol version octet too. +%% Certain state changing p11 requests cannot be replayed, like +%% "generate new key". Any such (successful) request invalidates all +%% other remotes for the given token. -module(p11p_remote_manager). -- cgit v1.1