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

Pagination support for service_token_permissions #326

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

ashtonwalden
Copy link
Contributor

Added pagination support for service_token_permissions.

Resolves #280

@ashtonwalden ashtonwalden reopened this Jan 7, 2025
@ashtonwalden ashtonwalden marked this pull request as ready for review January 7, 2025 18:39
@ashtonwalden ashtonwalden changed the title Draft: Fixes #280 Fixes #280 Jan 7, 2025

allData := make([]any, len(rawData))
for i, data := range rawData {
err := json.Unmarshal(data, &allData[i])
Copy link
Collaborator

Choose a reason for hiding this comment

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

The acceptance test is now passing, which is great 👍 , but I am just wondering why we need to add a new unmarshalling step to the process

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Small performance tweak. We added that to try and prevent the data from needing to be marshalled and unmarshaled again by the caller (ie: 161-163 or 180-182). Might make sense to try and swap some of the other client calls over to the GetRawResponse method.

Copy link
Contributor

Choose a reason for hiding this comment

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

@b-per The magic lies in Go's json.RawMessage type, so the actual data doesn't get unmarshalled just to read the pagination info.

Copy link
Contributor

@csquire csquire left a comment

Choose a reason for hiding this comment

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

LGTM 🚢
Maybe we want to rename the PR title?

@ashtonwalden ashtonwalden changed the title Fixes #280 Pagination support for service_token_permissions Jan 28, 2025
@ashtonwalden ashtonwalden merged commit 69006ec into main Jan 28, 2025
7 of 8 checks passed
@ashtonwalden ashtonwalden deleted the awalden/service-token-pagination branch January 28, 2025 20:56
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

Successfully merging this pull request may close these issues.

Error when updating token resource in 0.3.10
3 participants