Skip to content

Commit db30a44

Browse files
authored
Fix linter errors: derive Default for AuthZBackend and OpenFGAAuth (lakekeeper#1476)
1 parent 7d4c7d7 commit db30a44

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

crates/authz-openfga/src/config.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ pub struct OpenFGAConfig {
8282
pub max_batch_check_size: usize,
8383
}
8484

85-
#[derive(Clone, Serialize, Deserialize, PartialEq, veil::Redact)]
85+
#[derive(Clone, Default, Serialize, Deserialize, PartialEq, veil::Redact)]
8686
#[serde(rename_all = "snake_case")]
8787
pub enum OpenFGAAuth {
88+
#[default]
8889
Anonymous,
8990
ClientCredentials {
9091
client_id: String,
@@ -97,12 +98,6 @@ pub enum OpenFGAAuth {
9798
ApiKey(String),
9899
}
99100

100-
impl Default for OpenFGAAuth {
101-
fn default() -> Self {
102-
Self::Anonymous
103-
}
104-
}
105-
106101
fn deserialize_openfga_config<'de, D>(deserializer: D) -> Result<Option<OpenFGAConfig>, D::Error>
107102
where
108103
D: Deserializer<'de>,

crates/lakekeeper/src/config.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,9 @@ where
369369
.serialize(serializer)
370370
}
371371

372-
#[derive(Debug, Clone, PartialEq)]
372+
#[derive(Debug, Default, Clone, PartialEq)]
373373
pub enum AuthZBackend {
374+
#[default]
374375
AllowAll,
375376
External(String),
376377
}
@@ -403,12 +404,6 @@ impl Serialize for AuthZBackend {
403404
}
404405
}
405406

406-
impl Default for AuthZBackend {
407-
fn default() -> Self {
408-
Self::AllowAll
409-
}
410-
}
411-
412407
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
413408
pub enum SecretBackend {
414409
#[serde(alias = "kv2", alias = "Kv2")]

0 commit comments

Comments
 (0)