Skip to content

Commit 70cf14a

Browse files
committed
Merge branch 'PVW-5181-tsl-uri' into 'main'
Change sub to Url and make it consistent with StatusListClaim See merge request wallet/nl-wallet!2513
2 parents 87537b7 + 89ca6ac commit 70cf14a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

wallet_core/lib/token_status_list/src/status_list_token.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ use serde::Deserialize;
1010
use serde::Serialize;
1111
use serde_with::DurationSeconds;
1212
use serde_with::serde_as;
13+
use url::Url;
1314

1415
use crypto::EcdsaKey;
1516
use crypto::server_keys::KeyPair;
16-
use http_utils::urls::HttpsUri;
1717
use jwt::JwtTyp;
1818
use jwt::SignedJwt;
1919
use jwt::UnverifiedJwt;
@@ -32,7 +32,7 @@ pub static TOKEN_STATUS_LIST_JWT_TYP: &str = "statuslist+jwt";
3232
pub struct StatusListToken(UnverifiedJwt<StatusListClaims, HeaderWithX5c>);
3333

3434
impl StatusListToken {
35-
pub fn builder(sub: HttpsUri, status_list: PackedStatusList) -> StatusListTokenBuilder {
35+
pub fn builder(sub: Url, status_list: PackedStatusList) -> StatusListTokenBuilder {
3636
StatusListTokenBuilder {
3737
exp: None,
3838
sub,
@@ -44,7 +44,7 @@ impl StatusListToken {
4444

4545
pub struct StatusListTokenBuilder {
4646
exp: Option<DateTime<Utc>>,
47-
sub: HttpsUri,
47+
sub: Url,
4848
ttl: Option<Duration>,
4949
status_list: PackedStatusList,
5050
}
@@ -86,7 +86,7 @@ pub struct StatusListClaims {
8686

8787
/// The sub (subject) claim MUST specify the URI of the Status List Token. The value MUST be equal to that of the
8888
/// `uri` claim contained in the `status_list` claim of the Referenced Token
89-
pub sub: HttpsUri,
89+
pub sub: Url,
9090

9191
/// If present, MUST specify the maximum amount of time, in seconds, that the Status List Token can be cached by a
9292
/// consumer before a fresh copy SHOULD be retrieved.

wallet_core/wallet_server/status_lists/src/postgres.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ use crypto::EcdsaKeySend;
3737
use crypto::server_keys::KeyPair;
3838
use http_utils::urls::BaseUrl;
3939
use http_utils::urls::BaseUrlError;
40-
use http_utils::urls::HttpsUri;
4140
use http_utils::urls::HttpsUriError;
4241
use jwt::UnverifiedJwt;
4342
use jwt::error::JwtError;
@@ -624,7 +623,7 @@ where
624623
}
625624

626625
async fn publish_new_status_list(&self, external_id: &str) -> Result<(), StatusListServiceError> {
627-
let sub = HttpsUri::try_new(self.base_url.join(external_id).to_string())?;
626+
let sub = self.base_url.join(external_id);
628627
let jwt: UnverifiedJwt<StatusListClaims, HeaderWithX5c<HeaderWithTyp>> =
629628
StatusListToken::builder(sub, StatusList::new(self.list_size.as_usize()).pack())
630629
.sign(&self.key_pair)

0 commit comments

Comments
 (0)