Add the rbac for the GetLoadingProgress and GetLoadState api (#22320)

Signed-off-by: SimFG <bang.fu@zilliz.com>
pull/22352/head
SimFG 2023-02-22 20:37:45 +08:00 committed by GitHub
parent cc5d72a9f2
commit 7e19a924b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 137 additions and 103 deletions

2
go.mod
View File

@ -27,7 +27,7 @@ require (
github.com/klauspost/compress v1.14.4 github.com/klauspost/compress v1.14.4
github.com/lingdor/stackerror v0.0.0-20191119040541-976d8885ed76 github.com/lingdor/stackerror v0.0.0-20191119040541-976d8885ed76
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
github.com/milvus-io/milvus-proto/go-api v0.0.0-20230209081028-aabbca7f95ae github.com/milvus-io/milvus-proto/go-api v0.0.0-20230220081023-3cf200738ae7
github.com/minio/minio-go/v7 v7.0.17 github.com/minio/minio-go/v7 v7.0.17
github.com/panjf2000/ants/v2 v2.4.8 github.com/panjf2000/ants/v2 v2.4.8
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1

2
go.sum
View File

@ -493,6 +493,8 @@ github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b h1:TfeY0NxYxZz
github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b/go.mod h1:iwW+9cWfIzzDseEBCCeDSN5SD16Tidvy8cwQ7ZY8Qj4= github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b/go.mod h1:iwW+9cWfIzzDseEBCCeDSN5SD16Tidvy8cwQ7ZY8Qj4=
github.com/milvus-io/milvus-proto/go-api v0.0.0-20230209081028-aabbca7f95ae h1:4PPf72uc+pUFIT22yUHKrMMVyiJu8Q5l8FrQ4IkvAAY= github.com/milvus-io/milvus-proto/go-api v0.0.0-20230209081028-aabbca7f95ae h1:4PPf72uc+pUFIT22yUHKrMMVyiJu8Q5l8FrQ4IkvAAY=
github.com/milvus-io/milvus-proto/go-api v0.0.0-20230209081028-aabbca7f95ae/go.mod h1:148qnlmZ0Fdm1Fq+Mj/OW2uDoEP25g3mjh0vMGtkgmk= github.com/milvus-io/milvus-proto/go-api v0.0.0-20230209081028-aabbca7f95ae/go.mod h1:148qnlmZ0Fdm1Fq+Mj/OW2uDoEP25g3mjh0vMGtkgmk=
github.com/milvus-io/milvus-proto/go-api v0.0.0-20230220081023-3cf200738ae7 h1:G3qXTVWaHXQkgnPOxuCb/NIxb2oD4xHHViyuTGs5KQU=
github.com/milvus-io/milvus-proto/go-api v0.0.0-20230220081023-3cf200738ae7/go.mod h1:148qnlmZ0Fdm1Fq+Mj/OW2uDoEP25g3mjh0vMGtkgmk=
github.com/milvus-io/pulsar-client-go v0.6.10 h1:eqpJjU+/QX0iIhEo3nhOqMNXL+TyInAs1IAHZCrCM/A= github.com/milvus-io/pulsar-client-go v0.6.10 h1:eqpJjU+/QX0iIhEo3nhOqMNXL+TyInAs1IAHZCrCM/A=
github.com/milvus-io/pulsar-client-go v0.6.10/go.mod h1:lQqCkgwDF8YFYjKA+zOheTk1tev2B+bKj5j7+nm8M1w= github.com/milvus-io/pulsar-client-go v0.6.10/go.mod h1:lQqCkgwDF8YFYjKA+zOheTk1tev2B+bKj5j7+nm8M1w=
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs=

View File

@ -332,7 +332,7 @@ const char descriptor_table_protodef_common_2eproto[] PROTOBUF_SECTION_VARIABLE(
".ObjectType\022>\n\020object_privilege\030\002 \001(\0162$." ".ObjectType\022>\n\020object_privilege\030\002 \001(\0162$."
"milvus.proto.common.ObjectPrivilege\022\031\n\021o" "milvus.proto.common.ObjectPrivilege\022\031\n\021o"
"bject_name_index\030\003 \001(\005\022\032\n\022object_name_in" "bject_name_index\030\003 \001(\005\022\032\n\022object_name_in"
"dexs\030\004 \001(\005*\223\n\n\tErrorCode\022\013\n\007Success\020\000\022\023\n" "dexs\030\004 \001(\005*\303\n\n\tErrorCode\022\013\n\007Success\020\000\022\023\n"
"\017UnexpectedError\020\001\022\021\n\rConnectFailed\020\002\022\024\n" "\017UnexpectedError\020\001\022\021\n\rConnectFailed\020\002\022\024\n"
"\020PermissionDenied\020\003\022\027\n\023CollectionNotExis" "\020PermissionDenied\020\003\022\027\n\023CollectionNotExis"
"ts\020\004\022\023\n\017IllegalArgument\020\005\022\024\n\020IllegalDime" "ts\020\004\022\023\n\017IllegalArgument\020\005\022\024\n\020IllegalDime"
@ -363,111 +363,113 @@ const char descriptor_table_protodef_common_2eproto[] PROTOBUF_SECTION_VARIABLE(
"ateLimit\0201\022\022\n\016NodeIDNotMatch\0202\022\024\n\020Upsert" "ateLimit\0201\022\022\n\016NodeIDNotMatch\0202\022\024\n\020Upsert"
"AutoIDTrue\0203\022\034\n\030InsufficientMemoryToLoad" "AutoIDTrue\0203\022\034\n\030InsufficientMemoryToLoad"
"\0204\022\030\n\024MemoryQuotaExhausted\0205\022\026\n\022DiskQuot" "\0204\022\030\n\024MemoryQuotaExhausted\0205\022\026\n\022DiskQuot"
"aExhausted\0206\022\025\n\021TimeTickLongDelay\0207\022\017\n\013D" "aExhausted\0206\022\025\n\021TimeTickLongDelay\0207\022\021\n\rN"
"ataCoordNA\020d\022\022\n\rDDRequestRace\020\350\007*c\n\nInde" "otReadyServe\0208\022\033\n\027NotReadyCoordActivatin"
"xState\022\022\n\016IndexStateNone\020\000\022\014\n\010Unissued\020\001" "g\0209\022\017\n\013DataCoordNA\020d\022\022\n\rDDRequestRace\020\350\007"
"\022\016\n\nInProgress\020\002\022\014\n\010Finished\020\003\022\n\n\006Failed" "*c\n\nIndexState\022\022\n\016IndexStateNone\020\000\022\014\n\010Un"
"\020\004\022\t\n\005Retry\020\005*\202\001\n\014SegmentState\022\024\n\020Segmen" "issued\020\001\022\016\n\nInProgress\020\002\022\014\n\010Finished\020\003\022\n"
"tStateNone\020\000\022\014\n\010NotExist\020\001\022\013\n\007Growing\020\002\022" "\n\006Failed\020\004\022\t\n\005Retry\020\005*\202\001\n\014SegmentState\022\024"
"\n\n\006Sealed\020\003\022\013\n\007Flushed\020\004\022\014\n\010Flushing\020\005\022\013" "\n\020SegmentStateNone\020\000\022\014\n\010NotExist\020\001\022\013\n\007Gr"
"\n\007Dropped\020\006\022\r\n\tImporting\020\007*>\n\017Placeholde" "owing\020\002\022\n\n\006Sealed\020\003\022\013\n\007Flushed\020\004\022\014\n\010Flus"
"rType\022\010\n\004None\020\000\022\020\n\014BinaryVector\020d\022\017\n\013Flo" "hing\020\005\022\013\n\007Dropped\020\006\022\r\n\tImporting\020\007*>\n\017Pl"
"atVector\020e*\300\016\n\007MsgType\022\r\n\tUndefined\020\000\022\024\n" "aceholderType\022\010\n\004None\020\000\022\020\n\014BinaryVector\020"
"\020CreateCollection\020d\022\022\n\016DropCollection\020e\022" "d\022\017\n\013FloatVector\020e*\300\016\n\007MsgType\022\r\n\tUndefi"
"\021\n\rHasCollection\020f\022\026\n\022DescribeCollection" "ned\020\000\022\024\n\020CreateCollection\020d\022\022\n\016DropColle"
"\020g\022\023\n\017ShowCollections\020h\022\024\n\020GetSystemConf" "ction\020e\022\021\n\rHasCollection\020f\022\026\n\022DescribeCo"
"igs\020i\022\022\n\016LoadCollection\020j\022\025\n\021ReleaseColl" "llection\020g\022\023\n\017ShowCollections\020h\022\024\n\020GetSy"
"ection\020k\022\017\n\013CreateAlias\020l\022\r\n\tDropAlias\020m" "stemConfigs\020i\022\022\n\016LoadCollection\020j\022\025\n\021Rel"
"\022\016\n\nAlterAlias\020n\022\023\n\017AlterCollection\020o\022\024\n" "easeCollection\020k\022\017\n\013CreateAlias\020l\022\r\n\tDro"
"\020RenameCollection\020p\022\024\n\017CreatePartition\020\310" "pAlias\020m\022\016\n\nAlterAlias\020n\022\023\n\017AlterCollect"
"\001\022\022\n\rDropPartition\020\311\001\022\021\n\014HasPartition\020\312\001" "ion\020o\022\024\n\020RenameCollection\020p\022\024\n\017CreatePar"
"\022\026\n\021DescribePartition\020\313\001\022\023\n\016ShowPartitio" "tition\020\310\001\022\022\n\rDropPartition\020\311\001\022\021\n\014HasPart"
"ns\020\314\001\022\023\n\016LoadPartitions\020\315\001\022\026\n\021ReleasePar" "ition\020\312\001\022\026\n\021DescribePartition\020\313\001\022\023\n\016Show"
"titions\020\316\001\022\021\n\014ShowSegments\020\372\001\022\024\n\017Describ" "Partitions\020\314\001\022\023\n\016LoadPartitions\020\315\001\022\026\n\021Re"
"eSegment\020\373\001\022\021\n\014LoadSegments\020\374\001\022\024\n\017Releas" "leasePartitions\020\316\001\022\021\n\014ShowSegments\020\372\001\022\024\n"
"eSegments\020\375\001\022\024\n\017HandoffSegments\020\376\001\022\030\n\023Lo" "\017DescribeSegment\020\373\001\022\021\n\014LoadSegments\020\374\001\022\024"
"adBalanceSegments\020\377\001\022\025\n\020DescribeSegments" "\n\017ReleaseSegments\020\375\001\022\024\n\017HandoffSegments\020"
"\020\200\002\022\020\n\013CreateIndex\020\254\002\022\022\n\rDescribeIndex\020\255" "\376\001\022\030\n\023LoadBalanceSegments\020\377\001\022\025\n\020Describe"
"\002\022\016\n\tDropIndex\020\256\002\022\013\n\006Insert\020\220\003\022\013\n\006Delete" "Segments\020\200\002\022\020\n\013CreateIndex\020\254\002\022\022\n\rDescrib"
"\020\221\003\022\n\n\005Flush\020\222\003\022\027\n\022ResendSegmentStats\020\223\003" "eIndex\020\255\002\022\016\n\tDropIndex\020\256\002\022\013\n\006Insert\020\220\003\022\013"
"\022\013\n\006Upsert\020\224\003\022\013\n\006Search\020\364\003\022\021\n\014SearchResu" "\n\006Delete\020\221\003\022\n\n\005Flush\020\222\003\022\027\n\022ResendSegment"
"lt\020\365\003\022\022\n\rGetIndexState\020\366\003\022\032\n\025GetIndexBui" "Stats\020\223\003\022\013\n\006Upsert\020\224\003\022\013\n\006Search\020\364\003\022\021\n\014Se"
"ldProgress\020\367\003\022\034\n\027GetCollectionStatistics" "archResult\020\365\003\022\022\n\rGetIndexState\020\366\003\022\032\n\025Get"
"\020\370\003\022\033\n\026GetPartitionStatistics\020\371\003\022\r\n\010Retr" "IndexBuildProgress\020\367\003\022\034\n\027GetCollectionSt"
"ieve\020\372\003\022\023\n\016RetrieveResult\020\373\003\022\024\n\017WatchDmC" "atistics\020\370\003\022\033\n\026GetPartitionStatistics\020\371\003"
"hannels\020\374\003\022\025\n\020RemoveDmChannels\020\375\003\022\027\n\022Wat" "\022\r\n\010Retrieve\020\372\003\022\023\n\016RetrieveResult\020\373\003\022\024\n\017"
"chQueryChannels\020\376\003\022\030\n\023RemoveQueryChannel" "WatchDmChannels\020\374\003\022\025\n\020RemoveDmChannels\020\375"
"s\020\377\003\022\035\n\030SealedSegmentsChangeInfo\020\200\004\022\027\n\022W" "\003\022\027\n\022WatchQueryChannels\020\376\003\022\030\n\023RemoveQuer"
"atchDeltaChannels\020\201\004\022\024\n\017GetShardLeaders\020" "yChannels\020\377\003\022\035\n\030SealedSegmentsChangeInfo"
"\202\004\022\020\n\013GetReplicas\020\203\004\022\023\n\016UnsubDmChannel\020\204" "\020\200\004\022\027\n\022WatchDeltaChannels\020\201\004\022\024\n\017GetShard"
"\004\022\024\n\017GetDistribution\020\205\004\022\025\n\020SyncDistribut" "Leaders\020\202\004\022\020\n\013GetReplicas\020\203\004\022\023\n\016UnsubDmC"
"ion\020\206\004\022\020\n\013SegmentInfo\020\330\004\022\017\n\nSystemInfo\020\331" "hannel\020\204\004\022\024\n\017GetDistribution\020\205\004\022\025\n\020SyncD"
"\004\022\024\n\017GetRecoveryInfo\020\332\004\022\024\n\017GetSegmentSta" "istribution\020\206\004\022\020\n\013SegmentInfo\020\330\004\022\017\n\nSyst"
"te\020\333\004\022\r\n\010TimeTick\020\260\t\022\023\n\016QueryNodeStats\020\261" "emInfo\020\331\004\022\024\n\017GetRecoveryInfo\020\332\004\022\024\n\017GetSe"
"\t\022\016\n\tLoadIndex\020\262\t\022\016\n\tRequestID\020\263\t\022\017\n\nReq" "gmentState\020\333\004\022\r\n\010TimeTick\020\260\t\022\023\n\016QueryNod"
"uestTSO\020\264\t\022\024\n\017AllocateSegment\020\265\t\022\026\n\021Segm" "eStats\020\261\t\022\016\n\tLoadIndex\020\262\t\022\016\n\tRequestID\020\263"
"entStatistics\020\266\t\022\025\n\020SegmentFlushDone\020\267\t\022" "\t\022\017\n\nRequestTSO\020\264\t\022\024\n\017AllocateSegment\020\265\t"
"\017\n\nDataNodeTt\020\270\t\022\025\n\020CreateCredential\020\334\013\022" "\022\026\n\021SegmentStatistics\020\266\t\022\025\n\020SegmentFlush"
"\022\n\rGetCredential\020\335\013\022\025\n\020DeleteCredential\020" "Done\020\267\t\022\017\n\nDataNodeTt\020\270\t\022\025\n\020CreateCreden"
"\336\013\022\025\n\020UpdateCredential\020\337\013\022\026\n\021ListCredUse" "tial\020\334\013\022\022\n\rGetCredential\020\335\013\022\025\n\020DeleteCre"
"rnames\020\340\013\022\017\n\nCreateRole\020\300\014\022\r\n\010DropRole\020\301" "dential\020\336\013\022\025\n\020UpdateCredential\020\337\013\022\026\n\021Lis"
"\014\022\024\n\017OperateUserRole\020\302\014\022\017\n\nSelectRole\020\303\014" "tCredUsernames\020\340\013\022\017\n\nCreateRole\020\300\014\022\r\n\010Dr"
"\022\017\n\nSelectUser\020\304\014\022\023\n\016SelectResource\020\305\014\022\025" "opRole\020\301\014\022\024\n\017OperateUserRole\020\302\014\022\017\n\nSelec"
"\n\020OperatePrivilege\020\306\014\022\020\n\013SelectGrant\020\307\014\022" "tRole\020\303\014\022\017\n\nSelectUser\020\304\014\022\023\n\016SelectResou"
"\033\n\026RefreshPolicyInfoCache\020\310\014\022\017\n\nListPoli" "rce\020\305\014\022\025\n\020OperatePrivilege\020\306\014\022\020\n\013SelectG"
"cy\020\311\014\022\030\n\023CreateResourceGroup\020\244\r\022\026\n\021DropR" "rant\020\307\014\022\033\n\026RefreshPolicyInfoCache\020\310\014\022\017\n\n"
"esourceGroup\020\245\r\022\027\n\022ListResourceGroups\020\246\r" "ListPolicy\020\311\014\022\030\n\023CreateResourceGroup\020\244\r\022"
"\022\032\n\025DescribeResourceGroup\020\247\r\022\021\n\014Transfer" "\026\n\021DropResourceGroup\020\245\r\022\027\n\022ListResourceG"
"Node\020\250\r\022\024\n\017TransferReplica\020\251\r*\"\n\007DslType" "roups\020\246\r\022\032\n\025DescribeResourceGroup\020\247\r\022\021\n\014"
"\022\007\n\003Dsl\020\000\022\016\n\nBoolExprV1\020\001*B\n\017CompactionS" "TransferNode\020\250\r\022\024\n\017TransferReplica\020\251\r*\"\n"
"tate\022\021\n\rUndefiedState\020\000\022\r\n\tExecuting\020\001\022\r" "\007DslType\022\007\n\003Dsl\020\000\022\016\n\nBoolExprV1\020\001*B\n\017Com"
"\n\tCompleted\020\002*X\n\020ConsistencyLevel\022\n\n\006Str" "pactionState\022\021\n\rUndefiedState\020\000\022\r\n\tExecu"
"ong\020\000\022\013\n\007Session\020\001\022\013\n\007Bounded\020\002\022\016\n\nEvent" "ting\020\001\022\r\n\tCompleted\020\002*X\n\020ConsistencyLeve"
"ually\020\003\022\016\n\nCustomized\020\004*\236\001\n\013ImportState\022" "l\022\n\n\006Strong\020\000\022\013\n\007Session\020\001\022\013\n\007Bounded\020\002\022"
"\021\n\rImportPending\020\000\022\020\n\014ImportFailed\020\001\022\021\n\r" "\016\n\nEventually\020\003\022\016\n\nCustomized\020\004*\236\001\n\013Impo"
"ImportStarted\020\002\022\023\n\017ImportPersisted\020\005\022\021\n\r" "rtState\022\021\n\rImportPending\020\000\022\020\n\014ImportFail"
"ImportFlushed\020\010\022\023\n\017ImportCompleted\020\006\022\032\n\026" "ed\020\001\022\021\n\rImportStarted\020\002\022\023\n\017ImportPersist"
"ImportFailedAndCleaned\020\007*2\n\nObjectType\022\016" "ed\020\005\022\021\n\rImportFlushed\020\010\022\023\n\017ImportComplet"
"\n\nCollection\020\000\022\n\n\006Global\020\001\022\010\n\004User\020\002*\333\006\n" "ed\020\006\022\032\n\026ImportFailedAndCleaned\020\007*2\n\nObje"
"\017ObjectPrivilege\022\020\n\014PrivilegeAll\020\000\022\035\n\031Pr" "ctType\022\016\n\nCollection\020\000\022\n\n\006Global\020\001\022\010\n\004Us"
"ivilegeCreateCollection\020\001\022\033\n\027PrivilegeDr" "er\020\002*\227\007\n\017ObjectPrivilege\022\020\n\014PrivilegeAll"
"opCollection\020\002\022\037\n\033PrivilegeDescribeColle" "\020\000\022\035\n\031PrivilegeCreateCollection\020\001\022\033\n\027Pri"
"ction\020\003\022\034\n\030PrivilegeShowCollections\020\004\022\021\n" "vilegeDropCollection\020\002\022\037\n\033PrivilegeDescr"
"\rPrivilegeLoad\020\005\022\024\n\020PrivilegeRelease\020\006\022\027" "ibeCollection\020\003\022\034\n\030PrivilegeShowCollecti"
"\n\023PrivilegeCompaction\020\007\022\023\n\017PrivilegeInse" "ons\020\004\022\021\n\rPrivilegeLoad\020\005\022\024\n\020PrivilegeRel"
"rt\020\010\022\023\n\017PrivilegeDelete\020\t\022\032\n\026PrivilegeGe" "ease\020\006\022\027\n\023PrivilegeCompaction\020\007\022\023\n\017Privi"
"tStatistics\020\n\022\030\n\024PrivilegeCreateIndex\020\013\022" "legeInsert\020\010\022\023\n\017PrivilegeDelete\020\t\022\032\n\026Pri"
"\030\n\024PrivilegeIndexDetail\020\014\022\026\n\022PrivilegeDr" "vilegeGetStatistics\020\n\022\030\n\024PrivilegeCreate"
"opIndex\020\r\022\023\n\017PrivilegeSearch\020\016\022\022\n\016Privil" "Index\020\013\022\030\n\024PrivilegeIndexDetail\020\014\022\026\n\022Pri"
"egeFlush\020\017\022\022\n\016PrivilegeQuery\020\020\022\030\n\024Privil" "vilegeDropIndex\020\r\022\023\n\017PrivilegeSearch\020\016\022\022"
"egeLoadBalance\020\021\022\023\n\017PrivilegeImport\020\022\022\034\n" "\n\016PrivilegeFlush\020\017\022\022\n\016PrivilegeQuery\020\020\022\030"
"\030PrivilegeCreateOwnership\020\023\022\027\n\023Privilege" "\n\024PrivilegeLoadBalance\020\021\022\023\n\017PrivilegeImp"
"UpdateUser\020\024\022\032\n\026PrivilegeDropOwnership\020\025" "ort\020\022\022\034\n\030PrivilegeCreateOwnership\020\023\022\027\n\023P"
"\022\034\n\030PrivilegeSelectOwnership\020\026\022\034\n\030Privil" "rivilegeUpdateUser\020\024\022\032\n\026PrivilegeDropOwn"
"egeManageOwnership\020\027\022\027\n\023PrivilegeSelectU" "ership\020\025\022\034\n\030PrivilegeSelectOwnership\020\026\022\034"
"ser\020\030\022\023\n\017PrivilegeUpsert\020\031\022 \n\034PrivilegeC" "\n\030PrivilegeManageOwnership\020\027\022\027\n\023Privileg"
"reateResourceGroup\020\032\022\036\n\032PrivilegeDropRes" "eSelectUser\020\030\022\023\n\017PrivilegeUpsert\020\031\022 \n\034Pr"
"ourceGroup\020\033\022\"\n\036PrivilegeDescribeResourc" "ivilegeCreateResourceGroup\020\032\022\036\n\032Privileg"
"eGroup\020\034\022\037\n\033PrivilegeListResourceGroups\020" "eDropResourceGroup\020\033\022\"\n\036PrivilegeDescrib"
"\035\022\031\n\025PrivilegeTransferNode\020\036\022\034\n\030Privileg" "eResourceGroup\020\034\022\037\n\033PrivilegeListResourc"
"eTransferReplica\020\037*S\n\tStateCode\022\020\n\014Initi" "eGroups\020\035\022\031\n\025PrivilegeTransferNode\020\036\022\034\n\030"
"alizing\020\000\022\013\n\007Healthy\020\001\022\014\n\010Abnormal\020\002\022\013\n\007" "PrivilegeTransferReplica\020\037\022\037\n\033PrivilegeG"
"StandBy\020\003\022\014\n\010Stopping\020\004*c\n\tLoadState\022\025\n\021" "etLoadingProgress\020 \022\031\n\025PrivilegeGetLoadS"
"LoadStateNotExist\020\000\022\024\n\020LoadStateNotLoad\020" "tate\020!*S\n\tStateCode\022\020\n\014Initializing\020\000\022\013\n"
"\001\022\024\n\020LoadStateLoading\020\002\022\023\n\017LoadStateLoad" "\007Healthy\020\001\022\014\n\010Abnormal\020\002\022\013\n\007StandBy\020\003\022\014\n"
"ed\020\003:^\n\021privilege_ext_obj\022\037.google.proto" "\010Stopping\020\004*c\n\tLoadState\022\025\n\021LoadStateNot"
"buf.MessageOptions\030\351\007 \001(\0132!.milvus.proto" "Exist\020\000\022\024\n\020LoadStateNotLoad\020\001\022\024\n\020LoadSta"
".common.PrivilegeExtBf\n\016io.milvus.grpcB\013" "teLoading\020\002\022\023\n\017LoadStateLoaded\020\003:^\n\021priv"
"CommonProtoP\001Z1github.com/milvus-io/milv" "ilege_ext_obj\022\037.google.protobuf.MessageO"
"us-proto/go-api/commonpb\240\001\001\252\002\016IO.Milvus." "ptions\030\351\007 \001(\0132!.milvus.proto.common.Priv"
"Grpcb\006proto3" "ilegeExtBf\n\016io.milvus.grpcB\013CommonProtoP"
"\001Z1github.com/milvus-io/milvus-proto/go-"
"api/commonpb\240\001\001\252\002\016IO.Milvus.Grpcb\006proto3"
; ;
static const ::_pbi::DescriptorTable* const descriptor_table_common_2eproto_deps[1] = { static const ::_pbi::DescriptorTable* const descriptor_table_common_2eproto_deps[1] = {
&::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, &::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto,
}; };
static ::_pbi::once_flag descriptor_table_common_2eproto_once; static ::_pbi::once_flag descriptor_table_common_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_common_2eproto = { const ::_pbi::DescriptorTable descriptor_table_common_2eproto = {
false, false, 6052, descriptor_table_protodef_common_2eproto, false, false, 6160, descriptor_table_protodef_common_2eproto,
"common.proto", "common.proto",
&descriptor_table_common_2eproto_once, descriptor_table_common_2eproto_deps, 1, 11, &descriptor_table_common_2eproto_once, descriptor_table_common_2eproto_deps, 1, 11,
schemas, file_default_instances, TableStruct_common_2eproto::offsets, schemas, file_default_instances, TableStruct_common_2eproto::offsets,
@ -544,6 +546,8 @@ bool ErrorCode_IsValid(int value) {
case 53: case 53:
case 54: case 54:
case 55: case 55:
case 56:
case 57:
case 100: case 100:
case 1000: case 1000:
return true; return true;
@ -824,6 +828,8 @@ bool ObjectPrivilege_IsValid(int value) {
case 29: case 29:
case 30: case 30:
case 31: case 31:
case 32:
case 33:
return true; return true;
default: default:
return false; return false;

View File

@ -158,6 +158,8 @@ enum ErrorCode : int {
MemoryQuotaExhausted = 53, MemoryQuotaExhausted = 53,
DiskQuotaExhausted = 54, DiskQuotaExhausted = 54,
TimeTickLongDelay = 55, TimeTickLongDelay = 55,
NotReadyServe = 56,
NotReadyCoordActivating = 57,
DataCoordNA = 100, DataCoordNA = 100,
DDRequestRace = 1000, DDRequestRace = 1000,
ErrorCode_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::min(), ErrorCode_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::min(),
@ -548,12 +550,14 @@ enum ObjectPrivilege : int {
PrivilegeListResourceGroups = 29, PrivilegeListResourceGroups = 29,
PrivilegeTransferNode = 30, PrivilegeTransferNode = 30,
PrivilegeTransferReplica = 31, PrivilegeTransferReplica = 31,
PrivilegeGetLoadingProgress = 32,
PrivilegeGetLoadState = 33,
ObjectPrivilege_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::min(), ObjectPrivilege_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::min(),
ObjectPrivilege_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::max() ObjectPrivilege_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::max()
}; };
bool ObjectPrivilege_IsValid(int value); bool ObjectPrivilege_IsValid(int value);
constexpr ObjectPrivilege ObjectPrivilege_MIN = PrivilegeAll; constexpr ObjectPrivilege ObjectPrivilege_MIN = PrivilegeAll;
constexpr ObjectPrivilege ObjectPrivilege_MAX = PrivilegeTransferReplica; constexpr ObjectPrivilege ObjectPrivilege_MAX = PrivilegeGetLoadState;
constexpr int ObjectPrivilege_ARRAYSIZE = ObjectPrivilege_MAX + 1; constexpr int ObjectPrivilege_ARRAYSIZE = ObjectPrivilege_MAX + 1;
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ObjectPrivilege_descriptor(); const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ObjectPrivilege_descriptor();

View File

@ -56,6 +56,8 @@ func TestPrivilegeInterceptor(t *testing.T) {
PolicyInfos: []string{ PolicyInfos: []string{
funcutil.PolicyForPrivilege("role1", commonpb.ObjectType_Collection.String(), "col1", commonpb.ObjectPrivilege_PrivilegeLoad.String()), funcutil.PolicyForPrivilege("role1", commonpb.ObjectType_Collection.String(), "col1", commonpb.ObjectPrivilege_PrivilegeLoad.String()),
funcutil.PolicyForPrivilege("role1", commonpb.ObjectType_Collection.String(), "col1", commonpb.ObjectPrivilege_PrivilegeFlush.String()), funcutil.PolicyForPrivilege("role1", commonpb.ObjectType_Collection.String(), "col1", commonpb.ObjectPrivilege_PrivilegeFlush.String()),
funcutil.PolicyForPrivilege("role1", commonpb.ObjectType_Collection.String(), "col1", commonpb.ObjectPrivilege_PrivilegeGetLoadState.String()),
funcutil.PolicyForPrivilege("role1", commonpb.ObjectType_Collection.String(), "col1", commonpb.ObjectPrivilege_PrivilegeGetLoadingProgress.String()),
funcutil.PolicyForPrivilege("role2", commonpb.ObjectType_Global.String(), "*", commonpb.ObjectPrivilege_PrivilegeAll.String()), funcutil.PolicyForPrivilege("role2", commonpb.ObjectType_Global.String(), "*", commonpb.ObjectPrivilege_PrivilegeAll.String()),
}, },
UserRoles: []string{ UserRoles: []string{
@ -89,8 +91,17 @@ func TestPrivilegeInterceptor(t *testing.T) {
CollectionName: "col1", CollectionName: "col1",
}) })
assert.Nil(t, err) assert.Nil(t, err)
_, err = PrivilegeInterceptor(ctx, &milvuspb.GetLoadingProgressRequest{
CollectionName: "col1",
})
assert.Nil(t, err)
_, err = PrivilegeInterceptor(ctx, &milvuspb.GetLoadStateRequest{
CollectionName: "col1",
})
assert.Nil(t, err)
_, err = PrivilegeInterceptor(GetContext(context.Background(), "foo:123456"), &milvuspb.LoadCollectionRequest{ fooCtx := GetContext(context.Background(), "foo:123456")
_, err = PrivilegeInterceptor(fooCtx, &milvuspb.LoadCollectionRequest{
DbName: "db_test", DbName: "db_test",
CollectionName: "col1", CollectionName: "col1",
}) })
@ -100,6 +111,14 @@ func TestPrivilegeInterceptor(t *testing.T) {
CollectionName: "col1", CollectionName: "col1",
}) })
assert.NotNil(t, err) assert.NotNil(t, err)
_, err = PrivilegeInterceptor(fooCtx, &milvuspb.GetLoadingProgressRequest{
CollectionName: "col1",
})
assert.NotNil(t, err)
_, err = PrivilegeInterceptor(fooCtx, &milvuspb.GetLoadStateRequest{
CollectionName: "col1",
})
assert.NotNil(t, err)
_, err = PrivilegeInterceptor(ctx, &milvuspb.FlushRequest{ _, err = PrivilegeInterceptor(ctx, &milvuspb.FlushRequest{
DbName: "db_test", DbName: "db_test",

View File

@ -81,6 +81,9 @@ var (
MetaStore2API(commonpb.ObjectPrivilege_PrivilegeQuery.String()), MetaStore2API(commonpb.ObjectPrivilege_PrivilegeQuery.String()),
MetaStore2API(commonpb.ObjectPrivilege_PrivilegeLoadBalance.String()), MetaStore2API(commonpb.ObjectPrivilege_PrivilegeLoadBalance.String()),
MetaStore2API(commonpb.ObjectPrivilege_PrivilegeImport.String()), MetaStore2API(commonpb.ObjectPrivilege_PrivilegeImport.String()),
MetaStore2API(commonpb.ObjectPrivilege_PrivilegeGetLoadingProgress.String()),
MetaStore2API(commonpb.ObjectPrivilege_PrivilegeGetLoadState.String()),
}, },
commonpb.ObjectType_Global.String(): { commonpb.ObjectType_Global.String(): {
MetaStore2API(commonpb.ObjectPrivilege_PrivilegeAll.String()), MetaStore2API(commonpb.ObjectPrivilege_PrivilegeAll.String()),