-
Notifications
You must be signed in to change notification settings - Fork 357
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
feat: Support RBAC in webhook #9859
Conversation
✅ Deploy Preview for determined-ui canceled.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9859 +/- ##
==========================================
- Coverage 54.75% 54.71% -0.05%
==========================================
Files 1261 1261
Lines 156425 156566 +141
Branches 3598 3594 -4
==========================================
+ Hits 85655 85660 +5
- Misses 70639 70775 +136
Partials 131 131
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
This LGTM modulo a few comments, awesome job with this!
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.
web changes ok
@@ -286,19 +286,30 @@ func GetWebhook(ctx context.Context, webhookID int) (*Webhook, error) { | |||
return &webhook, nil | |||
} | |||
|
|||
// GetWebhooks returns all Webhooks from the DB. | |||
func GetWebhooks(ctx context.Context) (Webhooks, error) { | |||
// getWebhooks returns Webhooks from the DB whose scopes are in workspaceIDs. |
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.
Sorry, I know I commented on this comment yesterday, but I just wanted to add a little bit more to it for clarity!
Can we maybe say
// getWebhooks returns all global webhooks from the DB and all webhooks whose scopes are in workspaceIDs.
I was confused before as to why users with no Viewer (or any) permissions were able to see global webhooks in the e2e tests, and this I think helps to clarify that!
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.
Looks amazing! Awesome work
Ticket
MD-478
Description
Part of workload alerting project.
ERD link: https://hpe-aiatscale.atlassian.net/wiki/spaces/ENGINEERIN/pages/1666809868/Workload+Alerting+ERD
Add RBAC support to webhook.
Other improvements:
Test Plan
Backend: e2e tests
WebUI:
With rbac disabled, user can only view/edit webhooks from their own workspace.
With rbac enabled, non-admin user can view/edit webhooks from workspace they have Editor/EditorRestricted/EditorProjectRestricted/WorkspaceAdmin role.
Checklist
docs/release-notes/
See Release Note for details.