Skip to content

Commit

Permalink
remove vp and vc from JWT claims in JOSE (#1233)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulmth authored Sep 13, 2023
1 parent 54a86cf commit 94397e8
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions identity_jose/src/jwt/claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// SPDX-License-Identifier: Apache-2.0

use identity_core::common::OneOrMany;
use serde_json::Map;
use serde_json::Value;

/// JSON Web Token Claims
///
Expand Down Expand Up @@ -47,16 +45,6 @@ pub struct JwtClaims<T = ()> {
/// [More Info](https://tools.ietf.org/html/rfc7519#section-4.1.7)
#[serde(skip_serializing_if = "Option::is_none")]
jti: Option<String>, // JWT ID
/// Contains the properties of a Verifiable Credential
///
/// [More Info](https://w3c.github.io/vc-data-model/#json-web-token)
#[serde(skip_serializing_if = "Option::is_none")]
vc: Option<Map<String, Value>>, // Verifiable Credential
/// Contains the properties of a Verifiable Presentation
///
/// [More Info](https://w3c.github.io/vc-data-model/#json-web-token)
#[serde(skip_serializing_if = "Option::is_none")]
vp: Option<Map<String, Value>>, // Verifiable Presentation
/// Public/Private Claim Names
///
/// [More Info](https://tools.ietf.org/html/rfc7519#section-4.2)
Expand All @@ -75,8 +63,6 @@ impl<T> JwtClaims<T> {
nbf: None,
iat: None,
jti: None,
vc: None,
vp: None,
custom: None,
}
}
Expand Down Expand Up @@ -151,26 +137,6 @@ impl<T> JwtClaims<T> {
self.jti = Some(value.into());
}

/// Returns the value for the JWT verifiable credential claim (vc).
pub fn vc(&self) -> Option<&Map<String, Value>> {
self.vc.as_ref()
}

/// Sets a value for the JWT verifiable credential claim (vc).
pub fn set_vc(&mut self, value: impl Into<Map<String, Value>>) {
self.vc = Some(value.into());
}

/// Returns the value for the JWT verifiable presentation claim (vp).
pub fn vp(&self) -> Option<&Map<String, Value>> {
self.vp.as_ref()
}

/// Sets a value for the JWT verifiable presentation claim (vp).
pub fn set_vp(&mut self, value: impl Into<Map<String, Value>>) {
self.vp = Some(value.into());
}

/// Returns a reference to the custom JWT claims.
pub fn custom(&self) -> Option<&T> {
self.custom.as_ref()
Expand Down

0 comments on commit 94397e8

Please sign in to comment.