Skip to content

Commit

Permalink
Add 'credential_types' field to payload.
Browse files Browse the repository at this point in the history
  • Loading branch information
PopcornPaws committed May 15, 2024
1 parent 8412678 commit 5abd4c6
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 @@ -115,6 +115,7 @@ impl Session {
"action": action,
"action_description": action_description,
"signal": format!("0x{:x}", encode_signal(&signal)),
"credential_types": verification_level.to_credential_types(),
"verification_level": verification_level.to_string(),
}),
)?)
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 {
}
}

Check failure on line 35 in src/session/types.rs

View workflow job for this annotation

GitHub Actions / Rust project

Diff in /home/runner/work/idkit-rs/idkit-rs/src/session/types.rs

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 5abd4c6

Please sign in to comment.