Class: SessionManager
Defined in: src/tollgate/session/manager.ts:145 SessionManager handles creation, checking, and lifecycle of session grants. Thread-safe and designed for concurrent access from the proxy server.Constructors
Constructor
Parameters
store?
Session store backend (defaults to in-memory)autoPrune?
boolean = true
Whether to automatically prune expired grants (default: true)
pruneIntervalMs?
number = 60_000
How often to prune (default: 60 seconds)
Returns
SessionManager
Methods
checkGrant()
Parameters
context
The tool call to checkReturns
Check result with grant details if matchedExample
close()
Returns
void
createGrant()
Parameters
input
Grant creation parametersReturns
The created grantExample
formatGrant()
Parameters
grant
Returns
string
getActiveGrants()
Returns
SessionGrant[]
getStats()
Returns
pruneExpired()
Returns
number
Number of grants pruned
revokeAll()
Returns
void
revokeByServer()
Parameters
server
string
Server name
Returns
number
Number of grants revoked
revokeGrant()
Parameters
id
string
Grant ID to revoke
Returns
boolean
true if grant was found and revoked