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(auth): Pass profile_id from the auth to core functions #5520

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

ThisIsMani
Copy link
Contributor

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Use the profile_id from the authentication data and pass it to core functions.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Closes #5491

How did you test it?

Using local dashboard.
All the payment, disputes, payouts and refund APIs should work without any authentication error.

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@ThisIsMani ThisIsMani added A-core Area: Core flows S-waiting-on-review Status: This PR has been implemented and needs to be reviewed C-refactor Category: Refactor labels Aug 5, 2024
@ThisIsMani ThisIsMani self-assigned this Aug 5, 2024
@ThisIsMani ThisIsMani requested review from a team as code owners August 5, 2024 07:18
hrithikesh026
hrithikesh026 previously approved these changes Aug 5, 2024
apoorvdixit88
apoorvdixit88 previously approved these changes Aug 5, 2024
auth.clone(),
AuthenticationType::MerchantJwt {
merchant_id: auth.merchant_account.get_id().clone(),
user_id: None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt be None

&state.store().get_master_key().to_vec().into(),
)
.await
.change_context(errors::ApiErrorResponse::InvalidJwtToken)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

500 is not handled.

@ThisIsMani ThisIsMani dismissed stale reviews from apoorvdixit88 and hrithikesh026 via d458842 August 5, 2024 09:29
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Aug 5, 2024
Merged via the queue into main with commit 53b5551 Aug 5, 2024
14 checks passed
@Gnanasundari24 Gnanasundari24 deleted the jwt-merchant-from-route-auth-data branch August 5, 2024 11:37
pixincreate added a commit that referenced this pull request Aug 5, 2024
* 'main' of github.com:juspay/hyperswitch: (37 commits)
  fix(connector): Fixed status mapping for Plaid (#5525)
  feat(core): accept profile_id in merchant_account, connectors and customers core functions (#5505)
  refactor(auth): Pass `profile_id` from the auth to core functions (#5520)
  refactor(routing): Refactor api v2 routes for deactivating and retrieving the routing config (#5478)
  refactor(cypress): pass `connector_type` externally (#5522)
  refactor(router): refactor merchant_connector update v2 flow (#5484)
  feat(router): add accept language header middleware  (#5500)
  chore(version): 2024.08.05.0
  chore(postman): update Postman collection files
  fix(pm_auth): Added mca status check in pml (#5421)
  refactor(payment_methods): List the Payment Methods for Merchant , based on the connector  type (#4909)
  fix(router): [Iatapay] make error status and error message optional (#5382)
  chore(version): 2024.08.02.0
  feat(business_profile): introduce domain models for business profile v1 and v2 APIs (#5497)
  feat(auth): Add `profile_id` in `AuthenticationData` (#5492)
  feat(core): accept business profile in core functions for payments, refund, payout and disputes (#5498)
  refactor(router): domain and diesel model changes for merchant_connector_account create v2 flow (#5462)
  fix(open_payment_links): send displaySavedPaymentMethods as false explicitly for open payment links (#5501)
  refactor(role): determine level of role entity (#5488)
  feat(cypress): add corner cases (#5481)
  ...
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows C-refactor Category: Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(auth): Support profile level authentication
7 participants