Skip to content

Commit

Permalink
Add credential_types field to payload
Browse files Browse the repository at this point in the history
Co-authored-by: Miguel Piedrafita <[email protected]>
  • Loading branch information
PopcornPaws and m1guelpf authored Jul 22, 2024
1 parent 2615d3f commit 4f2489e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "idkit"
edition = "2021"
license = "MIT"
version = "0.1.0"
version = "0.1.1"
readme = "README.md"
authors = ["Miguel Piedrafita <[email protected]>"]
repository = "https://github.com/worldcoin/idkit-rs"
Expand Down
1 change: 1 addition & 0 deletions src/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ impl Session {
"action_description": action_description,
"signal": format!("0x{:x}", encode_signal(&signal)),
"verification_level": verification_level.to_string(),
"credential_types": verification_level.to_credential_types(),
}),
)?)
.send()
Expand Down
10 changes: 10 additions & 0 deletions src/session/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ impl Display for VerificationLevel {
}
}

impl VerificationLevel {
#[must_use]
pub fn to_credential_types(&self) -> Vec<CredentialType> {
match self {
Self::Orb => vec![CredentialType::Orb],
Self::Device => vec![CredentialType::Orb, CredentialType::Device],
}
}
}

/// The error returned by the World App.
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Deserialize, thiserror::Error)]
#[serde(rename_all = "snake_case")]
Expand Down

0 comments on commit 4f2489e

Please sign in to comment.