Skip to content
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

MG-2053 - Structure API Endpoints Based on Entities #2386

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

felixgateru
Copy link
Contributor

@felixgateru felixgateru commented Aug 14, 2024

What type of PR is this?

This is a refactor as it restructures endpoints based on entities to improve clarity and user experience.

What does this do?

This pr removes the following endpoints:

  • /users/{memberID}/domains
  • /channels/{chanID}/things
  • /things/{thingID}/channels
  • /users/{memberID}/channels
  • /groups/{memberID}/channels
  • /groups/{groupID}/users
  • /channels/{channelID}/users
  • /channels/{memberID}/groups
  • /users/{memberID}/groups
  • /domains/{domainID}/users

and replaces the functionlaity with list by entity option in list domains, users ,groups, channels and things as documented in the api.

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Yes, relevant tests have been added and updated.

Did you document any new/modified feature?

Yes, the api documentation has been updated.

Notes

@felixgateru felixgateru force-pushed the api-refactor branch 4 times, most recently from e676ad5 to 945ffdd Compare August 19, 2024 15:38
@felixgateru felixgateru marked this pull request as ready for review August 19, 2024 15:45
Copy link
Contributor

@arvindh123 arvindh123 left a comment

Choose a reason for hiding this comment

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

@felixgateru , I think list things is not in good shape, Could you for Domain member can able to list the things which they created ?

things/service.go Outdated Show resolved Hide resolved
@felixgateru felixgateru force-pushed the api-refactor branch 2 times, most recently from 2aaa9cc to 10193b9 Compare August 27, 2024 16:03
@felixgateru felixgateru self-assigned this Aug 27, 2024
things/service.go Outdated Show resolved Hide resolved
}
pm.EntityType = auth.UserType
pm.EntityID = res.GetId()
return svc.listEntityThings(ctx, res.GetId(), res.GetDomainId(), auth.MembershipPermission, auth.DomainType, res.GetDomainId(), pm)
Copy link
Contributor

@arvindh123 arvindh123 Aug 29, 2024

Choose a reason for hiding this comment

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

If domain is disabled , then this should not work for domain non administrator users. Please check this case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have checked this condition. When the domain is disabled only admins are able to list things

WashingtonKK and others added 9 commits September 2, 2024 13:46
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Arvindh <30824765+arvindh123@users.noreply.github.com>
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants