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: privilege group privileges granted from ClusterAdmin permission denied #38514

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

shaoting-huang
Copy link
Contributor

@shaoting-huang shaoting-huang commented Dec 17, 2024

related: #38460, #37031

@sre-ci-robot sre-ci-robot added the size/XS Denotes a PR that changes 0-9 lines. label Dec 17, 2024
@mergify mergify bot added dco-passed DCO check passed. kind/bug Issues or changes related a bug labels Dec 17, 2024
@shaoting-huang
Copy link
Contributor Author

from pymilvus import connections, db
from pymilvus import CollectionSchema, FieldSchema
from pymilvus import Collection
from pymilvus import connections
from pymilvus import DataType
from pymilvus import Partition
from pymilvus import utility
from pymilvus import MilvusClient
from pymilvus import Role

connections.connect(host="localhost", user="root", password="Milvus")
client = MilvusClient(uri="http://localhost:19530", user="root", password="Milvus")
client.create_collection("col1", dimension=128)
db.create_database("db1")
role = Role("role")
role.create()
utility.list_roles(True)
utility.create_user(user="user1", password="Milvus")
role.add_user("user1")
utility.list_roles(True)
role.list_grants()

role.grant_v2("ClusterAdmin", "*", db_name="*")

role.list_grants()

connections.disconnect('default')
connections.connect(host="localhost", user="user1", password="Milvus")

role.create_privilege_group("pg")

role.add_privileges_to_group("pg", ["Query","Insert"])

role.list_privilege_groups()
#PrivilegeGroupInfo groups:
#- PrivilegeGroupItem: <privilege_group:pg>, <privileges:('Query', 'Insert')>

role.remove_privileges_from_group("pg", ["Query"])
role.list_privilege_groups()
#PrivilegeGroupInfo groups:
#- PrivilegeGroupItem: <privilege_group:pg>, <privileges:('Insert',)>

role.drop_privilege_group("pg")

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.97%. Comparing base (dd4f33a) to head (fc62761).
Report is 6 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #38514      +/-   ##
==========================================
- Coverage   82.81%   80.97%   -1.84%     
==========================================
  Files        1085     1377     +292     
  Lines      167731   193964   +26233     
==========================================
+ Hits       138899   157059   +18160     
- Misses      23301    31362    +8061     
- Partials     5531     5543      +12     
Components Coverage Δ
Client 74.58% <ø> (ø)
Core 69.34% <ø> (∅)
Go 83.01% <87.43%> (-0.03%) ⬇️
Files with missing lines Coverage Δ
pkg/util/constant.go 96.82% <ø> (ø)

... and 321 files with indirect coverage changes

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
Copy link
Contributor

mergify bot commented Dec 17, 2024

@shaoting-huang E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

Copy link
Contributor

mergify bot commented Dec 17, 2024

@shaoting-huang go-sdk check failed, comment rerun go-sdk can trigger the job again.

Copy link
Contributor

mergify bot commented Dec 17, 2024

@shaoting-huang cpp-unit-test check failed, comment rerun cpp-unit-test can trigger the job again.

@shaoting-huang
Copy link
Contributor Author

rerun go-sdk

@shaoting-huang
Copy link
Contributor Author

/run-cpu-e2e

@shaoting-huang
Copy link
Contributor Author

rerun cpp-unit-test

@shaoting-huang shaoting-huang changed the title fix: fix cluster admin privilege group privileges fix: privilege group privileges permission denied granted from ClusterAdmin Dec 17, 2024
@shaoting-huang shaoting-huang changed the title fix: privilege group privileges permission denied granted from ClusterAdmin fix: privilege group privileges granted from ClusterAdmin permission denied Dec 17, 2024
Copy link
Contributor

mergify bot commented Dec 17, 2024

@shaoting-huang E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

Copy link
Contributor

mergify bot commented Dec 17, 2024

@shaoting-huang go-sdk check failed, comment rerun go-sdk can trigger the job again.

Copy link
Contributor

mergify bot commented Dec 17, 2024

@shaoting-huang cpp-unit-test check failed, comment rerun cpp-unit-test can trigger the job again.

@weiliu1031
Copy link
Contributor

/lgtm

@shaoting-huang
Copy link
Contributor Author

/run-cpu-e2e

1 similar comment
@shaoting-huang
Copy link
Contributor Author

/run-cpu-e2e

@yanliang567 yanliang567 added ci-passed manual-pass manually set pass before ci-passed labeled labels Dec 17, 2024
@congqixia
Copy link
Contributor

/approve

@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: congqixia, shaoting-huang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot sre-ci-robot merged commit b9d8c5c into milvus-io:master Dec 17, 2024
18 of 20 checks passed
shaoting-huang added a commit to shaoting-huang/milvus that referenced this pull request Dec 17, 2024
…denied (milvus-io#38514)

related: milvus-io#38460

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
sre-ci-robot pushed a commit that referenced this pull request Dec 18, 2024
…ssion denied (#38530)

cherry-pick from master: #38514
related: #38460

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved ci-passed dco-passed DCO check passed. kind/bug Issues or changes related a bug lgtm manual-pass manually set pass before ci-passed labeled size/XS Denotes a PR that changes 0-9 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants