Why
KeyMethodAuthorization::authorize rebuilds a fresh runtime Allowlist from
the recipient's compiled method profile on every successful login.
PR #617 removes the earlier recipients × methods amplification during policy
compilation, but this separate, pre-existing path remains:
- a caller obtains an
AuthorityServer::guard terminal;
- the terminal is reusable rather than single-use;
- each successful login walks the full method profile and allocates another
HashSet<(u64, u16)>; and
- sessions can be retained, so memory grows with
logins × methods.
The authenticated-VAT serving path already bounds concurrent sessions with a
ConnectionBudget and makes each per-connection terminal single-use. The
generic AuthorityServer::guard path has neither bound.
This is a guest-to-host availability risk for large profiles. It is not caused
by #617 and should not expand that PR.
Proposed fix
Let the membrane Allowlist consume or reference the already-compiled shared
method set rather than rebuilding an equivalent set for every login.
One candidate is an Allowlist::from_shared(Rc<HashSet<MethodKey>>) constructor
whose Policy::check performs membership against MethodKey. Preserve
Policy::allowlist_keys behavior so membrane collapse remains correct.
Treat terminal reuse and connection/session budgeting as a related defense in
depth question, not as a substitute for removing the per-login deep copy.
Acceptance criteria
Relevant code
crates/authority/src/issuer.rs: KeyMethodAuthorization::authorize
crates/authority/src/issuer.rs: AuthorityServer::guard
crates/membrane/src/lib.rs: Allowlist
crates/rpc/src/vat_listener.rs: authenticated-VAT single-use terminal and
connection-budget handling
Why
KeyMethodAuthorization::authorizerebuilds a fresh runtimeAllowlistfromthe recipient's compiled method profile on every successful login.
PR #617 removes the earlier
recipients × methodsamplification during policycompilation, but this separate, pre-existing path remains:
AuthorityServer::guardterminal;HashSet<(u64, u16)>; andlogins × methods.The authenticated-VAT serving path already bounds concurrent sessions with a
ConnectionBudgetand makes each per-connection terminal single-use. Thegeneric
AuthorityServer::guardpath has neither bound.This is a guest-to-host availability risk for large profiles. It is not caused
by #617 and should not expand that PR.
Proposed fix
Let the membrane
Allowlistconsume or reference the already-compiled sharedmethod set rather than rebuilding an equivalent set for every login.
One candidate is an
Allowlist::from_shared(Rc<HashSet<MethodKey>>)constructorwhose
Policy::checkperforms membership againstMethodKey. PreservePolicy::allowlist_keysbehavior so membrane collapse remains correct.Treat terminal reuse and connection/session budgeting as a related defense in
depth question, not as a substitute for removing the per-login deep copy.
Acceptance criteria
method profile.
set while retaining independent session/capability lifecycle.
Policy::checkandPolicy::allowlist_keyspreserve existing allowlistsemantics and membrane-collapse behavior.
session for that recipient.
method allocation is shared rather than rebuilt.
tests pass.
Relevant code
crates/authority/src/issuer.rs:KeyMethodAuthorization::authorizecrates/authority/src/issuer.rs:AuthorityServer::guardcrates/membrane/src/lib.rs:Allowlistcrates/rpc/src/vat_listener.rs: authenticated-VAT single-use terminal andconnection-budget handling