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

IAM 829 #269

Closed
wants to merge 6 commits into from
Closed

IAM 829 #269

wants to merge 6 commits into from

Conversation

shipperizer
Copy link
Contributor

@shipperizer shipperizer commented Apr 8, 2024

  • feat: WIP use page token in rules API listRules

TODO

  • write/adjust tests

@shipperizer shipperizer added enhancement New feature or request help wanted Extra attention is needed labels Apr 8, 2024
func (a *API) handleList(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")

pagination := types.ParsePagination(r.URL.Query())

rules, err := a.service.ListRules(r.Context(), pagination.Page, pagination.Size)
page := a.pageDecode(pagination.PageToken, int(pagination.Size))

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types High

Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt
to a lower bit size type int without an upper bound check.
@@ -71,6 +130,10 @@
Data: rules,
Message: "List of rules",
Status: http.StatusOK,
Meta: &types.Pagination{
Next: a.pageTokenEncode(page+1, int(pagination.Size)),

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types High

Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt
to a lower bit size type int without an upper bound check.
@shipperizer
Copy link
Contributor Author

superseded by #310

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant