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

feat: Add rbac for config policies #9873

Merged
merged 3 commits into from
Sep 4, 2024
Merged

Conversation

salonig23
Copy link
Contributor

@salonig23 salonig23 commented Aug 27, 2024

Ticket

CM-420

Description

Add RBAC permissions for modify and view config policies at the global and workspace levels.

Test Plan

CI passes

Checklist

  • Changes have been manually QA'd
  • New features have been approved by the corresponding PM
  • User-facing API changes have the "User-facing API Change" label
  • Release notes have been added as a separate file under docs/release-notes/
    See Release Note for details.
  • Licenses have been included for new code which was copied and/or modified from any external code

@cla-bot cla-bot bot added the cla-signed label Aug 27, 2024
@salonig23 salonig23 marked this pull request as ready for review August 27, 2024 23:35
@salonig23 salonig23 requested a review from a team as a code owner August 27, 2024 23:35
@salonig23 salonig23 requested review from jesse-amano-hpe and kkunapuli and removed request for jesse-amano-hpe August 27, 2024 23:35
Copy link

netlify bot commented Aug 27, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit e0b2b40
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/66d888f72c49340008c1c4b9
😎 Deploy Preview https://deploy-preview-9873--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 54 lines in your changes missing coverage. Please review.

Project coverage is 54.68%. Comparing base (0a18c5a) to head (e0b2b40).

Files with missing lines Patch % Lines
master/internal/workspace/authz_rbac.go 0.00% 18 Missing ⚠️
master/internal/cluster/authz_rbac.go 0.00% 12 Missing ⚠️
master/internal/cluster/authz_basic_impl.go 0.00% 6 Missing ⚠️
master/internal/cluster/authz_permissive.go 0.00% 6 Missing ⚠️
master/internal/workspace/authz_basic_impl.go 0.00% 6 Missing ⚠️
master/internal/workspace/authz_permissive.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9873      +/-   ##
==========================================
- Coverage   54.71%   54.68%   -0.03%     
==========================================
  Files        1261     1261              
  Lines      156756   156810      +54     
  Branches     3597     3597              
==========================================
- Hits        85770    85755      -15     
- Misses      70855    70924      +69     
  Partials      131      131              
Flag Coverage Δ
backend 45.21% <0.00%> (-0.08%) ⬇️
harness 72.62% <ø> (ø)
web 54.43% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
master/internal/cluster/authz_basic_impl.go 18.51% <0.00%> (-5.30%) ⬇️
master/internal/cluster/authz_permissive.go 3.57% <0.00%> (-0.98%) ⬇️
master/internal/workspace/authz_basic_impl.go 1.47% <0.00%> (-0.15%) ⬇️
master/internal/workspace/authz_permissive.go 1.42% <0.00%> (-0.14%) ⬇️
master/internal/cluster/authz_rbac.go 1.58% <0.00%> (-0.38%) ⬇️
master/internal/workspace/authz_rbac.go 0.33% <0.00%> (-0.03%) ⬇️

... and 6 files with indirect coverage changes

return (&MiscAuthZBasic{}).CanModifyGlobalConfigPolicies(ctx, curUser)
}

// CanViewGlobalConfigPolicies calls the RBAC implementation but always allows access.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just for my own knowledge - why do we have a function for viewing the policies if access is always allowed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

from my understanding, if we want to change who has those permissions it will be easier in the future, or if we want to add a feature to allow the admin to configure which user has which permissions, it would be easier if we already check this permission in the API handler

Copy link
Contributor

@kkunapuli kkunapuli left a comment

Choose a reason for hiding this comment

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

LGTM! Looks like an rbac test may be failing? Not sure if it's related or not.

@salonig23 salonig23 force-pushed the add-rbac-config-policies branch 3 times, most recently from e1dd803 to 60d7bc9 Compare September 3, 2024 07:43
@salonig23 salonig23 enabled auto-merge (squash) September 4, 2024 17:22
@salonig23 salonig23 merged commit a30bc25 into main Sep 4, 2024
84 of 101 checks passed
@salonig23 salonig23 deleted the add-rbac-config-policies branch September 4, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants