Merged
Conversation
Add enrollment token-based gateway registration. The CLI can now enroll and start a gateway in a single command using a one-time enrollment token, without requiring a pre-configured machine identity. - Add enroll.go with token persistence (access token, domain) - Add CallEnrollGateway API + EnrollGatewayRequest/Response types - gateway start --enroll-method=static enrolls and starts in one step - gateway install supports enrollment token flow for systemd - Stored token path loads domain from config - Explicit --token/--auth-method overrides stored token - Add omitempty to optional fields in register/enroll request types
- gateway start and systemd install accept name as positional arg - --name flag kept as deprecated alias for backwards compatibility - Name is required for both enrollment and identity flows - Priority: positional arg > --name flag > env var
bernie-g
commented
Apr 14, 2026
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe2bc6292e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Store the enrollment token in gateway.conf after successful enrollment. On subsequent runs with the same token, skip enrollment and start the gateway directly using the stored access token. This lets users re-run the same command (e.g., up-arrow) without hitting "token already used" or "token expired" errors.
Config files are now stored at ~/.infisical/gateways/<name>.conf (or /etc/infisical/gateways/<name>.conf for root). This allows multiple gateways to run on the same machine without conflicting. All load/save functions now take a gateway name parameter.
Contributor
Author
|
@claude review this |
Contributor
Author
|
@claude stop |
…teway Enrollment-flow gateways now use POST /api/v3/gateways/connect for cert refresh instead of POST /api/v2/gateways. Identity-based gateways continue using V2. Added UseV3Connect flag to GatewayConfig.
…n CallConnectGateway
sheensantoscapadngan
approved these changes
Apr 16, 2026
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.
Description 📣
CLI support for enrollment token-based gateway registration. Gateways can now enroll and start in a single command using a one-time token from the UI, without requiring a machine identity.
gateway start --enroll-method=static --token=<token>enrolls and starts in one stepgateway start my-gateway --token=<token>--nameflag kept as deprecated alias for backwards compatibilitygateway.confgateway systemd installsupports enrollment token flow--token/--auth-methodflags override stored tokenType ✨
Tests 🛠️