Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ members = [
"resources/sshdconfig",
"resources/WindowsUpdate",
"resources/windows_service",
"resources/windows_firewall",
"tools/dsctest",
"tools/test_group_resource",
"grammars/tree-sitter-dscexpression",
Expand Down Expand Up @@ -51,6 +52,7 @@ default-members = [
"resources/sshdconfig",
"resources/WindowsUpdate",
"resources/windows_service",
"resources/windows_firewall",
"tools/dsctest",
"tools/test_group_resource",
"grammars/tree-sitter-dscexpression",
Expand Down Expand Up @@ -81,6 +83,7 @@ Windows = [
"resources/sshdconfig",
"resources/WindowsUpdate",
"resources/windows_service",
"resources/windows_firewall",
"tools/dsctest",
"tools/test_group_resource",
"grammars/tree-sitter-dscexpression",
Expand Down Expand Up @@ -258,6 +261,7 @@ ipnetwork = { version = "0.21" }
# WindowsUpdate, windows_service
windows = { version = "0.62", features = [
"Win32_Foundation",
"Win32_NetworkManagement_WindowsFirewall",
"Win32_System_Com",
"Win32_System_Ole",
"Win32_System_Services",
Expand Down
3 changes: 2 additions & 1 deletion lib/dsc-lib-jsonschema/.versions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"latestMajor": "V3",
"latestMinor": "V3_1",
"latestPatch": "V3_1_2",
"latestPatch": "V3_1_3",
"all": [
"V3",
"V3_1",
"V3_1_3",
"V3_1_2",
"V3_1_1",
"V3_1_0",
Expand Down
14 changes: 14 additions & 0 deletions resources/windows_firewall/.project.data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Name": "windows_firewall",
"Kind": "Resource",
"IsRust": true,
"SupportedPlatformOS": "Windows",
"Binaries": [
"windows_firewall"
],
"CopyFiles": {
"Windows": [
"windows_firewall.dsc.resource.json"
]
}
}
17 changes: 17 additions & 0 deletions resources/windows_firewall/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "windows_firewall"
version = "0.1.0"
edition = "2024"

[package.metadata.i18n]
available-locales = ["en-us"]
default-locale = "en-us"
load-path = "locales"

[dependencies]
rust-i18n = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }

[target.'cfg(windows)'.dependencies]
windows = { workspace = true }
32 changes: 32 additions & 0 deletions resources/windows_firewall/locales/en-us.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
_version = 1

[main]
missingOperation = "Missing operation. Usage: windows_firewall get --input <json> | set --input <json> | export [--input <json>]"
unknownOperation = "Unknown operation: '%{operation}'. Expected: get, set, or export"
missingInput = "Missing --input argument"
missingInputValue = "Missing value for --input argument"
invalidJson = "Invalid JSON input: %{error}"
windowsOnly = "This resource is only supported on Windows"

[get]
rulesArrayEmpty = "The rules array cannot be empty for get operations"
selectorRequired = "Each firewall rule in a get request must include a name"

[set]
rulesArrayEmpty = "The rules array cannot be empty for set operations"
selectorRequired = "Each firewall rule in a set request must include a name"

[firewall]
comInitFailed = "Failed to initialize COM for Windows Firewall access: %{error}"
policyOpenFailed = "Failed to open the Windows Firewall policy: %{error}"
ruleEnumerationFailed = "Failed to enumerate Windows Firewall rules: %{error}"
ruleLookupFailed = "Failed to look up firewall rule '%{name}': %{error}"
ruleCreateFailed = "Failed to create a firewall rule object: %{error}"
ruleAddFailed = "Failed to add firewall rule '%{name}': %{error}"
ruleRemoveFailed = "Failed to remove firewall rule '%{name}': %{error}"
ruleUpdateFailed = "Failed to update firewall rule '%{name}': %{error}"
ruleReadFailed = "Failed to read firewall rule '%{name}': %{error}"
portsNotAllowed = "Ports cannot be specified for firewall rule '%{name}' because protocol %{protocol} does not support ports"
invalidProfiles = "Invalid profiles value '%{value}'. Valid values are Domain, Private, Public, or All"
invalidInterfaceType = "Invalid interface type '%{value}'. Valid values are RemoteAccess, Wireless, Lan, or All"
invalidProtocol = "Invalid protocol number '%{value}'. Must be between 0 and 256"
Loading
Loading