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

have option to enable robot full access #20754

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

wy65701436
Copy link
Contributor

@wy65701436 wy65701436 commented Jul 18, 2024

When the system admin enable this option, the robot can be assigned with robot/user/group/quota permissions.

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Issue being fixed

Fixes #(issue)

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@wy65701436 wy65701436 requested a review from a team as a code owner July 18, 2024 06:42
Copy link

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.07%. Comparing base (c8c11b4) to head (7af5441).
Report is 276 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #20754      +/-   ##
==========================================
+ Coverage   45.36%   50.07%   +4.71%     
==========================================
  Files         244      247       +3     
  Lines       13333    13782     +449     
  Branches     2719     2847     +128     
==========================================
+ Hits         6049     6902     +853     
+ Misses       6983     6799     -184     
+ Partials      301       81     -220     
Flag Coverage Δ
unittests 50.07% <ø> (+4.71%) ⬆️

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

see 491 files with indirect coverage changes

@wy65701436 wy65701436 added the release-note/update Update or Fix label Jul 18, 2024
When the system admin enable this option, the robot can be assigned with robot/user/group/quota permissions.

Signed-off-by: wang yan <[email protected]>
@@ -246,4 +246,7 @@ const (

// Global Leeway used for token validation
JwtLeeway = 60 * time.Second

// Global Leeway used for token validation
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrong comment?

if config.RobotFullAccess(ctx) {
permissionProvider = &NolimitProvider{}
}
return permissionProvider
Copy link
Contributor

Choose a reason for hiding this comment

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

if config.RobotFullAccess(ctx) {
    return &NolimitProvider{}
}
return &BaseProvider{}

var permissionProvider RobotPermissionProvider
permissionProvider = &BaseProvider{}
if config.RobotFullAccess(ctx) {
permissionProvider = &NolimitProvider{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nolimit -> Unlimit

Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

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.

5 participants