Skip to content

Commit a04c16c

Browse files
michaeltlombardiGijsreyn
authored andcommitted
(SCHEMA) Update docs keywords for secret operation stdout schema
This change updates and extends the `markdownDescription` keyword for the `secret` operation stdout schema, clarifying the expected output conditions and validation.
1 parent e4bc68c commit a04c16c

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

schemas/src/extension/stdout/secret.yaml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,40 @@ markdownDescription: | # VS Code only
1010
[_Online Documentation_][00]
1111
***
1212
13-
Represents the secret text returned by a DSC extension for a secret request. DSC expects the
14-
extension to emit a single line containing only the secret value. An empty output indicates that
15-
no secret is available. If multiple lines are emitted, DSC treats it as an error.
13+
Represents the secret text returned by a DSC extension for a secret request. The output that
14+
DSC expects from the extension depends on the result of retrieving the secret:
15+
16+
- If the extension successfully retrieves the secret, DSC expects the extension to:
17+
18+
1. Emit a single line containing only the secret value, not wrapped in quotation marks or a
19+
JSON object, to stdout. DSC treats the literal text returned by the extension as the secret
20+
value. If the emitted output contains any newlines, the output is invalid.
21+
1. Exit with code `0` to indicate success.
22+
23+
- If the extension can't retrieve the secret because no secret with the given name was
24+
discovered, DSC expects the extension to:
25+
26+
1. Emit _no output_ to stdout. If the extension emits any output to stdout, DSC interprets the
27+
emitted text to be the secret value.
28+
1. Optionally emit messages to stderr as [JSON Lines][01] to indicate the attempt to retrieve
29+
the secret and noting that the secret doesn't exist. DSC surfaces emitted messages to the
30+
caller depending on the message level.
31+
1. Exit with code `0` to indicate success. For DSC, an extension not returning a secret value
32+
because no secret with the given name exists is _not_ a failure.
33+
34+
- If the extension can't retrieve the secret for any other reason, such as requiring the vault
35+
to be unlocked or encountering an API error, DSC expects the extension to:
36+
37+
1. Emit _no output_ to stdout.
38+
1. Optionally emit detailed error messages to stderr as [JSON Lines][01] to provide contextual
39+
information about how and why the retrieval failed. DSC always surfaces emitted error
40+
messages to the caller.
41+
1. Exit with a nonzero code to indicate failure. If the extension manifest defines the
42+
[`exitCodes`][02] field, DSC surfaces the meaning of the exit code to the caller.
1643
1744
[00]: <DOCS_BASE_URL>/reference/schemas/extension/stdout/secret?<DOCS_VERSION_PIN>
45+
[01]: https://jsonlines.org/
46+
[02]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/root?<DOCS_VERSION_PIN>#exitcodes
1847
1948
type: string
2049
minLength: 0

0 commit comments

Comments
 (0)