From 5e0e14dd714ca58b0d384a47960951c32436bf09 Mon Sep 17 00:00:00 2001 From: Enrico Risa Date: Mon, 27 Jul 2026 09:17:24 +0200 Subject: [PATCH] chore: bump dsdk dep --- Cargo.lock | 133 +++++++++++++++++++++-- crates/jwtlet-core/src/resource/mod.rs | 3 + crates/jwtlet-server/src/assembly/mod.rs | 7 +- 3 files changed, 131 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8f69537..3500029 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1511,7 +1511,7 @@ checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "dsdk-facet-core" version = "0.0.1" -source = "git+https://github.com/eclipse-dataplane-core/dsdk-facet-rs?branch=main#81619d4a41f59948f72492ca4f72da6bb4db2ff1" +source = "git+https://github.com/eclipse-dataplane-core/dsdk-facet-rs?branch=main#201a5929a643145b146a8b375afa43c90c476c33" dependencies = [ "async-trait", "base64 0.22.1", @@ -1543,7 +1543,7 @@ dependencies = [ [[package]] name = "dsdk-facet-e2e-tests" version = "0.0.1" -source = "git+https://github.com/eclipse-dataplane-core/dsdk-facet-rs?branch=main#81619d4a41f59948f72492ca4f72da6bb4db2ff1" +source = "git+https://github.com/eclipse-dataplane-core/dsdk-facet-rs?branch=main#201a5929a643145b146a8b375afa43c90c476c33" dependencies = [ "anyhow", "base64 0.22.1", @@ -1560,7 +1560,7 @@ dependencies = [ [[package]] name = "dsdk-facet-hashicorp-vault" version = "0.0.1" -source = "git+https://github.com/eclipse-dataplane-core/dsdk-facet-rs?branch=main#81619d4a41f59948f72492ca4f72da6bb4db2ff1" +source = "git+https://github.com/eclipse-dataplane-core/dsdk-facet-rs?branch=main#201a5929a643145b146a8b375afa43c90c476c33" dependencies = [ "async-trait", "base64 0.22.1", @@ -1569,7 +1569,7 @@ dependencies = [ "chrono", "dsdk-facet-core", "log", - "notify", + "notify 8.2.0", "rand 0.9.4", "reqwest 0.12.28", "serde", @@ -1580,7 +1580,7 @@ dependencies = [ [[package]] name = "dsdk-facet-postgres" version = "0.0.1" -source = "git+https://github.com/eclipse-dataplane-core/dsdk-facet-rs?branch=main#81619d4a41f59948f72492ca4f72da6bb4db2ff1" +source = "git+https://github.com/eclipse-dataplane-core/dsdk-facet-rs?branch=main#201a5929a643145b146a8b375afa43c90c476c33" dependencies = [ "async-trait", "bon", @@ -1595,7 +1595,7 @@ dependencies = [ [[package]] name = "dsdk-facet-testcontainers" version = "0.0.1" -source = "git+https://github.com/eclipse-dataplane-core/dsdk-facet-rs?branch=main#81619d4a41f59948f72492ca4f72da6bb4db2ff1" +source = "git+https://github.com/eclipse-dataplane-core/dsdk-facet-rs?branch=main#201a5929a643145b146a8b375afa43c90c476c33" dependencies = [ "aws-config", "aws-sdk-s3", @@ -2681,6 +2681,17 @@ dependencies = [ "libc", ] +[[package]] +name = "inotify" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "533e68a5842e734946fe159fb03fc9bbbb254f590dd0d8ad321ae5ff7beca2c1" +dependencies = [ + "bitflags 2.11.1", + "inotify-sys", + "libc", +] + [[package]] name = "inotify-sys" version = "0.1.5" @@ -2816,7 +2827,7 @@ dependencies = [ "bon", "chrono", "dsdk-facet-core", - "notify", + "notify 6.1.1", "reqwest 0.12.28", "serde", "serde_json", @@ -3114,6 +3125,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" dependencies = [ "libc", + "log", "wasi", "windows-sys 0.61.2", ] @@ -3167,7 +3179,7 @@ dependencies = [ "crossbeam-channel", "filetime", "fsevent-sys", - "inotify", + "inotify 0.9.6", "kqueue", "libc", "log", @@ -3176,6 +3188,33 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "notify" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" +dependencies = [ + "bitflags 2.11.1", + "fsevent-sys", + "inotify 0.11.2", + "kqueue", + "libc", + "log", + "mio 1.2.0", + "notify-types", + "walkdir", + "windows-sys 0.60.2", +] + +[[package]] +name = "notify-types" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42b8cfee0e339a0337359f3c88165702ac6e600dc01c0cc9579a92d62b08477a" +dependencies = [ + "bitflags 2.11.1", +] + [[package]] name = "nu-ansi-term" version = "0.50.3" @@ -4005,7 +4044,7 @@ dependencies = [ "once_cell", "socket2 0.6.3", "tracing", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -6256,6 +6295,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + [[package]] name = "windows-sys" version = "0.61.2" @@ -6289,13 +6337,30 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -6308,6 +6373,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -6320,6 +6391,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -6332,12 +6409,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -6350,6 +6439,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -6362,6 +6457,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -6374,6 +6475,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -6386,6 +6493,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + [[package]] name = "winnow" version = "0.7.15" diff --git a/crates/jwtlet-core/src/resource/mod.rs b/crates/jwtlet-core/src/resource/mod.rs index 902d331..42af677 100644 --- a/crates/jwtlet-core/src/resource/mod.rs +++ b/crates/jwtlet-core/src/resource/mod.rs @@ -94,6 +94,7 @@ pub struct ScopeMapping { pub claims: Map, } +#[derive(Debug)] pub struct MappingPair { pub resource_mapping: ResourceMapping, pub scope_mappings: HashMap, @@ -104,6 +105,7 @@ pub struct ResourceService { store: Arc, } +#[derive(Debug)] pub struct VerificationResult { pub verified: bool, pub claims: HashMap, @@ -129,6 +131,7 @@ impl ResourceService { audiences: HashSet::new(), }); }; + if !scopes.iter().all(|s| pair.resource_mapping.scopes.contains(s)) { return Ok(VerificationResult { verified: false, diff --git a/crates/jwtlet-server/src/assembly/mod.rs b/crates/jwtlet-server/src/assembly/mod.rs index 908c6cb..13c39d4 100644 --- a/crates/jwtlet-server/src/assembly/mod.rs +++ b/crates/jwtlet-server/src/assembly/mod.rs @@ -12,8 +12,10 @@ use crate::config::{JwtletConfig, K8sConfig, PostgresPoolConfig, StorageBackend, VaultConfig}; use crate::meta::AuthorizationServerMetadata; +use dsdk_facet_core::context::ParticipantContext; use dsdk_facet_core::jwt::{ - JwkSetProvider, JwtGenerator, JwtVerifier, VaultJwtGenerator, VaultVerificationKeyResolver, + JwkSetProvider, JwtGenerator, JwtVerifier, PrefixTransitKeyResolver, VaultJwtGenerator, + VaultVerificationKeyResolver, }; use dsdk_facet_core::vault::VaultSigningClient; use dsdk_facet_hashicorp_vault::{HashicorpVaultClient, HashicorpVaultConfig, VaultAuthConfig}; @@ -300,6 +302,7 @@ async fn create_key_resolver( ) -> Result, JwtletError> { let resolver = VaultVerificationKeyResolver::builder() .vault_client(vault_client) + .signing_context(ParticipantContext::builder().id("jwtlet").build()) .build(); resolver.initialize().await.map_err(JwtletError::Verifier)?; Ok(Arc::new(resolver)) @@ -309,7 +312,7 @@ fn create_jwt_generator(vault_client: Arc, prefix: &str) Box::new( VaultJwtGenerator::builder() .signing_client(vault_client) - .key_name_prefix(prefix) + .key_resolver(Arc::new(PrefixTransitKeyResolver::builder().prefix(prefix).build())) .build(), ) }