Skip to content

Commit 6cfaede

Browse files
author
Toni Reina
authored
[CP-199] Update validations for AccountService.Account (#125)
* Update validations for `AccountService.Account` - Align the validation for the name field with what the system is using. - Remove the validation for UUID for `owner_id`. At this moment this field doesn't refer to the UUID of a user, it refers to the identifier of the external provider (auth0). * Rename `Account.owner_id` to `Account.external_owner_id` With this new field we make explicit that it refers to the id of the external identity provider. Also, we reserve `owner_id` for the future.
1 parent 617ac41 commit 6cfaede

7 files changed

Lines changed: 43 additions & 45 deletions

File tree

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

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

gen/openapiv2/qdrant/cloud/account/v1/account.swagger.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -606,13 +606,13 @@
606606
"type": "string",
607607
"title": "The name of the account.\nName can only contain letters, numbers, underscores and dashes"
608608
},
609-
"ownerId": {
609+
"externalOwnerId": {
610610
"type": "string",
611-
"description": "The Identifier of the owner of the account (in GUID format).\nThe owner must be a member of the account when updating."
611+
"description": "The external identifier of the owner of the account."
612612
},
613613
"ownerEmail": {
614614
"type": "string",
615-
"description": "The email address of the owner of the account.\nThis is a read-only field and will be derived from the owner_id field."
615+
"description": "The email address of the owner of the account.\nThis is a read-only field and is derived from the owner user."
616616
},
617617
"privileges": {
618618
"type": "array",
@@ -687,13 +687,13 @@
687687
"type": "string",
688688
"title": "The name of the account.\nName can only contain letters, numbers, underscores and dashes"
689689
},
690-
"ownerId": {
690+
"externalOwnerId": {
691691
"type": "string",
692-
"description": "The Identifier of the owner of the account (in GUID format).\nThe owner must be a member of the account when updating."
692+
"description": "The external identifier of the owner of the account."
693693
},
694694
"ownerEmail": {
695695
"type": "string",
696-
"description": "The email address of the owner of the account.\nThis is a read-only field and will be derived from the owner_id field."
696+
"description": "The email address of the owner of the account.\nThis is a read-only field and is derived from the owner user."
697697
},
698698
"privileges": {
699699
"type": "array",

gen/python/qdrant/cloud/account/v1/account_pb2.py

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

gen/python/qdrant/cloud/account/v1/account_pb2.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,22 +210,22 @@ class DeleteAccountMemberResponse(_message.Message):
210210
def __init__(self) -> None: ...
211211

212212
class Account(_message.Message):
213-
__slots__ = ("id", "created_at", "last_modified_at", "name", "owner_id", "owner_email", "privileges")
213+
__slots__ = ("id", "created_at", "last_modified_at", "name", "external_owner_id", "owner_email", "privileges")
214214
ID_FIELD_NUMBER: _ClassVar[int]
215215
CREATED_AT_FIELD_NUMBER: _ClassVar[int]
216216
LAST_MODIFIED_AT_FIELD_NUMBER: _ClassVar[int]
217217
NAME_FIELD_NUMBER: _ClassVar[int]
218-
OWNER_ID_FIELD_NUMBER: _ClassVar[int]
218+
EXTERNAL_OWNER_ID_FIELD_NUMBER: _ClassVar[int]
219219
OWNER_EMAIL_FIELD_NUMBER: _ClassVar[int]
220220
PRIVILEGES_FIELD_NUMBER: _ClassVar[int]
221221
id: str
222222
created_at: _timestamp_pb2.Timestamp
223223
last_modified_at: _timestamp_pb2.Timestamp
224224
name: str
225-
owner_id: str
225+
external_owner_id: str
226226
owner_email: str
227227
privileges: _containers.RepeatedScalarFieldContainer[str]
228-
def __init__(self, id: _Optional[str] = ..., created_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., last_modified_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., name: _Optional[str] = ..., owner_id: _Optional[str] = ..., owner_email: _Optional[str] = ..., privileges: _Optional[_Iterable[str]] = ...) -> None: ...
228+
def __init__(self, id: _Optional[str] = ..., created_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., last_modified_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., name: _Optional[str] = ..., external_owner_id: _Optional[str] = ..., owner_email: _Optional[str] = ..., privileges: _Optional[_Iterable[str]] = ...) -> None: ...
229229

230230
class AccountInvite(_message.Message):
231231
__slots__ = ("id", "account_id", "account_name", "user_email", "user_role_ids", "created_at", "created_by_user_id", "created_by_email", "last_modified_at", "status")

gen/typescript/qdrant/cloud/account/v1/account_pb.d.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -695,16 +695,15 @@ export declare type Account = Message<"qdrant.cloud.account.v1.Account"> & {
695695
name: string;
696696

697697
/**
698-
* The Identifier of the owner of the account (in GUID format).
699-
* The owner must be a member of the account when updating.
698+
* The external identifier of the owner of the account.
700699
*
701-
* @generated from field: string owner_id = 6;
700+
* @generated from field: string external_owner_id = 6;
702701
*/
703-
ownerId: string;
702+
externalOwnerId: string;
704703

705704
/**
706705
* The email address of the owner of the account.
707-
* This is a read-only field and will be derived from the owner_id field.
706+
* This is a read-only field and is derived from the owner user.
708707
*
709708
* @generated from field: string owner_email = 7;
710709
*/

gen/typescript/qdrant/cloud/account/v1/account_pb.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

proto/qdrant/cloud/account/v1/account.proto

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,15 +417,14 @@ message Account {
417417
// The name of the account.
418418
// Name can only contain letters, numbers, underscores and dashes
419419
string name = 5 [(buf.validate.field).string = {
420-
max_len: 64
420+
max_len: 256
421421
min_len: 4
422-
pattern: "^[a-zA-Z0-9-_]+$"
422+
pattern: "^[\\w\\s-]+$"
423423
}];
424-
// The Identifier of the owner of the account (in GUID format).
425-
// The owner must be a member of the account when updating.
426-
string owner_id = 6 [(buf.validate.field).string = {uuid: true}];
424+
// The external identifier of the owner of the account.
425+
string external_owner_id = 6 [(buf.validate.field).string = {min_len: 1}];
427426
// The email address of the owner of the account.
428-
// This is a read-only field and will be derived from the owner_id field.
427+
// This is a read-only field and is derived from the owner user.
429428
string owner_email = 7 [(buf.validate.field).string = {email: true}];
430429
// The privileges of the account, if any.
431430
// This is a read-only field.

0 commit comments

Comments
 (0)