Skip to content

Commit

Permalink
⭐ native windows registry resource
Browse files Browse the repository at this point in the history
Migrate #1359

Fixes #1604

Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus committed Sep 20, 2023
1 parent 5c41cee commit 4d99d51
Show file tree
Hide file tree
Showing 11 changed files with 716 additions and 261 deletions.
4 changes: 2 additions & 2 deletions providers-sdk/v1/testutils/testdata/windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
{
"Resource": "command",
"ID": "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAHAAYQB0AGgAIAA9ACAAJwBIAEsARQBZAF8ATABPAEMAQQBMAF8ATQBBAEMASABJAE4ARQBcAFMATwBGAFQAVwBBAFIARQBcAE0AaQBjAHIAbwBzAG8AZgB0AFwAVwBpAG4AZABvAHcAcwBcAEMAdQByAHIAZQBuAHQAVgBlAHIAcwBpAG8AbgBcAFAAbwBsAGkAYwBpAGUAcwBcAFMAeQBzAHQAZQBtACcACgAkAHIAZQBnACAAPQAgAEcAZQB0AC0ASQB0AGUAbQAgACgAJwBSAGUAZwBpAHMAdAByAHkAOgA6ACcAIAArACAAJABwAGEAdABoACkACgBpAGYAIAAoACQAcgBlAGcAIAAtAGUAcQAgACQAbgB1AGwAbAApACAAewAKACAAIABXAHIAaQB0AGUALQBFAHIAcgBvAHIAIAAiAEMAbwB1AGwAZAAgAG4AbwB0ACAAZgBpAG4AZAAgAHIAZQBnAGkAcwB0AHIAeQAgAGsAZQB5ACIACgAgACAAZQB4AGkAdAAgADEACgB9AAoAJABwAHIAbwBwAGUAcgB0AGkAZQBzACAAPQAgAEAAKAApAAoAJAByAGUAZwAuAFAAcgBvAHAAZQByAHQAeQAgAHwAIABGAG8AcgBFAGEAYwBoAC0ATwBiAGoAZQBjAHQAIAB7AAoAIA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gB0AGkAZQBzAAoA",
"Fields": {
"exitcode": {
"type": "\u0005",
Expand All @@ -69,7 +69,7 @@
},
{
"Resource": "command",
"ID": "powershell.exe -NoProfile -EncodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsACgAkAHAAYQB0AGgAIAA9ACAAJwBIAEsARQBZAF8ATABPAEMAQQBMAF8ATQBBAEMASABJAE4ARQBcAFMAbwBmAHQAdwBhAHIAZQBcAFAAbwBsAGkAYwBpAGUAcwBcAE0AaQBjAHIAbwBzAG8AZgB0AFwAVwBpAG4AZABvAHcAcwBcAFAAZQByAHMAbwBuAGEAbABpAHoAYQB0AGkAbwBuACcACgAkAHIAZQBnACAAPQAgAEcAZQB0AC0ASQB0AGUAbQAgACgAJwBSAGUAZwBpAHMAdAByAHkAOgA6ACcAIAArACAAJABwAGEAdABoACkACgBpAGYAIAAoACQAcgBlAGcAIAAtAGUAcQAgACQAbgB1AGwAbAApACAAewAKACAAIABXAHIAaQB0AGUALQBFAHIAcgBvAHIAIAAiAEMAbwB1AGwAZAAgAG4AbwB0ACAAZgBpAG4AZAAgAHIAZQBnAGkAcwB0AHIAeQAgAGsAZQB5ACIACgAgACAAZQB4AGkAdAAgADEACgB9AAoAJABwAHIAbwBwAGUAcgB0AGkAZQBzACAAPQAgAEAAKAApAAoAJAByAGUAZwAuAFAAcgBvAHAAZQByAHQAeQAgAHwAIABGAG8AcgBFAGEAYwBoAC0ATwBiAGoAZQBjAHQAIAB7AAoAIAAgACAAIAAkAGYAZQB0AGMAaABLAGUAeQBWAGEAbAB1AGUAIAA9ACAAJABfAAoAIAAgACAAIABpAGYAIAAoACIAKABkAGUAZgBhAHUAbAB0ACkAIgAuAEUAcQB1AGEAbABzACgAJABfACkAKQAgAHsAIAAkAGYAZQB0AGMAaABLAGUAeQBWAGEAbAB1AGUAIAA9ACAAJwAnACAAf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gAD0AIAAkACgARwBlAHQALQBJAHQAZQBtAFAAcgBvAHAAZQByAHQAeQAgACgAJwBSAGUAZwBpAHMAdAByAHkAOgA6ACcAIAArACAAJABwAGEAdABoACkAKQAgAHwAIABTAGUAbABlAGMAdAAtAE8AYgBqAGUAYwB0ACAALQBFAHgAcABhAG4AZABQAHIAbwBwAGUAcgB0AHkAIAAkAF8ACgAJAH0ACgAgACAAIAAgACQAZQBuAHQAcgB5ACAAPQAgAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABwAHMAbwBiAGoAZQBjAHQAIAAtAFAAcgBvAHAAZQByAHQAeQAgAEAAewAKACAAIAAgACAAIAAgACIAawBlAHkAIgAgAD0AIAAkAF8ACgAgACAAIAAgACAAIAAiAHYAYQBsAHUAZQAiACAAPQAgAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABwAHMAbwBiAGoAZQBjAHQAIAAtAFAAcgBvAHAAZQByAHQAeQAgAEAAewAKACAAIAAgACAAIAAgACAAIAAiAGQAYQB0AGEAIgAgAD0AIAAkAGQAYQB0AGEAOwAKACAAIAAgACAAIAAgACAAIAAiAGsAaQBuAGQAIgAgAD0AIAAkAGsAaQBuAGQAOwAKACAAIAAgACAAIAAgAH0ACgAgACAAIAAgAH0ACgAgACAAIAAgACQAcAByAG8AcABlAHIAdABpAGUAcwAgACsAPQAgACQAZQBuAHQAcgB5AAoAfQAKAEMAbwBuAHYAZQByAHQAVABvAC0ASgBzAG8AbgAgAC0ARABlAHAAdABoACAAMwAgAC0AQwBvAG0AcAByAGUAcwBzACAAJABwAHIAbwBwAGUAcgB0AGkAZQBzAAoA",
"Fields": {
"exitcode": {
"type": "\u0005",
Expand Down
15 changes: 13 additions & 2 deletions providers/os/resources/os.lr
Original file line number Diff line number Diff line change
Expand Up @@ -963,20 +963,31 @@ registrykey @defaults("path") {
init(path string)
// Registry key path
path string
// Indicates if the property exists
exists() bool
// Registry key properties
// deprecated: Registry key properties, use `items` instead
properties() map[string]string
// Registry key items
items() []registrykey.property
// Registry key children
children() []string
}

// Windows registry key property
registrykey.property @defaults("path name") {
init(path string, name string)
// Registry key path
path string
// Registry key name
name string
// Indicates if the property exists
exists() bool
value(exists) string
// deprecated: Registry key property value converted to string, use `data` instead
value() string
// Registry key type
type() string
// Registry key data
data() dict
}

// Container Image
Expand Down
61 changes: 54 additions & 7 deletions providers/os/resources/os.lr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4d99d51

Please sign in to comment.