Skip to content

feat: accept agent_instance identities - #34

Merged
vitramir merged 2 commits into
mainfrom
feat/agent-instance-identity
Jul 31, 2026
Merged

feat: accept agent_instance identities#34
vitramir merged 2 commits into
mainfrom
feat/agent-instance-identity

Conversation

@vitramir

Copy link
Copy Markdown
Contributor

An agent workload authenticates as the instance it runs
(ziti-management#81,
gateway#197). Without the type
here, expose rejects the identity and the workload cannot manage its exposures.

  • agent_instance added to identitymeta and the server's identity type.
  • An isAgentWorkload() predicate replaces three separate
    != identityTypeAgent checks, so instances and pre-migration class
    identities are handled in one place.

Also: main's tests do not compile

Independent of this change, go test ./... fails on main. The mocks drifted
behind the generated clients:

  • mockZitiMgmt — missing CreateSandboxIdentity plus twelve tunnel, service
    and policy methods
  • mockRunners — missing the flavor, catalog and agent-instance lookups

Repaired here, since this branch cannot be verified otherwise.

This replaces a CI monkey-patch carried by agents-orchestrator#226
(patch-expose-agent-instances.js, 20 string anchors) that injected the same
behaviour by rewriting this repo's source during e2e. Deleted alongside this.

🤖 Generated with Claude Code

vitramir and others added 2 commits July 31, 2026 22:16
An agent workload authenticates as the instance it runs, not as the class.
Without the type, expose rejects the identity and the workload cannot
manage the exposures it owns.

Adds the type and an isAgentWorkload predicate covering both it and the
pre-migration class type, replacing three separate equality checks.

Also repairs the test mocks, which no longer compiled against the current
clients: mockZitiMgmt was missing CreateSandboxIdentity and twelve tunnel,
service and policy methods, and mockRunners was missing the flavor,
catalog and agent-instance lookups. That build failure is on main and is
independent of this change.

Co-Authored-By: Claude <noreply@anthropic.com>
The mocks hand-implemented every method of ZitiManagementServiceClient and
RunnersServiceClient. Bindings are generated from BSR on every CI run, so
adding an RPC to the API broke these repos without a commit touching them —
and silently: expose last ran CI on 4 June, and CreateSandboxIdentity, the
flavor RPCs and the agent-instance lookups all landed after, so main has
not compiled since and nothing reported it.

Embedding the interface makes the mock satisfy the contract by
construction. Calling a method a test did not override panics, which is
the right failure for a test, and new RPCs cannot break it. 29 and 32
methods drop to 4 and 2 — only what the tests actually stub.

Co-Authored-By: Claude <noreply@anthropic.com>
@vitramir
vitramir merged commit 21c067c into main Jul 31, 2026
1 check passed
@vitramir
vitramir deleted the feat/agent-instance-identity branch July 31, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant