feat(ua): let external agents register and issue their node key - #517
Merged
Conversation
Adds POST to /v1/ua/agents/ so an external agent can register itself (uuid/node/capabilities), and a new issue_key action, gated by its own agent.ua.issue_key permission, that returns the node's encryption key - generating one only the first time, so agents sharing a node uuid get the same key. Bootstrap's own key-delivery path is untouched.
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Contributor
Author
|
Should be merged after exordos/gcl_sdk#182 |
It reimplemented the same racy get-or-create pattern already fixed on NodeEncryptionKey.get_or_create() (two agents on one node racing to issue_key would have the loser crash on the unique node uuid instead of getting the winner's key). Delegate to it instead of duplicating.
Node.insert() unconditionally created a NodeEncryptionKey for its uuid, so registering a compute Node for a machine that was already a local hypervisor's node (which provisions its own key the same way) crashed on the unique node uuid. Route through get_or_create like MachinePool already does.
VasilyStepanov
marked this pull request as ready for review
July 22, 2026 17:58
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Move agent.ua.create/issue_key out of a DB migration and into core.yaml.j2's $core.iam.permissions, matching how other elements (e.g. exordos_world) already declare permissions in their own manifests, and per review feedback on PR #517 that permission data is moving away from migrations. Permission/Role/PermissionBinding already support this via TargetResourceMixin.
VasilyStepanov
marked this pull request as draft
July 23, 2026 12:11
VasilyStepanov
marked this pull request as ready for review
July 23, 2026 13:24
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
akremenetsky
approved these changes
Jul 23, 2026
phantomii
approved these changes
Jul 23, 2026
Picks up NodeEncryptionKey.get_or_create() (gcl_sdk PR #182), now released.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
only if none exists yet — so several agents registered on the same node all get back the same key, and the operation is race-safe if two of them ask at once.
and both provision a key for the same uuid; previously the second registration would crash on the unique constraint.
Covered by new functional tests (registration, key issuance, key sharing across agents on one node, permission enforcement) and unit tests.