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-1955 - Update Bootstrap service access control #2199

Merged
merged 52 commits into from
Jul 9, 2024

Conversation

JeffMboya
Copy link
Contributor

@JeffMboya JeffMboya commented Apr 25, 2024

What type of PR is this?

This PR is a bug fix.

What does this do?

This PR ensures that users can only view bootstrap configurations of the things within their current domain. It also allows domain members with appropriate permissions to view configurations for things within the domain, regardless of who created the configuration.

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

Have you included tests for your changes?

Yes, tests have been included in this PR.

Did you document any new/modified feature?

No new features were documented in this PR.

@JeffMboya JeffMboya changed the title MG-1955 - Implement domains access control MG-1955 - Bootstrap service is not synced to the latest changes of access control Apr 25, 2024
@JeffMboya JeffMboya force-pushed the MG-1955 branch 2 times, most recently from 955c48b to 36871a7 Compare April 30, 2024 07:40
bootstrap/postgres/init.go Outdated Show resolved Hide resolved
@JeffMboya JeffMboya self-assigned this May 2, 2024
@JeffMboya JeffMboya force-pushed the MG-1955 branch 3 times, most recently from a419da6 to 1fbba5b Compare May 6, 2024 08:17
@JeffMboya JeffMboya marked this pull request as ready for review May 7, 2024 07:36
@JeffMboya JeffMboya force-pushed the MG-1955 branch 2 times, most recently from 1c41e02 to d51ce36 Compare May 8, 2024 08:13
bootstrap/configs.go Outdated Show resolved Hide resolved
bootstrap/configs.go Outdated Show resolved Hide resolved
bootstrap/postgres/configs.go Outdated Show resolved Hide resolved
bootstrap/postgres/init.go Show resolved Hide resolved
bootstrap/service.go Outdated Show resolved Hide resolved
@JeffMboya JeffMboya force-pushed the MG-1955 branch 5 times, most recently from 26959ac to 2080e0a Compare May 16, 2024 09:38
@JeffMboya JeffMboya force-pushed the MG-1955 branch 2 times, most recently from c43e6eb to 87c7b95 Compare May 20, 2024 11:59
Comment on lines 141 to 145
for _, channel := range cfg.Channels {
if channel.ID == "" || channel.ID == "invalid" {
return Config{}, svcerr.ErrMalformedEntity
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be moved to API layer

return Config{}, errors.Wrap(svcerr.ErrViewEntity, err)
}

if thing.DomainID != user.GetDomainId() {
Copy link
Contributor

Choose a reason for hiding this comment

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

How this case will be possible?
Is there way to add to a thing which is not belongs same domain of user?

if err != nil {
return errors.Wrap(svcerr.ErrAuthentication, err)
}
_, err = bs.authorize(ctx, "", auth.UserType, auth.UsersKind, user.GetId(), auth.EditPermission, auth.DomainType, user.GetDomainId())
Copy link
Contributor

Choose a reason for hiding this comment

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

@JeffMboya Why we are checking the user have edit access to Domain ?

bootstrap/api/endpoint.go Outdated Show resolved Hide resolved
bootstrap/service.go Show resolved Hide resolved
bootstrap/postgres/configs.go Outdated Show resolved Hide resolved
bootstrap/postgres/configs.go Outdated Show resolved Hide resolved
bootstrap/service.go Outdated Show resolved Hide resolved
bootstrap/api/requests_test.go Outdated Show resolved Hide resolved
bootstrap/api/requests_test.go Outdated Show resolved Hide resolved
bootstrap/api/requests_test.go Show resolved Hide resolved
bootstrap/service.go Outdated Show resolved Hide resolved
bootstrap/service.go Outdated Show resolved Hide resolved
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
arvindh123
arvindh123 previously approved these changes Jul 9, 2024
@dborovcanin dborovcanin merged commit b49a2cd into absmach:main Jul 9, 2024
11 of 12 checks passed
@dborovcanin dborovcanin changed the title MG-1955 - Bootstrap service is not synced to the latest changes of access control MG-1955 - Update Bootstrap service access control Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Update Bootstrap service access control
4 participants