Skip to content

Commit

Permalink
WIP: get tee-pubkey from ITA token
Browse files Browse the repository at this point in the history
Signed-off-by: Mikko Ylinen <[email protected]>
  • Loading branch information
mythi committed Jun 13, 2024
1 parent 65ea109 commit 7a3e149
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions kbs/src/api/src/http/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,13 @@ pub(crate) async fn get_resource(
})?;

let pkey_value = claims
.get("customized_claims")
.get("attester_runtime_data")
.ok_or(Error::AttestationClaimsParseFailed(String::from(
"No `customized_claims` in the attestation claims thus no `tee-pubkey`",
"No `attester_runtime_data` in the attestation claims thus no `tee-pubkey`",
)))?
.as_object()
.ok_or(Error::AttestationClaimsParseFailed(String::from(
"`customized_claims` should be a JSON map",
)))?
.get("runtime_data")
.ok_or(Error::AttestationClaimsParseFailed(String::from(
"No `runtime_data` in the attestation claims thus no `tee-pubkey`",
)))?
.as_object()
.ok_or(Error::AttestationClaimsParseFailed(String::from(
"`runtime_data` should be a JSON map",
"`attester_runtime_data` should be a JSON map",
)))?
.get("tee-pubkey")
.ok_or(Error::AttestationClaimsParseFailed(String::from(
Expand Down

0 comments on commit 7a3e149

Please sign in to comment.