bcgov/gwa-cli

Add config validation subcommand

Offen

#98 geöffnet am 15.12.2023

 (0 Kommentare) (0 Reaktionen) (1 zugewiesene Person)Go (1 Fork)auto 404
enhancementgood first issue

Repository-Metriken

Stars
 (7 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

As a user I want to ensure my config is setup correctly. As an APS team dev I want to ensure my user's config set up correctly during troubleshooting or bug reports.

Acceptance Criteria

Add a gwa config validate subcommand. This command will exit the program and print nothing if the application doesn't find any issues or potential warnings. An example output could be:

gwa config validate
[WARN] namespace not set
[ERROR] scheme set to ws, which is invalid. Must only be http or https.

Not required, but output flags of  --json could be added, which would write the output to a JSON file.

Rules

  • host: required, must be a valid hostname
  • api_key: warning if empty (some operations could be executed without it)
  • namespace: warning if empty
  • scheme: required, http and https only accepted values
  • token_endpoint: required, must be valid URL

Notes

Recommend merging #95 before starting work on this ticket, as that PR introduces a logging pattern that would be useful for this work.

Contributor Guide