-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
step should skip some checks when manipulating the ca.json #722
Comments
If we skip the validation of the Config, this will work. diff --git a/command/ca/provisioner/provisioner.go b/command/ca/provisioner/provisioner.go
index b910fd7..dd9333e 100644
--- a/command/ca/provisioner/provisioner.go
+++ b/command/ca/provisioner/provisioner.go
@@ -122,6 +122,7 @@ func newCRUDClient(cliCtx *cli.Context, cfgFile string) (crudClient, error) {
return cautils.NewAdminClient(cliCtx)
}
ui.Println()
+ cfg.SkipValidation = true
return newCaConfigClient(context.Background(), cfg, cfgFile)
default:
return nil, errs.FileError(err, cfgFile) @dopey, do you think this will cause any harm? |
At the same time if we disable the validation enabling vaultcas is not required (#724) |
I assume |
@hslatman The code validates the config when you create the In Working directly on the config, has another minor "issue", once we render it to a file, the order of your ca.json might change, and things like you might have configured manually, e.g. old configurations ( SkipValidation would not solve that issue, but it won't try to ensure the certificates, keys, templates, RA configuration, ... are all ok, when they might not exist. Imagine for example that your ca.json is in your vcs, but you don't have the keys there. |
@maraino where is the validation actually run? Like, where will that attribute be consumed? We're already skipping initialization. I don't see any harm in skipping validation, since we're validating the provisioners using the provisioner collection API. I just don't see where it's applied. |
@dopey authority's func New(cfg *config.Config, opts ...Option) (*Authority, error) {
err := cfg.Validate()
if err != nil {
return nil, err
}
|
@maraino any reason not to use an options func like |
To do that, we will need to change how the |
Description
When
step
manipulates the ca.json to add a new provisioner, for example, while runningThe cli will try to validate the full ca.json, including unrelated things like the SSH templates. This might cause errors when
step
uses a different context than the one we want to manipulate.See smallstep/certificates#963 (comment) for more information.
The text was updated successfully, but these errors were encountered: