-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(auth): Add Authorization for JWT Authentication types #2973
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ThisIsMani
added
A-framework
Area: Framework
C-feature
Category: Feature request or enhancement
S-waiting-on-review
Status: This PR has been implemented and needs to be reviewed
labels
Nov 24, 2023
ThisIsMani
changed the title
feat(auth): Add Authorization in JWT Authentication types
feat(auth): Add Authorization for JWT Authentication types
Nov 24, 2023
racnan
previously approved these changes
Nov 24, 2023
apoorvdixit88
approved these changes
Nov 24, 2023
racnan
approved these changes
Nov 24, 2023
Narayanbhat166
approved these changes
Nov 24, 2023
prajjwalkumar17
approved these changes
Nov 24, 2023
SanchithHegde
removed
the
S-waiting-on-review
Status: This PR has been implemented and needs to be reviewed
label
Nov 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This PR adds required permissions for all APIs using JWT related auth types and a permission module which can be used to control the permissions.
Additional Changes
Motivation and Context
To support user roles and permissions.
How did you test it?
Postman.
The following APIs now use authorization (These routes cannot be called without having required permissions in the JWT Token).
Analytics
a. Get Payment Metrics:
/analytics/v1/metrics/payments
b. Get Refund Metrics:
/analytics/v1/metrics/refunds
c. Get Payment Filters:
/analytics/v1/filters/payments
d. Get Refund Filters:
/analytics/v1/filters/payments
Admin
a. Merchant Account - Retrieve:
/accounts/{id}
b. Merchant Account - Update:
/accounts/{id}
c. Payment Connector - Create:
/account/{merchant_id}/connectors
d. Payment Connector - Retrieve:
/account/{merchant_id}/connectors/{mca_id}
e. Payment Connector - List (By MID):
/account/{merchant_id}/connectors
f. Payment Connector - Delete:
/account/{merchant_id}/connectors/{mca_id}
g. Business Profile - Create:
/account/{merchant_id}/business_profile
h. Business Profile - Retrieve:
/account/{merchant_id}/business_profile/profile_id}
i. Business Profile - Update:
/account/{merchant_id}/business_profile/{profile_id}
j. Business Profile - List (By MID):
/account/{merchant_id}/business_profile
API Keys
a. API Key - Create:
/api_keys/{merchant_id}
b. Api Key - Retrieve:
/api_keys/{merchant_id}/{key_id}
c. API Key - Revoke:
/api_keys/{merchant_id}/{key_id}
d. API Key - List:
/api_keys/{merchant_id}/list
Disputes
a. Dispute - Retrieve:
/disputes/{dispute_id}
b. Dispute - List:
/disputes/list
c. Dispute - Accept:
/disputes/accept/{dispute_id}
d. Dispute - Submit Evidence:
/disputes/evidence
e. Dispute - Attach Evidence:
/disputes/evidence
f. Dispute - Retrieve Evidence:
/disputes/evidence/{dispute_id}
Files
a. Files - Create:
/files
b. Files - Delete:
/files/{file_id}
c. Files - Retrieve:
/files/{file_id}
Mandates
a. Mandates - List:
/mandates/list
Payments
a. Payments - Create:
/payments
b. Payments - Retrieve:
/payments/{payment_id}
c. Payments - List:
/payments/list
d. Payments - List by Filter:
/payments/list
e. Payments - Get Filters:
/payments/filter
Refunds
a. Refunds - Create:
/refunds
b. Refunds - Retrieve:
/refunds/{id}
c. Refunds - List:
/refunds/list
d. Refunds - Filter List:
/refunds/filter
Routing
a. Routing - Create Config:
/routing
b. Routing - Link Config:
/routing/{alg_id}/activate
c. Routing - Retrieve Config:
/routing/{alg_id}
d. Routing - Retrieve Dictionary:
/routing
e. Routing - Unlink Config:
/routing/deactivate
f. Routing - Update Default Config:
/routing/default
g. Routing - Retrieve Default Config:
/routing/default
h. Routing - Upsert Surcharge Decision Manager Config:
/routing/decision/surcharge
i. Routing - Delete Surcharge Decision Manager Config:
/routing/decision/surcharge
j. Routing - Retrieve Surcharge Decision Manager Config:
/routing/decision/surcharge
k. Routing - Upsert Decision Manager Config:
/routing/decision
l. Routing - Delete Decision Manager Config:
/routing/decision
m. Routing - Retrieve Decision Manager Config:
/routing/decision
n. Routing - Retrieve Linked Config:
/routing/active
o. Routing - Retrieve Default Config For Profiles:
/routing/default/profile
p. Routing - Update Default Config For Profile:
/routing/default/profile/{profile_id}
Apple Pay - Merchant Registration:
/verify/apple_pay/{merchant_id}
Retrieve Apple Pay Verified Domains:
/verify/applepay/verified_domains
Removed JWT Authentication from the following APIs
/payment_link/list
Checklist
cargo +nightly fmt --all
cargo clippy