Skip to content

Align credential collection responses with connection-style paging#9

Merged
CodeAhmedJamil merged 2 commits into
feat/credentials-itemsfrom
feat/credentials-compat
Jun 12, 2026
Merged

Align credential collection responses with connection-style paging#9
CodeAhmedJamil merged 2 commits into
feat/credentials-itemsfrom
feat/credentials-compat

Conversation

@hamza-mohd

Copy link
Copy Markdown
Member

Summary

  • add credential collection search and pagination support
  • expose snake_case pagination aliases alongside camelCase keys
  • document and test the compatibility behavior

Notes

  • This is PR 3 of an 8-PR stacked series.
  • Base branch: feat/credentials-items.

Copilot AI review requested due to automatic review settings June 12, 2026 14:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns the Credentials collection list endpoint with the existing Connections-style paging by adding server-side search + pagination and returning both camelCase and snake_case pagination keys for compatibility.

Changes:

  • Add page/pageSize (pagesize) pagination and search (q) filtering for GET /api/credentials.
  • Return page_size and total_count aliases alongside pageSize and totalCount in the credentials list response.
  • Document the supported query parameters and add a test covering filtered/paged credentials listing.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
README.md Documents credentials list query params and response paging key compatibility.
internal/provider/server_test.go Adds test coverage for credentials list search + pagination + snake_case alias.
internal/provider/credentials.go Implements query parsing, filtered paging logic, total counting, and search matching.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +80 to +90
start := (page - 1) * pageSize
if start >= len(items) {
return []credentialRecord{}
}

end := start + pageSize
if end > len(items) {
end = len(items)
}

return items[start:end]
@CodeAhmedJamil CodeAhmedJamil merged commit 32a05d5 into feat/credentials-items Jun 12, 2026
1 check passed
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.

4 participants