juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
12.64k stars 1.36k forks source link

feat: add resources and granular permission groups for reconciliation #6591

Open kashif-m opened 1 week ago

kashif-m commented 1 week ago

Type of Change

Description

Described in #6524

This PR includes below changes

Additional Changes

Motivation and Context

Helps maintain and configure permissions for recon module granularly.

How did you test it?

Check /verify_token response cURL curl --location --request GET 'http://localhost:8080/recon/verify_token' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiZGJjMzJmMmYtYmI5Ni00MDI0LTliYTUtNjhkOTc3MzM0N2U5IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzMxOTk2NjQ4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjE4MzU4Miwib3JnX2lkIjoib3JnX0htMmY5dERZM2lGN0ZRckZUYUxKIiwicHJvZmlsZV9pZCI6InByb19GY0NaN1c4MllZVmNXMU1DSjZIOCIsInRlbmFudF9pZCI6InB1YmxpYyIsImFjbCI6IntcInJlY29uX2ZpbGVzXCI6XCJSV1wiLFwicmVjb25fY29uZmlnXCI6XCJSV1wiLFwicmVjb25fdG9rZW5cIjpcIlJXXCIsXCJyZWNvbl9yZXBvcnRzXCI6XCJSV1wiLFwicmVjb25fdXBsb2FkXCI6XCJSV1wiLFwicnVuX3JlY29uXCI6XCJSV1wiLFwicmVjb25fYW5kX3NldHRsZW1lbnRfYW5hbHl0aWNzXCI6XCJSXCJ9In0.wvS97F0dXwY7Y5uKSk8PEqHOhoAAPlR0coX_kIGyM2I' Response { "merchant_id": "merchant_1731996648", "user_email": "kashif2@juspay.in", "acl": "{\"recon_reports\":\"RW\",\"recon_files\":\"RW\",\"run_recon\":\"RW\",\"recon_and_settlement_analytics\":\"R\",\"recon_token\":\"RW\",\"recon_upload\":\"RW\",\"recon_config\":\"RW\"}" }

Checklist

semanticdiff-com[bot] commented 1 week ago

Review changes with  SemanticDiff

Changed Files
| File | Status | | :--- | :--- | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/routes/app.rs)  [crates/router/src/routes/app\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/routes/app.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/routes/app.rs)  96% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/core/recon.rs)  [crates/router/src/core/recon\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/core/recon.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/core/recon.rs)  76% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/info.rs)  [crates/router/src/services/authorization/info\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/info.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/info.rs)  42% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/permission_groups.rs)  [crates/router/src/services/authorization/permission\_groups\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/permission_groups.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/permission_groups.rs)  37% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/events/recon.rs)  [crates/api\_models/src/events/recon\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/events/recon.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/events/recon.rs)  32% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/common_enums/src/enums.rs)  [crates/common\_enums/src/enums\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/common_enums/src/enums.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/common_enums/src/enums.rs)  19% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/roles/predefined_roles.rs)  [crates/router/src/services/authorization/roles/predefined\_roles\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/roles/predefined_roles.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/roles/predefined_roles.rs)  18% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/permissions.rs)  [crates/router/src/services/authorization/permissions\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/permissions.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/permissions.rs)  16% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/routes/recon.rs)  [crates/router/src/routes/recon\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/routes/recon.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/routes/recon.rs)  10% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/recon.rs)  [crates/api\_models/src/recon\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/recon.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/recon.rs)  4% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/enums.rs)  [crates/api\_models/src/enums\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/enums.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/enums.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/events/user.rs)  [crates/api\_models/src/events/user\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/events/user.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/events/user.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/user.rs)  [crates/api\_models/src/user\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/user.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/api_models/src/user.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/core/user.rs)  [crates/router/src/core/user\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/core/user.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/core/user.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/routes/user.rs)  [crates/router/src/routes/user\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/routes/user.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/routes/user.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authentication.rs)  [crates/router/src/services/authentication\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authentication.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authentication.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/roles.rs)  [crates/router/src/services/authorization/roles\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/roles.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/authorization/roles.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/email/types.rs)  [crates/router/src/services/email/types\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/email/types.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6591/changes#crates/router/src/services/email/types.rs)  0% smaller |
ThisIsMani commented 5 days ago

Other than that, LGTM.