Skip to content
New issue

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

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

Already on GitHub? # to your account

refactor(business_profile): use concrete types for JSON fields #5531

Merged
merged 11 commits into from
Aug 7, 2024

Conversation

SanchithHegde
Copy link
Member

@SanchithHegde SanchithHegde commented Aug 5, 2024

Type of Change

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

Description

This PR involves using concrete types for the webhook_details, payment_link_config and payout_link_config fields in the business profile v1 domain and diesel models instead of serde_json::Value. As part of this change, the webhook_details within the merchant account domain and diesel models had to be updated as well.

Motivation and Context

This serves two purposes, to prevent sensitive information from possibly being logged, and to reduce the overall number of changes involved in the migration towards business profile v2 APIs.

How did you test it?

Sanity testing with Postman, ensuring that nothing around the merchant account or business profile APIs is broken.

In addition, I've confirmed from the logs that the affected fields (for example, webhook_details) are not being logged in plaintext in INSERT / UPDATE database queries.

Screenshot of webhook_details being masked (specifically, password and URL fields) during business profile insert operation:

Screenshot of webhook_details being masked

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

…fig` and `payout_link_config` fields within `Secret` in diesel and domain models

This also requires the `webhook_details` field in merchant account to be wrapped within `Secret`.
…ation_connector_details` in v2 diesel and domain models
@SanchithHegde SanchithHegde added A-framework Area: Framework S-waiting-on-review Status: This PR has been implemented and needs to be reviewed C-refactor Category: Refactor api-v2 labels Aug 5, 2024
@SanchithHegde SanchithHegde added this to the August 2024 Release milestone Aug 5, 2024
@SanchithHegde SanchithHegde self-assigned this Aug 5, 2024
@SanchithHegde SanchithHegde requested review from a team as code owners August 5, 2024 21:47
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Aug 5, 2024
Narayanbhat166
Narayanbhat166 previously approved these changes Aug 6, 2024
…ead of `serde_json::Value` for `authentication_connector_details` in diesel and domain models
…on::Value` for `webhook_details` in diesel and domain models
…nessPayoutLinkConfig` instead of `serde_json::Value` in diesel and domain models
@SanchithHegde SanchithHegde changed the title refactor(business_profile): wrap some JSON fields within Secret refactor(business_profile): use concrete types for JSON fields Aug 6, 2024
@SanchithHegde SanchithHegde force-pushed the business-profile-secret-json-fields branch from 7f36de0 to 752ed4a Compare August 6, 2024 22:28
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Aug 7, 2024
Merged via the queue into main with commit a8ba21c Aug 7, 2024
21 of 22 checks passed
@Gnanasundari24 Gnanasundari24 deleted the business-profile-secret-json-fields branch August 7, 2024 08:51
@pixincreate pixincreate removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Aug 7, 2024
pixincreate added a commit that referenced this pull request Aug 7, 2024
…e-connector-label-cypress

* 'main' of github.com:juspay/hyperswitch:
  feat(core): add support for payment links localization (#5530)
  refactor(router): refactor `merchant_connector_account` retrieve and delete v2 apis (#5528)
  feat(cypress): add core flow tests (#5546)
  feat(cypress): add mandates and refunds variation cases (#5513)
  feat(cypress): add configs for not overriding screenshots (#5524)
  refactor(business_profile): use concrete types for JSON fields (#5531)
  feat(customer_v2):  add customer create v2 endpoint  (#5444)
  refactor(connector): added amount conversion framework for Mifinity (#5460)
  refactor(connector): added amount conversion framework for Boku (#5459)
  chore(version): 2024.08.07.0
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-framework Area: Framework api-v2 C-refactor Category: Refactor M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants