Skip to content

Commit

Permalink
Merge pull request #148 from hanix/master
Browse files Browse the repository at this point in the history
added pagination to Roles
  • Loading branch information
hanix committed May 22, 2024
2 parents 4208b8c + 758f557 commit d36e7c2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions api/rolestore/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,18 @@ func (store *RoleStore) LinkedRoles(awsroleID string) ([]AWSRoleLink, error) {
}

// Roles gets all configured roles.
func (store *RoleStore) Roles() ([]Role, error) {
func (store *RoleStore) Roles(offset, limit int, sortkey, sortdir string) ([]Role, error) {
result := rolesResult{}

filters := Params{
Offset: offset,
Limit: limit,
Sortkey: sortkey,
Sortdir: sortdir,
}

_, err := store.api.
URL("/role-store/api/v1/roles").
Get(&result)
URL("/role-store/api/v1/roles").Query(filters).Get(&result)

return result.Items, err
}
Expand Down

0 comments on commit d36e7c2

Please sign in to comment.