docs icon indicating copy to clipboard operation
docs copied to clipboard

Phrase is not present in links for audit log pagination

Open khnumdev opened this issue 6 months ago • 4 comments

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/using-the-audit-log-api-for-your-enterprise

What changes are you suggesting?

In example 1, the request is

curl --include -H "Authorization: Bearer TOKEN" \
--request GET \
"https://api.github.com/enterprises/avocado-corp/audit-log?phrase=created:2022-01-01&per_page=100"

Note that phrase=created:2022-01-01 is provided, as well the per_page field.

However, in the response example with the links the content is:

link: <https://api.github.com/enterprises/13827/audit-log?%3A2022-11-01=&per_page=100&after=MS42NjQzODMzNTk5MjdlKzEyfDloQzBxdURzaFdVbVlLWjkxRU9mNXc%3D&before=>; rel="next",
<https://api.github.com/enterprises/13827/audit-log?%3A2022-11-01=&per_page=100&after=&before=>; rel="first",
<https://api.github.com/enterprises/13827/audit-log?%3A2022-11-01=&per_page=100&after=&before=MS42Njc4NDA2MjM4MzNlKzEyfExqeG5sUElvNEZMbG1XZHA5akdKTVE%3D>; rel="prev"

Getting one of the links:

https://api.github.com/enterprises/13827/audit-log?%3A2022-11-01=&per_page=100&after=MS42NjQzODMzNTk5MjdlKzEyfDloQzBxdURzaFdVbVlLWjkxRU9mNXc%3D&before

it seems an invalid URL, as 2022-11-01 is provided with an url encoded : where it should be with phrase%3A2022-11-01 including the name of the query parameter used.

Also, for consistency date should be 2022-01-01 as it is the one provided in the request.

So the link, once fixed should be:

https://api.github.com/enterprises/13827/audit-log?phrase%3A2022-11-01=&per_page=100&after=MS42NjQzODMzNTk5MjdlKzEyfDloQzBxdURzaFdVbVlLWjkxRU9mNXc%3D&before

Additional information

No response

khnumdev avatar May 28 '25 15:05 khnumdev

Thanks for opening an issue! I'll get this triaged for review.

Sharra-writes avatar May 28 '25 22:05 Sharra-writes

Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:

github-actions[bot] avatar May 28 '25 22:05 github-actions[bot]

❤️

Gurupatil0003 avatar Jun 03 '25 07:06 Gurupatil0003

明白了,原本是完全新手小白 很抱歉造成你的困擾

cceneag avatar Jun 03 '25 21:06 cceneag

@khnumdev I've confirmed that this change is fine, so if you want to open a PR, feel free. Or someone else can.

Sharra-writes avatar Jun 23 '25 19:06 Sharra-writes

@khnumdev I've confirmed that this change is fine, so if you want to open a PR, feel free. Or someone else can.

Thanks! Yeah I'll provide a PR for this. Do I need to assign the issue to me for that ?

khnumdev avatar Jun 23 '25 19:06 khnumdev

@khnumdev No, just note the issue number (#38566) under the question of which issue it closes in the PR template. Even that isn't strictly necessary, it just links them so the issue gets closed when the PR gets merged. If it messes up for any reason, I can always close the issue manually.

Sharra-writes avatar Jun 23 '25 20:06 Sharra-writes