Skip to content

Commit 9300b59

Browse files
feat: Added fips_compliant field to WixConfig (#13787)
Co-authored-by: Fabian-Lars <[email protected]>
1 parent e1d7be8 commit 9300b59

File tree

8 files changed

+48
-10
lines changed

8 files changed

+48
-10
lines changed

.changes/add-fips-to-wix-config.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
tauri-utils: minor:enhance
3+
---
4+
5+
Added `fips_compliant` field to `WixConfig` so that it can be configured via `tauri.conf.json` as well.

crates/tauri-cli/config.schema.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,14 +1071,14 @@
10711071
]
10721072
},
10731073
{
1074-
"description": "A policy where a web view thats not in a window fully suspends tasks. This is usually the default behavior in case no policy is set.",
1074+
"description": "A policy where a web view that's not in a window fully suspends tasks. This is usually the default behavior in case no policy is set.",
10751075
"type": "string",
10761076
"enum": [
10771077
"suspend"
10781078
]
10791079
},
10801080
{
1081-
"description": "A policy where a web view thats not in a window limits processing, but does not fully suspend tasks.",
1081+
"description": "A policy where a web view that's not in a window limits processing, but does not fully suspend tasks.",
10821082
"type": "string",
10831083
"enum": [
10841084
"throttle"
@@ -2787,6 +2787,11 @@
27872787
"string",
27882788
"null"
27892789
]
2790+
},
2791+
"fipsCompliant": {
2792+
"description": "Enables FIPS compliant algorithms.\n Can also be enabled via the `TAURI_BUNDLER_WIX_FIPS_COMPLIANT` env var.",
2793+
"default": false,
2794+
"type": "boolean"
27902795
}
27912796
},
27922797
"additionalProperties": false

crates/tauri-cli/schema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,14 @@
23302330
"string",
23312331
"null"
23322332
]
2333+
},
2334+
"fipsCompliant": {
2335+
"description": "Enables FIPS compliant algorithms.",
2336+
"default": null,
2337+
"type": [
2338+
"boolean",
2339+
"null"
2340+
]
23332341
}
23342342
},
23352343
"additionalProperties": false

crates/tauri-cli/src/helpers/config.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
1+
// Copyright 2019-2025 Tauri Programme within The Commons Conservancy
22
// SPDX-License-Identifier: Apache-2.0
33
// SPDX-License-Identifier: MIT
44

@@ -11,7 +11,7 @@ pub use tauri_utils::{config::*, platform::Target};
1111

1212
use std::{
1313
collections::HashMap,
14-
env::{current_dir, set_current_dir, set_var, var_os},
14+
env::{current_dir, set_current_dir, set_var},
1515
ffi::OsStr,
1616
process::exit,
1717
sync::{Arc, Mutex, OnceLock},
@@ -70,6 +70,10 @@ pub fn wix_settings(config: WixConfig) -> tauri_bundler::WixSettings {
7070
tauri_bundler::WixSettings {
7171
version: config.version,
7272
upgrade_code: config.upgrade_code,
73+
fips_compliant: std::env::var("TAURI_BUNDLER_WIX_FIPS_COMPLIANT")
74+
.ok()
75+
.map(|v| v == "true")
76+
.unwrap_or(config.fips_compliant),
7377
language: tauri_bundler::WixLanguage(match config.language {
7478
WixLanguage::One(lang) => vec![(lang, Default::default())],
7579
WixLanguage::List(languages) => languages
@@ -98,7 +102,6 @@ pub fn wix_settings(config: WixConfig) -> tauri_bundler::WixSettings {
98102
enable_elevated_update_task: config.enable_elevated_update_task,
99103
banner_path: config.banner_path,
100104
dialog_image_path: config.dialog_image_path,
101-
fips_compliant: var_os("TAURI_BUNDLER_WIX_FIPS_COMPLIANT").is_some_and(|v| v == "true"),
102105
}
103106
}
104107

crates/tauri-cli/tauri.config.schema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,14 @@
23302330
"string",
23312331
"null"
23322332
]
2333+
},
2334+
"fipsCompliant": {
2335+
"description": "Enables FIPS compliant algorithms.",
2336+
"default": null,
2337+
"type": [
2338+
"boolean",
2339+
"null"
2340+
]
23332341
}
23342342
},
23352343
"additionalProperties": false

crates/tauri-schema-generator/schemas/config.schema.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,14 +1071,14 @@
10711071
]
10721072
},
10731073
{
1074-
"description": "A policy where a web view thats not in a window fully suspends tasks. This is usually the default behavior in case no policy is set.",
1074+
"description": "A policy where a web view that's not in a window fully suspends tasks. This is usually the default behavior in case no policy is set.",
10751075
"type": "string",
10761076
"enum": [
10771077
"suspend"
10781078
]
10791079
},
10801080
{
1081-
"description": "A policy where a web view thats not in a window limits processing, but does not fully suspend tasks.",
1081+
"description": "A policy where a web view that's not in a window limits processing, but does not fully suspend tasks.",
10821082
"type": "string",
10831083
"enum": [
10841084
"throttle"
@@ -2787,6 +2787,11 @@
27872787
"string",
27882788
"null"
27892789
]
2790+
},
2791+
"fipsCompliant": {
2792+
"description": "Enables FIPS compliant algorithms.\n Can also be enabled via the `TAURI_BUNDLER_WIX_FIPS_COMPLIANT` env var.",
2793+
"default": false,
2794+
"type": "boolean"
27902795
}
27912796
},
27922797
"additionalProperties": false

crates/tauri-utils/src/config.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,10 @@ pub struct WixConfig {
788788
/// The required dimensions are 493px × 312px.
789789
#[serde(alias = "dialog-image-path")]
790790
pub dialog_image_path: Option<PathBuf>,
791+
/// Enables FIPS compliant algorithms.
792+
/// Can also be enabled via the `TAURI_BUNDLER_WIX_FIPS_COMPLIANT` env var.
793+
#[serde(default, alias = "fips-compliant")]
794+
pub fips_compliant: bool,
791795
}
792796

793797
/// Compression algorithms used in the NSIS installer.
@@ -1492,9 +1496,9 @@ impl schemars::JsonSchema for Color {
14921496
pub enum BackgroundThrottlingPolicy {
14931497
/// A policy where background throttling is disabled
14941498
Disabled,
1495-
/// A policy where a web view thats not in a window fully suspends tasks. This is usually the default behavior in case no policy is set.
1499+
/// A policy where a web view that's not in a window fully suspends tasks. This is usually the default behavior in case no policy is set.
14961500
Suspend,
1497-
/// A policy where a web view thats not in a window limits processing, but does not fully suspend tasks.
1501+
/// A policy where a web view that's not in a window limits processing, but does not fully suspend tasks.
14981502
Throttle,
14991503
}
15001504

crates/tauri-utils/src/config_v1/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ pub struct WixConfig {
482482
pub banner_path: Option<PathBuf>,
483483
/// Path to a bitmap file to use on the installation user interface dialogs.
484484
/// It is used on the welcome and completion dialogs.
485-
485+
///
486486
/// The required dimensions are 493px × 312px.
487487
#[serde(alias = "dialog-image-path")]
488488
pub dialog_image_path: Option<PathBuf>,

0 commit comments

Comments
 (0)