Skip to content

Commit

Permalink
Types: extend extra_params to Value
Browse files Browse the repository at this point in the history
serde_json::Value is a flexible structure that could be a string and
even a nested map. This helps us to give more structured context of the
message.

confidential-containers/trustee#242 is an
example issue

Signed-off-by: Xynnn007 <[email protected]>
  • Loading branch information
Xynnn007 committed Jun 4, 2024
1 parent 9a4ff50 commit f8025a8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ extern crate alloc;

#[cfg(all(feature = "alloc", not(feature = "std")))]
use alloc::string::String;
use serde_json::Value;
#[cfg(feature = "std")]
use std::string::String;

Expand Down Expand Up @@ -45,14 +46,14 @@ pub struct Request {
pub version: String,
pub tee: Tee,
#[serde(rename = "extra-params")]
pub extra_params: String,
pub extra_params: Value,
}

#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct Challenge {
pub nonce: String,
#[serde(rename = "extra-params")]
pub extra_params: String,
pub extra_params: Value,
}

#[derive(Clone, Serialize, Deserialize, Debug)]
Expand All @@ -70,7 +71,7 @@ pub struct Attestation {
#[serde(rename = "tee-pubkey")]
pub tee_pubkey: TeePubKey,
#[serde(rename = "tee-evidence")]
pub tee_evidence: String,
pub tee_evidence: Value,
}

#[derive(Clone, Serialize, Deserialize, Debug)]
Expand Down

0 comments on commit f8025a8

Please sign in to comment.