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

fix: hide connector grants #2913

Merged
merged 3 commits into from
Aug 12, 2022
Merged

fix: hide connector grants #2913

merged 3 commits into from
Aug 12, 2022

Conversation

j-sneh
Copy link
Contributor

@j-sneh j-sneh commented Aug 11, 2022

Summary

This is a natural continuation of this issue #2892, which was also causing a bug with the infra grants list command.

Checklist

  • Wrote appropriate unit tests
  • Considered security implications of the change
  • Updated associated docs where necessary
  • Updated associated configuration where necessary
  • Change is backwards compatible if it needs to be (user can upgrade without manual steps?)
  • Nothing sensitive logged
  • Considered data migrations for smooth upgrades

Related Issues

Resolves #2909

@@ -68,6 +68,10 @@ func ListGrants(c *gin.Context, subject uid.PolymorphicID, resource string, priv
selectors = append(selectors, data.ByOptionalSubject(subject))
}

if !showSystem {
selectors = append(selectors, data.NotPrivilege(models.InfraConnectorRole))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we will have to be more specific than this.

There could be a privilege called "connector" in other places outside of infra that its legit to create a grant for. We should hide system grants by something like privilege != connector && destination != infra together

api/grant.go Outdated
@@ -38,6 +38,7 @@ type ListGrantsRequest struct {
Resource string `form:"resource" example:"production"`
Privilege string `form:"privilege" example:"view"`
ShowInherited bool `form:"showInherited" note:"if true, this field includes grants that the user inherits through groups"`
ShowSystem bool `form:"showSystem"`
Copy link
Contributor

Choose a reason for hiding this comment

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

add a note tag here so that the api docs know what this is.

@j-sneh j-sneh merged commit 183f35e into main Aug 12, 2022
@j-sneh j-sneh deleted the j-sneh/hide-connector-grant branch August 12, 2022 17:15
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.

can't list grants in cli locally
3 participants