Skip to content

Enhance the Audit Logs Endpoint #386

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

Open
rootelement opened this issue Feb 19, 2021 · 1 comment
Open

Enhance the Audit Logs Endpoint #386

rootelement opened this issue Feb 19, 2021 · 1 comment

Comments

@rootelement
Copy link
Contributor

AuditLogs endpoint uses unpaginated Dynamo scan to get data, so it doesn't return everything.

I ran this:

curl --location --request GET 'https://api.topcoder-dev.com/v5/challenge-audit-logs?challengeId=6008631e-48e5-45d7-8025-2758374a7d9d' \
--header 'Authorization: Bearer [my jwt]' \
--header 'Content-Type: application/json' \
--data-raw ''

And get one object returned:

[
    {
        "challengeId": "6008631e-48e5-45d7-8025-2758374a7d9d",
        "newValue": "\"2021-02-22T11:06:31.000Z\"",
        "created": "2021-02-19T11:08:14.486Z",
        "memberId": "40029484",
        "fieldName": "endDate",
        "id": "5fabad53-5ff5-4f3c-bbce-bd945a917a7e",
        "createdBy": "jcori",
        "oldValue": "\"2021-03-24T15:06:31.000Z\""
    }
]

But in the UI, i get 14 rows returned:

Screen Shot 2021-02-19 at 11 38 20 AM

Update the endpoint to use better dynamo query logic (adding challenge id as a range key and fieldName as a hash key would probably be a good start)

@ThomasKranitsas
Copy link
Contributor

PR #396

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants