diff --git a/libs/client/src/lib.rs b/libs/client/src/lib.rs index 57ca90dac..878e2b3f0 100644 --- a/libs/client/src/lib.rs +++ b/libs/client/src/lib.rs @@ -1665,7 +1665,7 @@ impl KanidmClient { ) -> Result { if let Some(ttl) = ttl { self.perform_get_request(&format!( - "/v1/person/{}/_credential/_update_intent?ttl={}", + "/v1/person/{}/_credential/_update_intent/{}", id, ttl )) .await diff --git a/server/core/src/https/v1.rs b/server/core/src/https/v1.rs index c37da7bdc..08f5791aa 100644 --- a/server/core/src/https/v1.rs +++ b/server/core/src/https/v1.rs @@ -1,6 +1,6 @@ //! The V1 API things! -use axum::extract::{Path, Query, State}; +use axum::extract::{Path, State}; use axum::http::{HeaderMap, HeaderValue}; use axum::middleware::from_fn; use axum::response::{IntoResponse, Response}; @@ -1108,7 +1108,7 @@ pub async fn person_id_credential_update_get( #[utoipa::path( get, - path = "/v1/person/{id}/_credential/_update_intent/?ttl={ttl}", + path = "/v1/person/{id}/_credential/_update_intent/{ttl}", params( ("ttl" = u64, description="The new TTL for the credential?") ), @@ -1125,8 +1125,7 @@ pub async fn person_id_credential_update_intent_ttl_get( State(state): State, Extension(kopid): Extension, VerifiedClientInformation(client_auth_info): VerifiedClientInformation, - Path(id): Path, - Query(ttl): Query, + Path((id, ttl)): Path<(String, u64)>, ) -> Result, WebError> { state .qe_w_ref @@ -2937,7 +2936,7 @@ pub(crate) fn route_setup(state: ServerState) -> Router { get(person_id_credential_update_get), ) .route( - "/v1/person/:id/_credential/_update_intent/:ttl", // TODO: I'm pretty sure this route is wrong, because we match the query not the path + "/v1/person/:id/_credential/_update_intent/:ttl", get(person_id_credential_update_intent_ttl_get), ) .route(