-
Notifications
You must be signed in to change notification settings - Fork 397
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
Ability to validate App Spec Schema in Offline Mode #1449
Labels
Comments
trinitronx
added a commit
to trinitronx/doctl
that referenced
this issue
Oct 22, 2023
…cean#1449) Implement a new command to validate an app spec without requiring auth & connection to the API. This is useful for validating app specs in CI pipelines and untrusted environments. As there is no currently published [YAML schema][1] for use with [`redhat.vscode-yaml`][2], this seems to be the best approach for now. [1]: https://www.schemastore.org/json/ [2]: https://github.com/redhat-developer/yaml-language-server
trinitronx
added a commit
to LyraPhase/pre-commit-digitalocean
that referenced
this issue
Oct 22, 2023
Note: This requires the latest doctl from PR: digitalocean/doctl#1449
trinitronx
added a commit
to LyraPhase/pre-commit-digitalocean
that referenced
this issue
Oct 22, 2023
Add hook: doctl-app-spec-validate-offline (digitalocean/doctl#1449)
trinitronx
added a commit
to trinitronx/doctl
that referenced
this issue
Oct 23, 2023
…talocean#1449) Thanks to @andrewsomething for the suggestion! Reference: - digitalocean#1450 (review)
trinitronx
added a commit
to trinitronx/doctl
that referenced
this issue
Oct 23, 2023
…talocean#1449) Thanks to @andrewsomething for the suggestion! Reference: - digitalocean#1450 (review)
trinitronx
added a commit
to trinitronx/doctl
that referenced
this issue
Oct 23, 2023
…talocean#1449) (#1) Thanks to @andrewsomething for the suggestion! Reference: - digitalocean#1450 (review)
trinitronx
added a commit
to trinitronx/doctl
that referenced
this issue
Oct 23, 2023
…talocean#1449) (#1) Thanks to @andrewsomething for the suggestion! Reference: - digitalocean#1450 (review)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the problem this feature would solve? Please describe.
This feature would solve the following problems & issues:
No ability to run the following command in "offline" mode. For example:
Security Risk: GitHub Actions using digitalocean/action-doctl for App Schema validation always requires an API
token
doctl app schema validate --schema-only ...
makes it impossible to follow the principle of least priviledgeno_auth
feature for digitalocean/action-doctl from being currently possible.Describe the solution you'd like
Some way to validate a DigitalOcean App Spec in offline mode should be provided. A separate command (e.g.
validate-offline
) should be decoupled from thegodo
API client &auth
initialization to support this use case.Additional context
Currently, the
doctl app spec validate
command is tightly coupled to requiregodo
init anddoctl auth
. ThevalidateCommand
is defined usingCmdBuilder()
, which callscmdBuilderWithInit(..., true, options...)
withinitCmd
set totrue
always (This is passed toNewCmdConfig()
as theinitGodo
parameter which runscmdConfig.initServices()
).As such, the
--schema-only
flag still requiresdoctl auth
and agodo
client is initialized. Unfortunately due to the way Cobra commands appear to be set up, the--schema-only
flag is not available in the context where the command creation happens. Therefore, it seems that we must implement a new sub-command for this feature (e.g.doctl app spec validate-offline
). The usage ofcmdBuilderWithInit
similar to this command PR seems to be the proper method to setup this new command.The text was updated successfully, but these errors were encountered: