Skip to content
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

Improve config validation #47

Open
itsdalmo opened this issue Aug 12, 2020 · 0 comments
Open

Improve config validation #47

itsdalmo opened this issue Aug 12, 2020 · 0 comments

Comments

@itsdalmo
Copy link
Contributor

itsdalmo commented Aug 12, 2020

We should consider moving sidecred.Config to a subpackage so we can import concrete types from the provides/stores and do additional validation. This is so we can catch configuration errors before deploying the config. We should also add a validate subcommand to the CLI for this purpose.

The following interfaces should cover what we need inside sidecred.Process:

type Config interface {
  Validate() error
  Requests() []Request
}

type Request interface {
  Store()       *StoreConfig
  Credentials() []*CredentialRequest
}
itsdalmo added a commit that referenced this issue Jul 1, 2021
This is a prerequisite for adding provider config validation since we can't have circular imports.
itsdalmo added a commit that referenced this issue Jul 2, 2021
* Move Config to separate package (part of #47)

This is a prerequisite for adding provider config validation since we can't have circular imports.

* Add validation for provider configs

* Add subcommand for validating sidecred configs

This commit introduces subcommands for our binaries, run and validate. The run command is set as the default and will be executed if no subcommand is specified.

The default command is there to avoid a breaking change, but should probably be removed in the future.

* Remove unused namespace flags/params from binaries

* Use kingpin.Fatal to exit on error in validate command

* Use logger to exit on error in run command

* Fix version in error messages when parsing config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant