Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove vp and vc from JWT claims in JOSE #1233

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading