feat(controlplane): print user/org ids and optionally mint an api key on bootstrap#2712
Merged
Conversation
… on bootstrap add user_id and organisation_id to the bootstrap output, and an opt-in --with-api-key flag (with --api-key-name and positive-only --api-key-expiration in days) that mints a personal api key so an instance can be seeded fully via cli and api with no login step. flag validation runs before any license check or record creation. the minted key is printed to stdout only, never logged. if key minting fails after the user and organisation are already created, the credentials are still emitted before returning a non-zero exit so the account is not stranded.
mekilis
added a commit
that referenced
this pull request
Jul 10, 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.
Summary
convoy bootstrapnow always printsuser_idandorganisation_idin bothjsonandhumanoutput.--with-api-keyflag that mints a personal API key for the bootstrapped user and prints it, so an instance can be seeded fully via the CLI and API with no login step and no dashboard.--api-key-name(defaultbootstrap-key) and--api-key-expiration(days) tune the key. An explicit expiration must be positive; unset (0) inherits the key service default (24h).Behavior and safety
--api-key-name/--api-key-expirationrequire--with-api-key.api_key_id.Sample
{ "email": "you@example.com", "password": "...", "user_id": "01J...", "organisation_id": "01J...", "api_key": "CO....", "api_key_id": "01J...", "api_key_expires_at": "2026-10-08T07:24:00Z" }Test plan
go test ./cmd/bootstrap/...(flag validation: bad format, missing email, key flags without--with-api-key, zero/negative explicit expiration)gofmt/go vet/golangci-lintclean oncmd/bootstrap/...api_keyto create a project with no loginNote
Medium Risk
Creates durable org-admin API keys and prints them to stdout during instance seeding; behavior is opt-in but touches credential issuance and bootstrap failure paths.
Overview
convoy bootstrapnow printsuser_idandorganisation_idin bothjsonandhumanoutput, and can optionally mint a personal API key so a fresh instance can be wired up via the API without logging in.Output is centralized in
printBootstrapOutput, which is the only path that writes secrets (password and API key) to stdout—not the logger. New flags:--with-api-key,--api-key-name(defaultbootstrap-key), and--api-key-expiration(days;0defers to the key service’s 24h default). API-key-related flags are validated before license checks or DB writes;--api-key-name/--api-key-expirationrequire--with-api-key, and an explicitly set expiration must be > 0.If key minting fails after the user and org already exist, the command still prints the user credentials, then exits non-zero so the admin password is not lost. Flag validation is covered by new tests in
bootstrap_test.go.Reviewed by Cursor Bugbot for commit 887d81d. Bugbot is set up for automated code reviews on this repo. Configure here.