Read user certificates only from the session of the active profile's owner

This commit is contained in:
Viktor Liu
2026-10-02 12:32:27 +02:00
parent e0b6a38aa2
commit a91fe94ada
10 changed files with 196 additions and 40 deletions
+9
View File
@@ -76,6 +76,8 @@ type ConnectClient struct {
// netMgr gates every reconnection loop on OS-reported network
// availability and sweeps connections on network change.
netMgr *netevents.Manager
profileOwner string
}
// ConnectClientOption configures optional ConnectClient behavior.
@@ -86,6 +88,12 @@ func WithNetEvents(events *netevents.Manager) ConnectClientOption {
return func(c *ConnectClient) { c.netMgr = events }
}
// WithProfileOwner names the OS account the active profile belongs to, whose own
// certificate store answers user certificate posture checks.
func WithProfileOwner(username string) ConnectClientOption {
return func(c *ConnectClient) { c.profileOwner = username }
}
func NewConnectClient(
ctx context.Context,
config *profilemanager.Config,
@@ -417,6 +425,7 @@ func (c *ConnectClient) run(mobileDependency MobileDependency, runningChan chan
return wrapErr(err)
}
engineConfig.TempDir = mobileDependency.TempDir
engineConfig.CertStore.ProfileOwner = c.profileOwner
// Leave StateDir empty when there is no state path so a disk-backed
// syncstore falls back to os.TempDir() instead of filepath.Dir("") == ".".
if path != "" {