Skip to content

Commit

Permalink
feat: add the Role enum
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Nov 15, 2023
1 parent 7ed2aa0 commit 0c3bd1a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion csaf/src/model/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,21 @@ pub struct ProviderMetadata {

pub publisher: Publisher,

pub role: String,
/// Contains the role of the issuing party according to section 7 in the CSAF standard.
#[serde(default = "default_role")]
pub role: Role,
}

const fn default_role() -> Role {
Role::Provider
}

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, serde::Deserialize, serde::Serialize)]
pub enum Role {
#[serde(rename = "csaf_publisher")]
Publisher,
#[serde(rename = "csaf_provider")]
Provider,
#[serde(rename = "csaf_trusted_provider")]
TrustedProvider,
}

0 comments on commit 0c3bd1a

Please sign in to comment.