Skip to content

Commit de8efb0

Browse files
don't log enrollment token (#650)
1 parent efc9ac0 commit de8efb0

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

  • src-tauri/src/enterprise/provisioning

src-tauri/src/enterprise/provisioning/mod.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{fs, path::Path};
1+
use std::{fmt, fs, path::Path};
22

33
use serde::{Deserialize, Serialize};
44
use tauri::{AppHandle, Manager};
@@ -7,12 +7,26 @@ use crate::database::{models::instance::Instance, DB_POOL};
77

88
const CONFIG_FILE_NAME: &str = "provisioning.json";
99

10-
#[derive(Clone, Debug, Deserialize, Serialize)]
10+
#[derive(Clone, Deserialize, Serialize)]
1111
pub struct ProvisioningConfig {
1212
pub enrollment_url: String,
1313
pub enrollment_token: String,
1414
}
1515

16+
impl fmt::Debug for ProvisioningConfig {
17+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18+
let Self {
19+
enrollment_url,
20+
enrollment_token: _,
21+
} = self;
22+
23+
f.debug_struct("ProvisioningConfig")
24+
.field("enrollment_url", enrollment_url)
25+
.field("enrollment_token", &"***")
26+
.finish()
27+
}
28+
}
29+
1630
impl ProvisioningConfig {
1731
/// Load configuration from a file at `path`.
1832
fn load(path: &Path) -> Option<Self> {

0 commit comments

Comments
 (0)