Skip to content

Commit 96d0f7f

Browse files
authored
[CP-168] Add requires_all_permissions extension for permissions (#115)
1 parent 390105b commit 96d0f7f

6 files changed

Lines changed: 84 additions & 29 deletions

File tree

gen/go/qdrant/cloud/common/v1/common.pb.go

Lines changed: 46 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/python/qdrant/cloud/common/v1/common_pb2.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/python/qdrant/cloud/common/v1/common_pb2.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ REQUIRES_AUTHENTICATION_FIELD_NUMBER: _ClassVar[int]
2525
requires_authentication: _descriptor.FieldDescriptor
2626
SUPPORTED_ACTOR_TYPES_FIELD_NUMBER: _ClassVar[int]
2727
supported_actor_types: _descriptor.FieldDescriptor
28+
REQUIRES_ALL_PERMISSIONS_FIELD_NUMBER: _ClassVar[int]
29+
requires_all_permissions: _descriptor.FieldDescriptor
2830

2931
class Version(_message.Message):
3032
__slots__ = ("major", "minor", "patch")

gen/typescript/qdrant/cloud/common/v1/common_pb.d.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ export enum ActorType {
146146
export declare const ActorTypeSchema: GenEnum<ActorType>;
147147

148148
/**
149-
* A list of permissions which ALL need to be met by the current user.
149+
* A list of permissions which need to be met by the current user.
150+
* If `requires_all_permissions` is true (or missing): ALL of the permissions should be met (and)
151+
* If `requires_all_permissions` is false: ANY-OF the permissions should be met (or)
150152
*
151153
* @generated from extension: repeated string permissions = 50001;
152154
*/
@@ -176,3 +178,11 @@ export declare const requires_authentication: GenExtension<MethodOptions, boolea
176178
*/
177179
export declare const supported_actor_types: GenExtension<MethodOptions, ActorType[]>;
178180

181+
/**
182+
* If set to true the provided permissions are ALL (and)
183+
* if set to false the provided permissions are ANY-OF (or).
184+
*
185+
* @generated from extension: bool requires_all_permissions = 50005;
186+
*/
187+
export declare const requires_all_permissions: GenExtension<MethodOptions, boolean>;
188+

gen/typescript/qdrant/cloud/common/v1/common_pb.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt";
1010
* Describes the file qdrant/cloud/common/v1/common.proto.
1111
*/
1212
export const file_qdrant_cloud_common_v1_common = /*@__PURE__*/
13-
fileDesc("CiNxZHJhbnQvY2xvdWQvY29tbW9uL3YxL2NvbW1vbi5wcm90bxIWcWRyYW50LmNsb3VkLmNvbW1vbi52MSI2CgdWZXJzaW9uEg0KBW1ham9yGAEgASgNEg0KBW1pbm9yGAIgASgNEg0KBXBhdGNoGAMgASgNImIKDFNlY3JldEtleVJlZhI5CgRuYW1lGAEgASgJQiu6SChyJhABGP0BMh9eW2EtejAtOV0oWy1hLXowLTldKlthLXowLTldKT8kEhcKA2tleRgCIAEoCUIKukgHcgUQARiACCKnAQoIS2V5VmFsdWUSgQEKA2tleRgBIAEoCUJ0ukhxcm8YPzJrXigoW2EtekEtWjAtOV18W2EtekEtWjAtOV1bYS16QS1aMC05XC1dKlthLXpBLVowLTldKVwuKSooW0EtWmEtejAtOV18W0EtWmEtejAtOV1bQS1aYS16MC05XC1dKltBLVphLXowLTldKSQSFwoFdmFsdWUYAiABKAlCCLpIBXIDGIAIKnsKCUFjdG9yVHlwZRIaChZBQ1RPUl9UWVBFX1VOU1BFQ0lGSUVEEAASEwoPQUNUT1JfVFlQRV9VU0VSEAESHQoZQUNUT1JfVFlQRV9NQU5BR0VNRU5UX0tFWRACEh4KGkFDVE9SX1RZUEVfU0VSVklDRV9BQ0NPVU5UEAM6QgoLcGVybWlzc2lvbnMSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxjRhgMgAygJUgtwZXJtaXNzaW9uczpUChVhY2NvdW50X2lkX2V4cHJlc3Npb24SHi5nb29nbGUucHJvdG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WRyYW50LWNsb3VkLXB1YmxpYy1hcGkvZ2VuL2dvL3FkcmFudC9jbG91ZC9jb21tb24vdjE7Y29tbW9udjGiAgNRQ0OqAhZRZHJhbnQuQ2xvdWQuQ29tbW9uLlYxygIWUWRyYW50XENsb3VkXENvbW1vblxWMeICIlFkcmFudFxDbG91ZFxDb21tb25cVjFcR1BCTWV0YWRhdGHqAhlRZHJhbnQ6OkNsb3VkOjpDb21tb246OlYxYgZwcm90bzM", [file_buf_validate_validate, file_google_protobuf_descriptor]);
1414

1515
/**
1616
* Describes the message qdrant.cloud.common.v1.Version.
@@ -48,7 +48,9 @@ export const ActorType = /*@__PURE__*/
4848
tsEnum(ActorTypeSchema);
4949

5050
/**
51-
* A list of permissions which ALL need to be met by the current user.
51+
* A list of permissions which need to be met by the current user.
52+
* If `requires_all_permissions` is true (or missing): ALL of the permissions should be met (and)
53+
* If `requires_all_permissions` is false: ANY-OF the permissions should be met (or)
5254
*
5355
* @generated from extension: repeated string permissions = 50001;
5456
*/
@@ -82,3 +84,12 @@ export const requires_authentication = /*@__PURE__*/
8284
export const supported_actor_types = /*@__PURE__*/
8385
extDesc(file_qdrant_cloud_common_v1_common, 3);
8486

87+
/**
88+
* If set to true the provided permissions are ALL (and)
89+
* if set to false the provided permissions are ANY-OF (or).
90+
*
91+
* @generated from extension: bool requires_all_permissions = 50005;
92+
*/
93+
export const requires_all_permissions = /*@__PURE__*/
94+
extDesc(file_qdrant_cloud_common_v1_common, 4);
95+

proto/qdrant/cloud/common/v1/common.proto

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import "google/protobuf/descriptor.proto";
77

88
// The extension for adding permissions to the system
99
extend google.protobuf.MethodOptions {
10-
// A list of permissions which ALL need to be met by the current user.
10+
// A list of permissions which need to be met by the current user.
11+
// If `requires_all_permissions` is true (or missing): ALL of the permissions should be met (and)
12+
// If `requires_all_permissions` is false: ANY-OF the permissions should be met (or)
1113
repeated string permissions = 50001;
1214
}
1315

@@ -41,6 +43,14 @@ extend google.protobuf.MethodOptions {
4143
];
4244
}
4345

46+
// The extension for switching `permissions` from ALL to ANY-OF
47+
// If the extension is missing 'true' will be used (defaulting to ALL).
48+
extend google.protobuf.MethodOptions {
49+
// If set to true the provided permissions are ALL (and)
50+
// if set to false the provided permissions are ANY-OF (or).
51+
bool requires_all_permissions = 50005;
52+
}
53+
4454
// ActorType specifies the type of actor that can call a method.
4555
enum ActorType {
4656
// Default, unspecified actor type. Should generally not be used explicitly in options

0 commit comments

Comments
 (0)