Skip to content

Daemon: refuse leased requests that name no session at request admission #4171

Open

Description

@thymikee

Follow-up from #3931 and #4159.

#4159 makes the CLI refuse every command on a leased remote connection unless it names a session (--session, AGENT_DEVICE_SESSION or config). The rule is enforced in the CLI, though. A review of #4159 found that direct daemon RPC callers are not covered: a request with no session becomes default, then <tenant>:default (packages/daemon/src/server/http/http-rpc-methods.ts:48, packages/daemon/src/sessions/request-admission.ts:48). Against an isolated real daemon, an unnamed authenticated agent_device.lease.allocate allocated a proxy lease, and unnamed leased commands reached normal dispatch.

Required behavior

  • Daemon request admission records whether the caller supplied a session before it defaults one.
  • A request that would allocate, use or release a lease from a lease provider, with no caller-supplied session, is refused with the same typed reason (REMOTE_SESSION_REQUIRED) before allocation or dispatch.
  • Requests with no lease provider are unchanged.
  • Tests run against a real daemon: an unnamed lease.allocate is refused, an unnamed leased command is refused, and named requests are unaffected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions