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

feat(mca): Add new auth_type and a status field for mca #2883

Merged
merged 13 commits into from
Nov 20, 2023

Conversation

ThisIsMani
Copy link
Contributor

@ThisIsMani ThisIsMani commented Nov 16, 2023

Type of Change

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

Description

Add a new auth_type called TemporaryAuth which describes that auth details are not yet received. When using this auth_type the connector status will be inactive and mca will be disabled.

Additional Changes

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

Motivation and Context

To support connector integration without auth details.
Closes #2895

How did you test it?

Postman.
Payment Connector - Create and Payment Connector - Update now supports a new auth type called TemporaryAuth and a new field status.

curl --location 'http://localhost:8080/account/merchant_1700133263/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
  "connector_type": "fiz_operations",
  "connector_name": "paypal",
  "connector_account_details": {
    "auth_type": "TemporaryAuth"
  },
  "status": "inactive",
  "disabled": true
}'

If TemporaryAuth is used in the request, the status field cannot be active and disabled cannot be false. This is applied for update mca as well. If a connector is inactive it cannot be enabled without changing the status to active.

There are the following error messages that will be thrown if incorrect request is used.

auth_type status disabled error_message
TemoraryAuth active * Connector status cannot be active when using TemporaryAuth
TemporaryAuth inactive false Connector cannot be enabled when connector_status is inactive or when using TemporaryAuth
ValidAuth inactive false Connector cannot be enabled when connector_status is inactive or when using TemporaryAuth

If all the fields are passed correctly you will a normal mca response.

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
  • I added a CHANGELOG entry if applicable

@ThisIsMani ThisIsMani requested review from a team as code owners November 16, 2023 06:18
@ThisIsMani ThisIsMani self-assigned this Nov 16, 2023
@ThisIsMani ThisIsMani added the A-connector-compatibility Area: Connector compatibility label Nov 16, 2023
@ThisIsMani ThisIsMani added C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Nov 16, 2023
@ThisIsMani ThisIsMani added this to the November 2023 Release milestone Nov 16, 2023
@ThisIsMani ThisIsMani requested a review from jarnura November 16, 2023 14:00
jarnura
jarnura previously approved these changes Nov 16, 2023
@likhinbopanna likhinbopanna removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Nov 17, 2023
@likhinbopanna likhinbopanna added this pull request to the merge queue Nov 17, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 17, 2023
@likhinbopanna likhinbopanna added this pull request to the merge queue Nov 17, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 17, 2023
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Nov 20, 2023
Merged via the queue into main with commit 25cef38 Nov 20, 2023
12 of 14 checks passed
@Gnanasundari24 Gnanasundari24 deleted the connector-status branch November 20, 2023 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-compatibility Area: Connector compatibility C-feature Category: Feature request or enhancement
Projects
No open projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add ability to add connectors without any auth details
8 participants