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-1987 - Enable Entity Endpoints to Return Basic Info for non-admins. #2168

Merged
merged 20 commits into from
May 20, 2024

Conversation

WashingtonKK
Copy link
Contributor

@WashingtonKK WashingtonKK commented Apr 11, 2024

What type of PR is this?

This is a feature because it adds the capability for entity endpoints to return basic entity information for non privileged users.

What does this do?

This PR allows non-admin users to get basic information (name and id) from entities without needing any administrator privileges.

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

Have you included tests for your changes?

No

Did you document any new/modified feature?

Yes, I have updated the documentation for the new feature.

Notes

  • This can be used to fetch user names for invitations to allow user names to be acquired without needing admin privileges.

Signed-off-by: WashingtonKK [email protected]

@WashingtonKK WashingtonKK self-assigned this Apr 11, 2024
@WashingtonKK WashingtonKK force-pushed the MG-1987 branch 5 times, most recently from 74b82b1 to a56bbc2 Compare April 17, 2024 09:38
@WashingtonKK WashingtonKK marked this pull request as ready for review April 17, 2024 09:46
@WashingtonKK WashingtonKK force-pushed the MG-1987 branch 2 times, most recently from cfc7d73 to 6abdf88 Compare April 17, 2024 11:10
auth/postgres/domains.go Outdated Show resolved Hide resolved
users/service.go Outdated Show resolved Hide resolved
users/postgres/clients.go Outdated Show resolved Hide resolved
pkg/clients/postgres/clients.go Outdated Show resolved Hide resolved
pkg/clients/postgres/clients.go Outdated Show resolved Hide resolved
invitations/middleware/tracing.go Outdated Show resolved Hide resolved
@arvindh123
Copy link
Contributor

@dborovcanin @rodneyosodo Do we want to return usernames + id in invitations request ?
Instead of this , In UI we can view the user basic info with id and cache the request .

@WashingtonKK WashingtonKK force-pushed the MG-1987 branch 4 times, most recently from 64e04f8 to 472ff75 Compare April 22, 2024 08:02
@WashingtonKK WashingtonKK changed the title MG-1987 : Add domain and user names to invitations MG-1987 - Enable Entity Endpoints to Return Basic Info for non-admins. Apr 22, 2024
auth/service.go Outdated Show resolved Hide resolved
things/service.go Outdated Show resolved Hide resolved
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.

Do we need to expose things and groups for public access?

The related issue states only exposing user basic info and domain basic info to authenticated user

@WashingtonKK WashingtonKK force-pushed the MG-1987 branch 3 times, most recently from 50631ab to 9ab27ca Compare April 23, 2024 21:03
users/service.go Outdated Show resolved Hide resolved
rodneyosodo
rodneyosodo previously approved these changes May 15, 2024
token: accessToken,
domainID: "",
err: nil,
desc: "retrieve domain with empty domainID",
Copy link
Collaborator

Choose a reason for hiding this comment

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

...domain id

users/service.go Outdated
Comment on lines 192 to 209
for i := range pg.Clients {
pg.Clients[i] = mgclients.Client{Name: pg.Clients[i].Name, ID: pg.Clients[i].ID}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

for i, c := range pg.Clients {
    pg.Clients[i] = mgclients.Client{ID: c.ID, Name: c.Name}
}

users/service.go Outdated
@@ -483,6 +489,10 @@ func (svc service) ListMembers(ctx context.Context, token, objectKind, objectID
return mgclients.MembersPage{}, errors.Wrap(svcerr.ErrViewEntity, err)
}

for i := range cp.Clients {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same.

Signed-off-by: WashingtonKK <[email protected]>

Refactor tests

Signed-off-by: WashingtonKK <[email protected]>

update mocks

Signed-off-by: WashingtonKK <[email protected]>

Update mocks

Signed-off-by: WashingtonKK <[email protected]>

Get basic domain info

Signed-off-by: WashingtonKK <[email protected]>

fix tests

Signed-off-by: WashingtonKK <[email protected]>

Update invitation to query names:

Signed-off-by: WashingtonKK <[email protected]>

fix: ci

Signed-off-by: WashingtonKK <[email protected]>

fix: ci

Signed-off-by: WashingtonKK <[email protected]>

Use entity to hold domain and user

Signed-off-by: WashingtonKK <[email protected]>

refinements

Signed-off-by: WashingtonKK <[email protected]>

update retrieve all basic info

Signed-off-by: WashingtonKK <[email protected]>

replace repo call with service filtering

Signed-off-by: WashingtonKK <[email protected]>

Update test

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>

revert changes on invitations service

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>

fix testsg

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>

remove basic information from things and groups

Signed-off-by: WashingtonKK <[email protected]>

add undocumented status code

Signed-off-by: WashingtonKK <[email protected]>

Enhance mocks and fix tests

Signed-off-by: WashingtonKK <[email protected]>

fix linter and remove debug logs

Signed-off-by: WashingtonKK <[email protected]>

change member relation to permission

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
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.

Feature: Add username and domain name variables to ListInvitations Return value
4 participants