forked from PowerShell/DSC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(SCHEMA) Add
Microsoft.DSC
config metadata schema
This change updates the `metadata` property of the configuration document schema to include the validated `Microsoft.DSC` property, with the `requiredSecurityContext` child property, as implemented in PowerShell#351. This change updates both the source and composed schemas.
- Loading branch information
1 parent
72dec0d
commit 63d236a
Showing
6 changed files
with
265 additions
and
88 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,28 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.metadata.json", | ||
"title": "Configuration metadata", | ||
"description": "Defines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC` property, this metadata isn't validated. You can pass any data into this property of a configuration document.", | ||
"type": "object", | ||
"properties": { | ||
"Microsoft.DSC": { | ||
"type": "object", | ||
"title": "DSC metadata", | ||
"description": "The `Microsoft.DSC` metadata property contains directives and information that DSC itself uses when processing a configuration document. Unlike other metadata key-value pairs, DSC validates these properties.", | ||
"unevaluatedProperties": false, | ||
"properties": { | ||
"requiredSecurityContext": { | ||
"type": "string", | ||
"enum": [ | ||
"Current", | ||
"Elevated", | ||
"Restricted" | ||
], | ||
"default": "Current", | ||
"title": "Required security context", | ||
"description": "This property defines the security context a configuration requires. If you invoke a DSC operation against the configuration document in a security context that conflicts with this metadata, DSC raises an error when it validates the configuration document.\nThe default security context is `Current`." | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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,141 @@ | ||
# 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>/config/document.metadata.yaml | ||
|
||
title: Configuration metadata | ||
description: >- | ||
Defines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC` | ||
property, this metadata isn't validated. You can pass any data into this property of a | ||
configuration document. | ||
type: object | ||
properties: | ||
Microsoft.DSC: | ||
type: object | ||
title: DSC metadata | ||
description: >- | ||
The `Microsoft.DSC` metadata property contains directives and information that DSC itself | ||
uses when processing a configuration document. Unlike other metadata key-value pairs, DSC | ||
validates these properties. | ||
markdownDescription: | | ||
*** | ||
[_Online Documentation_][01] | ||
*** | ||
The `Microsoft.DSC` metadata property contains directives and information that DSC itself | ||
uses when processing a configuration document. Unlike other metadata key-value pairs, DSC | ||
validates these properties. | ||
[01]: <DOCS_BASE_URL>/reference/schemas/config/metadata?<DOCS_VERSION_PIN>#microsoft.dsc | ||
unevaluatedProperties: false | ||
properties: | ||
requiredSecurityContext: | ||
type: string | ||
enum: | ||
- Current | ||
- Elevated | ||
- Restricted | ||
default: Current | ||
title: Required security context | ||
description: >- | ||
This property defines the security context a configuration requires. If you invoke a DSC | ||
operation against the configuration document in a security context that conflicts with | ||
this metadata, DSC raises an error when it validates the configuration document. | ||
The default security context is `Current`. | ||
markdownDescription: | | ||
*** | ||
[_Online Documentation_][01] | ||
*** | ||
This property defines the security context a configuration requires. If you invoke a DSC | ||
operation against the configuration document in a security context that conflicts with | ||
this metadata, DSC raises an error when it validates the configuration document. | ||
The default security context is `Current`. | ||
[01]: <DOCS_BASE_URL>/reference/schemas/config/metadata?<DOCS_VERSION_PIN>#microsoft.dsc | ||
markdownEnumDescriptions: | ||
- | # Current | ||
<!-- force a line break --> | ||
> ### Current security context | ||
> | ||
> Indicates that the configuration document is usable under any security context. You | ||
> can invoke DSC operations against the document when elevated as root or an | ||
> administrator and as a normal user or account. | ||
- | # Elevated | ||
<!-- force a line break --> | ||
> ### Elevated security context | ||
> | ||
> Indicates that the configuration document is usable only in an elevated security | ||
> context. You can invoke DSC operations against the document when elevated as root or | ||
> an administrator. When you invoke DSC operations against the document as a | ||
> non-elevated user or account, DSC raises an error when it validates the configuration | ||
> document. | ||
- | # Restricted | ||
<!-- force a line break --> | ||
> ### Restricted security context | ||
> | ||
> Indicates that the configuration document is usable only in a non-elevated security | ||
> context. You can invoke DSC operations against the document as a non-elevated user or | ||
> account. When you invoke DSC operations against the document as root or an | ||
> administrator, DSC raises an error when it validates the configuration document. | ||
# VS Code only | ||
markdownDescription: | | ||
*** | ||
[_Online Documentation_][01] | ||
*** | ||
Defines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC` | ||
property, this metadata isn't validated. You can pass any data into this property of a | ||
configuration document. | ||
The `Microsoft.DSC` metadata property contains metadata directives and information that DSC | ||
itself uses when processing the configuration document. For more information, see | ||
[Microsoft.DSC][02] | ||
[01]: <DOCS_BASE_URL>/reference/schemas/config/metadata?<DOCS_VERSION_PIN> | ||
[02]: <DOCS_BASE_URL>/reference/schemas/config/metadata?<DOCS_VERSION_PIN>#microsoft.dsc | ||
defaultSnippets: | ||
- label: ' New metadata property' | ||
markdownDescription: |- | ||
Defines a key-value pair for the metadata: | ||
```yaml | ||
metadataName: value | ||
``` | ||
body: | ||
${1:metadataName}: ${2:value} | ||
|
||
- label: ' New metadata property (object)' | ||
markdownDescription: |- | ||
Defines a new key-value pair for the metadata where the value is an object. | ||
```yaml | ||
metadataName: | ||
key: value | ||
``` | ||
body: | ||
${1:metadataName}: | ||
${2:key}: ${3:value} | ||
|
||
- label: ' New metadata property (array)' | ||
markdownDescription: |- | ||
Defines a new key-value pair for the metadata where the value is an array. | ||
```yaml | ||
metadataName: | ||
- firstValue | ||
- secondValue | ||
``` | ||
body: | ||
${1:metadataName}: | ||
- ${2:firstValue} | ||
- ${3:secondValue} |
This file contains 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