@@ -35,12 +35,42 @@ properties:
3535 [_Online Documentation_][01]
3636 ***
3737
38- Defines the name of the command to run. The value must be the name of a command discoverable
39- in the system's `PATH` environment variable or the full path to the command. A file extension
40- is only required when the command isn't recognizable by the operating system as an
41- executable.
38+ DSC expects extensions implementing the `secret` capability to adhere to the
39+ following contract:
40+
41+ 1. If the extension retrieves the secret, the extension must emit the secret
42+ to stdout as a single line of plaintext and exit with code `0`. DSC
43+ consumes the emitted output and makes the secret available in the
44+ configuration document.
4245
43- [01]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/secret?<DOCS_VERSION_PIN>#executable
46+ If the extension emits more than one line to stdout, DSC raises an error.
47+ 1. If the extension cannot retrieve the secret because the secret doesn't
48+ exist, the extension must not emit any text to stdout and must exit with
49+ code `0`. DSC interprets this result as the secret not existing in the
50+ vault.
51+ 1. If the extension cannot retrieve the secret for any other reason, such
52+ as invalid credentials or an API error, the extension should emit
53+ a descriptive error message as a JSON Line to stderr and exit with a
54+ nonzero exit code. DSC interprets the nonzero exit code as an operational
55+ failure and surfaces that information and any emitted error messages to
56+ the user.
57+
58+ When the exit code for the operation is `0`, DSC interprets the operation as
59+ completing without errors. For extensions, failure to retrieve a secret
60+ because it doesn't exist is _not_ an error. Failure to retrieve a secret
61+ for any other reason _is_ an error and the extension should exit with a
62+ nonzero code. For an improved user experience, the extension should define
63+ the `exitCodes` field in the extension manifest to indicate what the nonzero
64+ exit code means.
65+
66+ For more information about how DSC validates the data for stdout, see
67+ [Secret extension operation stdout][01]. For more information about defining
68+ exit codes for the extension, see [`exitCodes`][02] in the extension manifest
69+ schema reference.
70+
71+ [00]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/secret?<DOCS_VERSION_PIN>
72+ [01]: <DOCS_BASE_URL>/reference/schemas/extension/stdout/secret?<DOCS_VERSION_PIN>
73+ [02]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/root?<DOCS_VERSION_PIN>#exitcodes
4474 args :
4575 title : Arguments
4676 description : >-
0 commit comments