Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(router): profile based routes for payouts #5794

Merged
merged 26 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
44bea17
refactor(euclid): check the authenticity of profile_id being used
prajjwalkumar17 Aug 20, 2024
4126b0f
Merge branch 'main' into refactor_routing_dashboard_related_changes
prajjwalkumar17 Aug 20, 2024
373d1f7
clippy lints
prajjwalkumar17 Aug 20, 2024
3a8cad0
add new auth type
prajjwalkumar17 Aug 21, 2024
d5e455f
refactor the core changes for profile validation
prajjwalkumar17 Aug 21, 2024
eae4311
fix clippy lints
prajjwalkumar17 Aug 22, 2024
fd6d38f
Merge branch 'main' into refactor_routing_dashboard_related_changes
prajjwalkumar17 Aug 22, 2024
bea1f37
fix clippy lints
prajjwalkumar17 Aug 22, 2024
507d907
Merge branch 'refactor_routing_dashboard_related_changes' of https://…
prajjwalkumar17 Aug 22, 2024
9a7c069
address comments
prajjwalkumar17 Aug 29, 2024
2d0abbb
Merge branch 'main' into refactor_routing_dashboard_related_changes
prajjwalkumar17 Aug 29, 2024
ff08a76
chore: run formatter
hyperswitch-bot[bot] Aug 29, 2024
d372a86
fix clippy lints
prajjwalkumar17 Aug 29, 2024
898b631
Merge branch 'main' into refactor_routing_dashboard_related_changes
prajjwalkumar17 Aug 29, 2024
fb7f1b8
fix clippy lints
prajjwalkumar17 Aug 30, 2024
e4663f4
address comments
prajjwalkumar17 Sep 2, 2024
7534afb
address comments
prajjwalkumar17 Sep 2, 2024
d2251eb
chore: run formatter
hyperswitch-bot[bot] Sep 2, 2024
9428d44
Merge branch 'main' into refactor_routing_dashboard_related_changes
prajjwalkumar17 Sep 2, 2024
67529ff
fix clippy lints
prajjwalkumar17 Sep 2, 2024
c55f493
resolve conflicts
prajjwalkumar17 Sep 3, 2024
35f4351
resolve conflicts
prajjwalkumar17 Sep 3, 2024
8e3a940
refactor(router): profile based routes for routing and payouts
prajjwalkumar17 Sep 4, 2024
8037ad9
Merge branch 'main' into refactor_routing_dashboard_related_changes
prajjwalkumar17 Sep 4, 2024
d008cb9
chore: run formatter
hyperswitch-bot[bot] Sep 4, 2024
40319c3
refactor routes
prajjwalkumar17 Sep 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions crates/router/src/routes/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,13 +703,12 @@ impl Routing {
)
})),
)
.service(web::resource("/list/{profile_id}").route(web::get().to(
prajjwalkumar17 marked this conversation as resolved.
Show resolved Hide resolved
|state, req, path, query: web::Query<RoutingRetrieveQuery>| {
.service(web::resource("/list/profile").route(web::get().to(
|state, req, query: web::Query<RoutingRetrieveQuery>| {
routing::list_routing_configs_for_profile(
state,
req,
query,
path,
&TransactionType::Payment,
)
},
Expand Down Expand Up @@ -796,6 +795,16 @@ impl Routing {
)
})),
)
.service(web::resource("/payouts/list/profile").route(web::get().to(
|state, req, query: web::Query<RoutingRetrieveQuery>| {
routing::list_routing_configs_for_profile(
state,
req,
query,
&TransactionType::Payout,
)
},
)))
.service(web::resource("/payouts/active").route(web::get().to(
|state, req, query_params| {
routing::routing_retrieve_linked_config(
Expand Down
12 changes: 2 additions & 10 deletions crates/router/src/routes/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,9 @@ pub async fn list_routing_configs_for_profile(
state: web::Data<AppState>,
req: HttpRequest,
query: web::Query<RoutingRetrieveQuery>,
path: web::Path<common_utils::id_type::ProfileId>,
transaction_type: &enums::TransactionType,
) -> impl Responder {
let flow = Flow::RoutingRetrieveDictionary;
let path = path.into_inner();
Box::pin(oss_api::server_wrap(
flow,
state,
Expand All @@ -238,17 +236,11 @@ pub async fn list_routing_configs_for_profile(
#[cfg(not(feature = "release"))]
auth::auth_type(
&auth::HeaderAuth(auth::ApiKeyAuth),
&auth::JWTAuthProfileFromRoute {
profile_id: path,
required_permission: Permission::RoutingRead,
},
&auth::JWTAuth(Permission::RoutingRead),
req.headers(),
),
#[cfg(feature = "release")]
&auth::JWTAuthProfileFromRoute {
profile_id: path,
required_permission: Permission::RoutingRead,
},
&auth::JWTAuth(Permission::RoutingRead),
api_locking::LockAction::NotApplicable,
))
.await
Expand Down
Loading