Skip to content

Conversation

tsdk02
Copy link
Contributor

@tsdk02 tsdk02 commented Mar 17, 2025

Type of Change

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

Description

Added acs_reference_number as filter for authentication analytics.
Will display it as issuer on FE dashboard.

Additional Changes

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

Motivation and Context

Better insights into authentication data by applying filters

How did you test it?

Get Info curl:

curl --location 'http://localhost:8080/analytics/v1/auth_events/info' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Referer: http://localhost:9000/dashboard/analytics-payments' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-origin' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36' \
--header 'X-Merchant-Id: merchant_1740414909' \
--header 'X-Profile-Id: pro_q9g6emqpc7b41Lo7UXpx' \
--header 'api-key: dev_zKT6VT7TvcxCtwq8N716HELM6HZJAwZvkWVHrlKAU54Pzu6D18GL3u3UswnkMkug' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYWFiNWIxNDEtNjQwOC00YTUyLTk2MjMtNTVhNTgxMTU1M2U4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQwNDE0OTA5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTI3NDY4NSwib3JnX2lkIjoib3JnX1QwSEtYNHYyRGFRT2lHUDVwRk52IiwicHJvZmlsZV9pZCI6InByb19xOWc2ZW1xcGM3YjQxTG83VVhweCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.LIExs1jjG6N5AFu5_S3oiuy77fWF0IbJmNGbK8HHLXI' \
--header 'sec-ch-ua: "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"'

Sample Output:

{
    "metrics": [
        {
            "name": "authentication_count",
            "desc": ""
        },
        {
            "name": "authentication_attempt_count",
            "desc": ""
        },
        {
            "name": "authentication_success_count",
            "desc": ""
        },
        {
            "name": "challenge_flow_count",
            "desc": ""
        },
        {
            "name": "frictionless_flow_count",
            "desc": ""
        },
        {
            "name": "frictionless_success_count",
            "desc": ""
        },
        {
            "name": "challenge_attempt_count",
            "desc": ""
        },
        {
            "name": "challenge_success_count",
            "desc": ""
        },
        {
            "name": "authentication_error_message",
            "desc": ""
        },
        {
            "name": "authentication_funnel",
            "desc": ""
        }
    ],
    "downloadDimensions": null,
    "dimensions": [
        {
            "name": "authentication_connector",
            "desc": ""
        },
        {
            "name": "message_version",
            "desc": ""
        },
        {
            "name": "acs_reference_number",
            "desc": ""
        }
    ]
}

acs_reference_number is being sent in the dimensions list.

Filters API:

curl --location 'http://localhost:8080/analytics/v1/filters/auth_events' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: hyperswitch' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiM2RlMDFhYWYtOWVkMi00YTY5LTg3YWItNWU1YmI2ZWFiNGQ5IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQyMjEyMzQxIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MjM4NTE0Miwib3JnX2lkIjoib3JnX3pMQmRNTnpLaDZrNmhiT2tockdJIiwicHJvZmlsZV9pZCI6InByb19LWnhHZ21rUHFkMldQdXBFa2psWCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.efMstkbz90nfMKju4PmdIedl_tN-FHW3aQKD44jOnxo' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '{
    "timeRange": {
        "startTime": "2025-02-01T18:30:00.000Z",
        "endTime": "2025-02-28T09:22:30.000Z"
    },
    "groupByNames": [
        "message_version",
        "authentication_connector",
        "acs_reference_number"

    ],
    "source": "BATCH",
    "delta": true
}'

Sample Output:

{
    "queryData": [
        {
            "dimension": "message_version",
            "values": [
                "2.3.1"
            ]
        },
        {
            "dimension": "authentication_connector",
            "values": [
                "netcetera"
            ]
        },
        {
            "dimension": "acs_reference_number",
            "values": [
                "3DS_LOA_ACS_201_13579"
            ]
        }
    ]
}

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

@tsdk02 tsdk02 self-assigned this Mar 17, 2025
@tsdk02 tsdk02 requested a review from a team as a code owner March 17, 2025 11:39
Copy link

semanticdiff-com bot commented Mar 17, 2025

@tsdk02 tsdk02 linked an issue Mar 17, 2025 that may be closed by this pull request
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Mar 18, 2025
Merged via the queue into main with commit a87471c Mar 18, 2025
30 of 35 checks passed
@Gnanasundari24 Gnanasundari24 deleted the auth-analytics-filter branch March 18, 2025 10:21
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.

feat(analytics): add issuer as filter for authentication analytics
4 participants