From 98519535815bc540f485b902414c8297af64ba6e Mon Sep 17 00:00:00 2001 From: Samuel Gomez Date: Mon, 6 May 2024 17:44:18 +0100 Subject: [PATCH] Moving connection model definition test to proper place --- api/src/routes/protected.rs | 10 +++++++--- api/src/routes/public.rs | 7 +------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/api/src/routes/protected.rs b/api/src/routes/protected.rs index c1dfc7db..ed03e801 100644 --- a/api/src/routes/protected.rs +++ b/api/src/routes/protected.rs @@ -1,7 +1,7 @@ use crate::{ endpoints::{ - connection, event_access, events, metrics, oauth, passthrough, pipeline, transactions, - unified, + connection, connection_model_definition::test_connection_model_definition, event_access, + events, metrics, oauth, passthrough, pipeline, transactions, unified, }, middleware::{ auth, @@ -10,7 +10,7 @@ use crate::{ }, server::AppState, }; -use axum::{error_handling::HandleErrorLayer, middleware::from_fn_with_state, Router}; +use axum::{error_handling::HandleErrorLayer, middleware::from_fn_with_state, routing::post, Router}; use http::HeaderName; use std::{iter::once, sync::Arc}; use tower::{filter::FilterLayer, ServiceBuilder}; @@ -25,6 +25,10 @@ pub async fn get_router(state: &Arc) -> Router> { .nest("/connections", connection::get_router()) .nest("/event-access", event_access::get_router()) .nest("/passthrough", passthrough::get_router()) + .route( + "/connection-model-definitions/test/:id", + post(test_connection_model_definition), + ) .nest("/oauth", oauth::get_router()) .nest("/unified", unified::get_router()) .layer(TraceLayer::new_for_http()) diff --git a/api/src/routes/public.rs b/api/src/routes/public.rs index 4ce9efe9..f94ff2e7 100644 --- a/api/src/routes/public.rs +++ b/api/src/routes/public.rs @@ -1,7 +1,6 @@ use crate::{ endpoints::{ - connection_definition, connection_model_definition::test_connection_model_definition, - connection_model_schema, connection_oauth_definition, + connection_definition, connection_model_schema, connection_oauth_definition, event_access::create_event_access_for_new_user, openapi, read_cached, }, middleware::jwt_auth::{self, JwtState}, @@ -25,10 +24,6 @@ pub fn get_router(state: &Arc) -> Router> { jwt_auth::jwt_auth, )), ) - .route( - "/connection-model-definitions/test/:id", - post(test_connection_model_definition), - ) .route( "/connection-definitions", get(read_cached::),