Skip to content

feat: Add identity filters#40

Merged
saucam merged 3 commits intomainfrom
filtering
Mar 31, 2026
Merged

feat: Add identity filters#40
saucam merged 3 commits intomainfrom
filtering

Conversation

@saucam
Copy link
Copy Markdown
Contributor

@saucam saucam commented Mar 31, 2026

Summary


Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • This change requires a documentation update

Testing

  • Manually tested
  • Unit tests added/updated
  • No tests required

Impact / Risks


📸 Screenshots / Logs (if applicable)


Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces new filtering capabilities—including trust level, active status, and search—to the agent and identity listing endpoints. The changes extend from the API handlers through the service layer to the Postgres repository implementation. Feedback highlights that the identity repository lacks server-side pagination, which may cause performance degradation as data grows. Additionally, the new filters are not yet exposed in the identity API handler, and the boolean logic for the active status filter is currently implemented using fragile string comparisons.

Comment on lines +101 to +107
if isActive != "" {
if isActive == "true" {
q = q.Where("status = 'active'")
} else if isActive == "false" {
q = q.Where("status != 'active'")
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The isActive filter logic relies on exact string matches for "true" and "false". This is fragile as it doesn't handle different casings or invalid values gracefully. Consider using a boolean type in the API handler and passing it down, or using strconv.ParseBool to handle the string input more robustly.

@saucam saucam merged commit e2268e2 into main Mar 31, 2026
4 checks 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.

2 participants