Skip to content

Commit

Permalink
Update endpoint ids
Browse files Browse the repository at this point in the history
  • Loading branch information
augustuswm committed Mar 28, 2024
1 parent d9f44da commit a126fc8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions v-api/src/endpoints/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ mod macros {
/// Create a new link token for linking this provider to a different api user
#[endpoint {
method = POST,
path = "/api-user-provider/{identifier}/link-token",
path = "/api-user-provider/{provider_id}/link-token",
}]
pub async fn create_link_token(
rqctx: RequestContext<$context_type>,
Expand All @@ -267,7 +267,7 @@ mod macros {
/// Get user information for a given user id
#[endpoint {
method = GET,
path = "/api-user/{identifier}",
path = "/api-user/{user_id}",
}]
pub async fn get_api_user(
rqctx: RequestContext<$context_type>,
Expand All @@ -291,7 +291,7 @@ mod macros {
/// Update the permissions assigned to a given user
#[endpoint {
method = POST,
path = "/api-user/{identifier}",
path = "/api-user/{user_id}",
}]
pub async fn update_api_user(
rqctx: RequestContext<$context_type>,
Expand All @@ -304,7 +304,7 @@ mod macros {
/// List the active and expired API tokens for a given user
#[endpoint {
method = GET,
path = "/api-user/{identifier}/token",
path = "/api-user/{user_id}/token",
}]
pub async fn list_api_user_tokens(
rqctx: RequestContext<$context_type>,
Expand All @@ -317,7 +317,7 @@ mod macros {
// is the only time that the returned token will be accessible
#[endpoint {
method = POST,
path = "/api-user/{identifier}/token",
path = "/api-user/{user_id}/token",
}]
pub async fn create_api_user_token(
rqctx: RequestContext<$context_type>,
Expand All @@ -330,7 +330,7 @@ mod macros {
// Get details for a specific API token
#[endpoint {
method = GET,
path = "/api-user/{identifier}/token/{token_identifier}",
path = "/api-user/{user_id}/token/{api_key_id}",
}]
pub async fn get_api_user_token(
rqctx: RequestContext<$context_type>,
Expand All @@ -342,7 +342,7 @@ mod macros {
// Revoke a specific API token so it can no longer be used
#[endpoint {
method = DELETE,
path = "/api-user/{identifier}/token/{token_identifier}",
path = "/api-user/{user_id}/token/{api_key_id}",
}]
pub async fn delete_api_user_token(
rqctx: RequestContext<$context_type>,
Expand All @@ -353,7 +353,7 @@ mod macros {

#[endpoint {
method = POST,
path = "/api-user/{identifier}/group",
path = "/api-user/{user_id}/group",
}]
pub async fn add_api_user_to_group(
rqctx: RequestContext<$context_type>,
Expand All @@ -365,7 +365,7 @@ mod macros {

#[endpoint {
method = DELETE,
path = "/api-user/{identifier}/group/{group_id}",
path = "/api-user/{user_id}/group/{group_id}",
}]
pub async fn remove_api_user_from_group(
rqctx: RequestContext<$context_type>,
Expand All @@ -377,7 +377,7 @@ mod macros {
/// Link an existing login provider to this user
#[endpoint {
method = POST,
path = "/api-user/{identifier}/link",
path = "/api-user/{user_id}/link",
}]
pub async fn link_provider(
rqctx: RequestContext<$context_type>,
Expand Down Expand Up @@ -459,7 +459,7 @@ mod macros {

#[endpoint {
method = DELETE,
path = "/mapper/{identifier}",
path = "/mapper/{mapper_id}",
}]
pub async fn delete_mapper(
rqctx: RequestContext<$context_type>,
Expand Down
4 changes: 2 additions & 2 deletions v-api/src/endpoints/mappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ where

#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct MapperPath {
identifier: TypedUuid<MapperId>,
mapper_id: TypedUuid<MapperId>,
}

#[instrument(skip(rqctx), err(Debug))]
Expand All @@ -111,6 +111,6 @@ where
let caller = ctx.get_caller(auth.as_ref()).await?;

Ok(HttpResponseOk(
ctx.remove_mapper(&caller, &path.identifier).await?,
ctx.remove_mapper(&caller, &path.mapper_id).await?,
))
}

0 comments on commit a126fc8

Please sign in to comment.