-
Notifications
You must be signed in to change notification settings - Fork 7
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
Juju 7074/identities filter #1434
Juju 7074/identities filter #1434
Conversation
b79f490
to
10cd635
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to request changes so we can remove the space but ping me once done and I'll approve (justh ave a think about my other comment)
const op = errors.Op("jimm.ListIdentities") | ||
|
||
if !user.JimmAdmin { | ||
return nil, errors.E(op, errors.CodeUnauthorized, "unauthorized") | ||
} | ||
identities, err := j.Database.ListIdentities(ctx, pagination.Limit(), pagination.Offset(), match) | ||
var users []openfga.User |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel like I'm reading that book aha. Love it.
internal/jimm/identity_test.go
Outdated
limit: 5, | ||
offset: 0, | ||
identities: []string{userNames[0]}, | ||
match: userNames[0][:5], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we're reating another slice anyway rather than just [:1], either do: [:1] on 117 or hardcode the string in please.
I'm usually of the preference of hardcoding strings in tests as I feel like it makes them more readable rather than bob1->5. Also as this is a match, doing [0] and [:5] against a string is less readable (imo) than just getting "bob1".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Description
This pr adds filtering for rebac
listIdentities
on group name/id.Address #1421
Engineering checklist
Check only items that apply
Test instructions
Notes for code reviewers