-
Notifications
You must be signed in to change notification settings - Fork 50
(SCHEMA) Add extension secret to schema source #1083
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
Open
Gijsreyn
wants to merge
6
commits into
PowerShell:main
Choose a base branch
from
Gijsreyn:add-secret-schema
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d0b4549
Add schema for secret
Gijsreyn 5229401
Add schema for secret
Gijsreyn 1ba13ac
Merge branch 'add-secret-schema' of https://github.com/Gijsreyn/opera…
Gijsreyn 566cd5e
Add rewritten version Mikey
Gijsreyn 64ad4af
(SCHEMA) Enhance docs and validation for `secret` in extension manife…
michaeltlombardi 5c4230d
(SCHEMA) Update docs keywords for `secret` operation stdout schema
michaeltlombardi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema | ||
$schema: https://json-schema.org/draft/2020-12/schema | ||
$id: <HOST>/<PREFIX>/<VERSION>/extension/manifest.secret.yaml | ||
|
||
title: Secret operation command | ||
description: >- | ||
Defines how DSC must call the DSC extension to retrieve a secret value. | ||
markdownDescription: | # VS Code only | ||
*** | ||
[_Online Documentation_][00] | ||
*** | ||
|
||
Defines how DSC must call the DSC extension to retrieve a secret value. An | ||
extension that defines this field in its manifest has the `secret` capability. | ||
|
||
The secret operation is expected to output a single line to stdout containing | ||
the secret text. If the extension outputs no data to stdout, DSC treats it as | ||
"no secret returned". If the extension outputs multiple lines, DSC treats that | ||
as an error. | ||
|
||
For details about the output format, see | ||
[Secret extension operation stdout][01]. | ||
|
||
[00]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/secret?<DOCS_VERSION_PIN> | ||
[01]: <DOCS_BASE_URL>/reference/schemas/extension/stdout/secret?<DOCS_VERSION_PIN> | ||
Gijsreyn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
type: object | ||
required: | ||
- executable | ||
properties: | ||
executable: | ||
$ref: /<PREFIX>/<VERSION>/definitions/commandExecutable.yaml | ||
markdownDescription: | | ||
*** | ||
[_Online Documentation_][01] | ||
*** | ||
|
||
Defines the name of the command to run. The value must be the name of a command discoverable | ||
in the system's `PATH` environment variable or the full path to the command. A file extension | ||
is only required when the command isn't recognizable by the operating system as an | ||
executable. | ||
|
||
[01]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/secret?<DOCS_VERSION_PIN>#executable | ||
args: | ||
title: Arguments | ||
description: >- | ||
Defines an ordered list of arguments to pass to the command. | ||
markdownDescription: | | ||
*** | ||
[_Online Documentation_][01] | ||
*** | ||
|
||
Defines an ordered list of arguments to pass to the command. Items can be plain strings or | ||
structured entries indicating which argument name should receive the secret name or the vault | ||
name. | ||
|
||
DSC expands structured entries as follows: | ||
|
||
- `{ "nameArg": "<flag>" }` expands to `"<flag>", "<secret-name>"`. | ||
michaeltlombardi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- `{ "vaultArg": "<flag>" }` expands to `"<flag>", "<vault-name>"` (only when a vault is | ||
specified by the caller). | ||
|
||
[01]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/secret?<DOCS_VERSION_PIN>#args | ||
type: array | ||
items: | ||
anyOf: | ||
- type: string | ||
- type: object | ||
additionalProperties: false | ||
required: | ||
- nameArg | ||
properties: | ||
nameArg: | ||
type: string | ||
- type: object | ||
additionalProperties: false | ||
required: | ||
- vaultArg | ||
properties: | ||
vaultArg: | ||
type: string | ||
|
||
defaultSnippets: # VS Code only | ||
- label: ' Define without arguments' | ||
markdownDescription: | | ||
Define the `secret` command for the extension when no arguments are required. | ||
body: | ||
executable: ${2:executable_name} | ||
- label: ' Define with arguments (flags + name)' | ||
markdownDescription: |- | ||
Define the `secret` command where the secret name is passed to a specific flag. | ||
body: | ||
executable: ${2:executable_name} | ||
args: | ||
- ${3:--get-secret} | ||
- nameArg: ${4:--name} | ||
- label: ' Define with arguments (flags + name + vault)' | ||
markdownDescription: |- | ||
Define the `secret` command where both the secret name and the vault name are passed. | ||
body: | ||
executable: ${2:executable_name} | ||
args: | ||
- ${3:--get-secret} | ||
- nameArg: ${4:--name} | ||
- vaultArg: ${5:--vault} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema | ||
$schema: https://json-schema.org/draft/2020-12/schema | ||
$id: <HOST>/<PREFIX>/<VERSION>/extension/stdout/secret.yaml | ||
|
||
title: Secret extension operation stdout | ||
description: >- | ||
Represents the secret text returned by a DSC extension for a secret request. | ||
markdownDescription: | # VS Code only | ||
*** | ||
[_Online Documentation_][00] | ||
*** | ||
|
||
Represents the secret text returned by a DSC extension for a secret request. DSC expects the | ||
extension to emit a single line containing only the secret value. An empty output indicates that | ||
no secret is available. If multiple lines are emitted, DSC treats it as an error. | ||
|
||
[00]: <DOCS_BASE_URL>/reference/schemas/extension/stdout/secret?<DOCS_VERSION_PIN> | ||
|
||
type: string | ||
minLength: 0 |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.