Fall back to local ca.json edit when --ca-url is unset - #1706
Open
vulragrag-star wants to merge 1 commit into
Open
vulragrag-star wants to merge 1 commit into
vulragrag-star wants to merge 1 commit into
Conversation
When `step ca provisioner add|update|remove` is given an existing `--ca-config` file but no `--ca-url`, edit the config locally instead of failing with a required `--ca-url`/`--root` error. Restores the documented offline bootstrap workflow broken since v0.23.1. Fixes smallstep#1705
Author
|
I have read the Contributor License Agreement (CLA) and hereby sign the CLA. |
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.
Name of feature:
Pain or issue this feature alleviates:
step ca provisioner add|update|remove --ca-config ca.json(no--ca-url) fails with a required--ca-url/--rooterror even when the config file exists. That breaks the documented offline / bootstrap workflow (see EXAMPLES inadd.goand the public docs).Why is this important to the project (if not answered above):
Restores pre-v0.23.1 behavior for local
ca.jsonedits when no CA URL is supplied, while keeping the existing remote admin-API probe when--ca-urlis set.Is there documentation on how to use this feature? If so, where?
Existing docs/examples already show
--ca-configwithout--ca-url; this makes the CLI match them again.In what environments or workflows is this feature supported?
Local offline edits of an existing
ca.jsonvia--ca-configwithout a reachable CA.In what environments or workflows is this feature explicitly NOT supported (if any)?
When
--ca-urlis set, behavior is unchanged (remote probe first, then local fallback on network / not-implemented errors).Supporting links/other PRs/issues:
Fixes #1705
Summary
When
NewUnauthenticatedAdminClientfails because--ca-url/--rootare missing, and--ca-configpoints at an existing file, fall back to the localcaConfigClientpath instead of returning the required-flag error.Test plan
go test ./command/ca/provisioner/ -run 'TestNewCRUDClient_|TestReadNebulaRoots'step ca provisioner add … --ca-config /path/to/ca.jsonwithout--ca-urlsucceeds on a local config (as in [Bug]:step ca provisioner add --ca-configrequires--ca-url/--rooteven for purely local/offline edits #1705)