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: added kafka events for authentication create and update #4991

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

vsrivatsa-juspay
Copy link
Contributor

@vsrivatsa-juspay vsrivatsa-juspay commented Jun 13, 2024

feat: added kafka events for authentication create and update clickhouse schemas

Type of Change

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

Description

This PR introduces Kafka events for authentication create and update operations. When an authentication record is inserted or updated, an event will now be pushed to the Kafka topic hyperswitch-authentication-events. This feature enables real-time analytics for authentication processes.

Additionally, this PR includes a script to create the necessary ClickHouse schemas to store and query the authentication data.

Changes:
Added Kafka event publishing for authentication create and update operations.
Added script for creating ClickHouse schemas for authentication data.

Additional Changes

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

Motivation and Context

How did you test it?

Pre-requisites
Setting up a 3DS Authenticator and a Payment Processor

  1. Modify Development.toml to change the events source:
[events]
source = "kafka"
  1. Run the application:
cargo run
  1. Start the necessary services using Docker Compose:
docker compose up -d kafka-ui clickhouse-server
  1. Create a payment from your server with request_external_three_ds_authentication set to true
  2. Initiate the authentication using the generated client_secret:
curl --location 'http:https://localhost:8080/payments/pay_xXr8btC2depRWfVYKmNt/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{api_key}}' \
--data '{
    "client_secret": "{{client_secret}}",
    "device_channel": "BRW",
    "threeds_method_comp_ind": "Y"
}'
  1. Complete the authentication challenge. The status should update to succeeded
    Verification:
    Open ClickHouse UI at http:https://localhost:8123/play.
    Query the authentication table to verify the data:
SELECT * FROM authentications

image

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

@vsrivatsa-juspay vsrivatsa-juspay requested review from a team as code owners June 13, 2024 09:03
@vsrivatsa-juspay vsrivatsa-juspay self-assigned this Jun 13, 2024
@vsrivatsa-juspay vsrivatsa-juspay added low-risk label to track PRs which might have less impact on hyperswitch after merge A-Analytics S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jun 13, 2024
@vsrivatsa-juspay vsrivatsa-juspay linked an issue Jun 13, 2024 that may be closed by this pull request
2 tasks
Copy link
Contributor

@sai-harsha-vardhan sai-harsha-vardhan left a comment

Choose a reason for hiding this comment

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

LGTM

@likhinbopanna likhinbopanna added this pull request to the merge queue Jun 24, 2024
Merged via the queue into main with commit 10e9121 Jun 24, 2024
27 of 31 checks passed
@likhinbopanna likhinbopanna deleted the feat/authentication_kafka_events branch June 24, 2024 12:56
pixincreate added a commit that referenced this pull request Jun 24, 2024
…ough-hyperswitch-cypress

* 'main' of github.com:juspay/hyperswitch:
  feat(router): add support for googlepay step up flow (#2744)
  fix(access_token): use `merchant_connector_id` in access token (#5106)
  feat: added kafka events for authentication create and update (#4991)
  feat(ci): add vector to handle logs pipeline (#5021)
  feat(users): Decision manager flow changes for SSO (#4995)
  ci(cypress): Fix payment method id for non supported connectors (#5075)
  refactor(core): introduce an interface to switch between old and new connector integration implementations on the connectors (#5013)
  refactor(events): populate object identifiers in outgoing webhooks analytics events during retries (#5067)
  Refactor: [Fiserv] Remove Default Case Handling (#4767)
  chore(version): 2024.06.24.0
  fix(router): avoid considering pre-routing results during `perform_session_token_routing` (#5076)
  refactor(redis): spawn one subscriber thread for handling all the published messages to different channel (#5064)
  feat(users): setup user authentication methods schema and apis (#4999)
  feat(payment_methods): Implement Process tracker workflow for Payment method Status update (#4668)
  chore(version): 2024.06.20.1
  chore(postman): update Postman collection files
  fix(payment_methods): support last used for off session token payments (#5039)
  ci(postman): add net_amount field test cases (#3286)
  refactor(connector): [Mifinity]dynamic fields for mifinity (#5056)
  refactor(payment_method): [Klarna] store and populate payment_type for klarna_sdk Paylater in response (#4956)
@SanchithHegde SanchithHegde removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed low-risk label to track PRs which might have less impact on hyperswitch after merge labels Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Authentication Analytics
6 participants