-
Notifications
You must be signed in to change notification settings - Fork 672
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
SMQ 2667 - Add: List all the users who can access the entity #2673
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Arvindh <[email protected]>
e5dfdc9
to
c344ad5
Compare
Signed-off-by: Arvindh <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2673 +/- ##
==========================================
- Coverage 43.87% 34.48% -9.39%
==========================================
Files 350 116 -234
Lines 45718 23346 -22372
==========================================
- Hits 20059 8051 -12008
+ Misses 23438 14669 -8769
+ Partials 2221 626 -1595 ☔ View full report in Codecov by Sentry. |
@ianmuchyri Please review and test. |
api/http/common.go
Outdated
MemberKindKey = "member_kind" | ||
PermissionKey = "permission" | ||
RelationKey = "relation" | ||
StatusKey = "status" | ||
OffsetKey = "offset" | ||
OrderKey = "order" | ||
LimitKey = "limit" | ||
MetadataKey = "metadata" | ||
ParentKey = "parent_id" | ||
OwnerKey = "owner_id" | ||
ClientKey = "client" | ||
UsernameKey = "username" | ||
NameKey = "name" | ||
GroupKey = "group" | ||
ActionKey = "action" | ||
ActionsKey = "actions" | ||
RoleIDKey = "role_id" | ||
RoleNameKey = "role_name" | ||
AccessProviderIDKey = "access_provider_id" | ||
AccessTypeKey = "access_type" | ||
TagKey = "tag" | ||
FirstNameKey = "first_name" | ||
LastNameKey = "last_name" | ||
TotalKey = "total" | ||
SubjectKey = "subject" | ||
ObjectKey = "object" | ||
LevelKey = "level" | ||
StartLevelKey = "start_level" | ||
EndLevelKey = "end_level" | ||
TreeKey = "tree" | ||
DirKey = "dir" | ||
ListPerms = "list_perms" | ||
VisibilityKey = "visibility" | ||
EmailKey = "email" | ||
SharedByKey = "shared_by" | ||
TokenKey = "token" | ||
UserKey = "user" | ||
DomainKey = "domain" | ||
ChannelKey = "channel" | ||
ConnTypeKey = "connection_type" | ||
DefPermission = "read_permission" | ||
DefTotal = uint64(100) | ||
DefOffset = 0 | ||
DefOrder = "updated_at" | ||
DefDir = "asc" | ||
DefLimit = 10 | ||
DefLevel = 0 | ||
DefStartLevel = 1 | ||
DefEndLevel = 0 | ||
DefStatus = "enabled" | ||
DefClientStatus = clients.Enabled | ||
DefUserStatus = users.Enabled | ||
DefGroupStatus = groups.Enabled | ||
DefListPerms = false | ||
SharedVisibility = "shared" | ||
MyVisibility = "mine" | ||
AllVisibility = "all" |
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.
Can we logically group these keys (per API?) so we split this large const block?
@@ -141,6 +141,9 @@ var ( | |||
// ErrInvalidComparator indicates an invalid comparator. | |||
ErrInvalidComparator = errors.New("invalid comparator") | |||
|
|||
// ErrMissingMemberIDs indicates missing group member type. |
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.
Fix comment.
@@ -53,6 +53,52 @@ func (req listRolesReq) validate() error { | |||
return nil | |||
} | |||
|
|||
type listEntityMembersReq struct { |
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.
Are members = users who can access it? If yes, please change to listEntityUsersReq
and add a comment explaining that.
r.Get("/members", otelhttp.NewHandler(kithttp.NewServer( | ||
ListEntityMembersEndpoint(svc), | ||
d.DecodeListEntityMembers, | ||
api.EncodeResponse, | ||
opts..., | ||
), "list_entity_members").ServeHTTP) |
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.
Same, use Users instead of members, since we are not talking about groups here.
b6fbadf
to
b57f107
Compare
2cf9c23
to
4843658
Compare
Signed-off-by: Arvindh <[email protected]>
4843658
to
f53efcd
Compare
What type of PR is this?
This is a feature because it adds the following functionality:
What does this do?
List all the users who can access the entity
Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
Did you document any new/modified feature?
Notes
Example Request :
Method: GET