meshtrade 1.23.1__py3-none-any.whl → 1.25.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of meshtrade might be problematic. Click here for more details.

@@ -55,13 +55,6 @@ from .service_meshpy import (
55
55
  #
56
56
  # ===================================================================
57
57
 
58
- from .client_roles import (
59
- get_client_default_role_index,
60
- get_client_default_roles,
61
- must_get_client_default_role_index,
62
- must_get_client_default_roles,
63
- )
64
-
65
58
  # ===================================================================
66
59
  # MODULE EXPORTS
67
60
  # ===================================================================
@@ -91,9 +84,4 @@ __all__ = [
91
84
  "TaxResidency",
92
85
  "Trust",
93
86
  "VerificationStatus",
94
- # Manual exports
95
- "get_client_default_role_index",
96
- "get_client_default_roles",
97
- "must_get_client_default_role_index",
98
- "must_get_client_default_roles",
99
87
  ]
@@ -25,14 +25,13 @@ _sym_db = _symbol_database.Default()
25
25
  from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2
26
26
  from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
27
27
  from meshtrade.compliance.client.v1 import company_pb2 as meshtrade_dot_compliance_dot_client_dot_v1_dot_company__pb2
28
- from meshtrade.iam.role.v1 import role_pb2 as meshtrade_dot_iam_dot_role_dot_v1_dot_role__pb2
29
28
  from meshtrade.compliance.client.v1 import fund_pb2 as meshtrade_dot_compliance_dot_client_dot_v1_dot_fund__pb2
30
29
  from meshtrade.compliance.client.v1 import natural_person_pb2 as meshtrade_dot_compliance_dot_client_dot_v1_dot_natural__person__pb2
31
30
  from meshtrade.compliance.client.v1 import trust_pb2 as meshtrade_dot_compliance_dot_client_dot_v1_dot_trust__pb2
32
31
  from meshtrade.compliance.client.v1 import verification_status_pb2 as meshtrade_dot_compliance_dot_client_dot_v1_dot_verification__status__pb2
33
32
 
34
33
 
35
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+meshtrade/compliance/client/v1/client.proto\x12\x1emeshtrade.compliance.client.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a,meshtrade/compliance/client/v1/company.proto\x1a meshtrade/iam/role/v1/role.proto\x1a)meshtrade/compliance/client/v1/fund.proto\x1a\x33meshtrade/compliance/client/v1/natural_person.proto\x1a*meshtrade/compliance/client/v1/trust.proto\x1a\x38meshtrade/compliance/client/v1/verification_status.proto\"\xec\t\n\x06\x43lient\x12\xbe\x01\n\x04name\x18\x01 \x01(\tB\xa9\x01\xbaH\xa5\x01\xba\x01\xa1\x01\n\x14name.format.optional\x12\x34name must be empty or in the format clients/{ULIDv2}\x1aSsize(this) == 0 || this.matches(\'^clients/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')R\x04name\x12R\n\x05owner\x18\x02 \x01(\tB<\xbaH9r42/^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01!\xc8\x01\x01R\x05owner\x12\x30\n\x0c\x64isplay_name\x18\x03 \x01(\tB\r\xbaH\nr\x05\x10\x01\x18\xff\x01\xc8\x01\x01R\x0b\x64isplayName\x12V\n\x0enatural_person\x18\x04 \x01(\x0b\x32-.meshtrade.compliance.client.v1.NaturalPersonH\x00R\rnaturalPerson\x12\x43\n\x07\x63ompany\x18\x05 \x01(\x0b\x32\'.meshtrade.compliance.client.v1.CompanyH\x00R\x07\x63ompany\x12:\n\x04\x66und\x18\x06 \x01(\x0b\x32$.meshtrade.compliance.client.v1.FundH\x00R\x04\x66und\x12=\n\x05trust\x18\x07 \x01(\x0b\x32%.meshtrade.compliance.client.v1.TrustH\x00R\x05trust\x12p\n\x13verification_status\x18\x08 \x01(\x0e\x32\x32.meshtrade.compliance.client.v1.VerificationStatusB\x0b\xbaH\x08\x82\x01\x02\x10\x01\xc8\x01\x01R\x12verificationStatus\x12\x85\x02\n\x16verification_authority\x18\t \x01(\tB\xcd\x01\xbaH\xc9\x01\xba\x01\xc5\x01\n&verification_authority.format.optional\x12\x46verification_authority must be empty or in the format clients/{ULIDv2}\x1aSsize(this) == 0 || this.matches(\'^clients/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')R\x15verificationAuthority\x12G\n\x11verification_date\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x10verificationDate\x12P\n\x16next_verification_date\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x14nextVerificationDate\x12\x43\n\x05roles\x18\x0c \x03(\x0e\x32\x1b.meshtrade.iam.role.v1.RoleB\x10\xbaH\r\x92\x01\x07\"\x05\x82\x01\x02\x10\x01\xc8\x01\x01R\x05roles:\x19\xb2\xb5\x18\x15\n\x13\x83\x89z\xc1\x8d\xb7\x01\xc3\x8d\xb7\x01\xc5\x8d\xb7\x01\xc7\x8d\xb7\x01\x42\x0e\n\x0clegal_personBc\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1b\x06proto3')
34
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+meshtrade/compliance/client/v1/client.proto\x12\x1emeshtrade.compliance.client.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a,meshtrade/compliance/client/v1/company.proto\x1a)meshtrade/compliance/client/v1/fund.proto\x1a\x33meshtrade/compliance/client/v1/natural_person.proto\x1a*meshtrade/compliance/client/v1/trust.proto\x1a\x38meshtrade/compliance/client/v1/verification_status.proto\"\x8c\t\n\x06\x43lient\x12\xbe\x01\n\x04name\x18\x01 \x01(\tB\xa9\x01\xbaH\xa5\x01\xba\x01\xa1\x01\n\x14name.format.optional\x12\x34name must be empty or in the format clients/{ULIDv2}\x1aSsize(this) == 0 || this.matches(\'^clients/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')R\x04name\x12R\n\x05owner\x18\x02 \x01(\tB<\xbaH9r42/^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01!\xc8\x01\x01R\x05owner\x12\x30\n\x0c\x64isplay_name\x18\x03 \x01(\tB\r\xbaH\nr\x05\x10\x01\x18\xff\x01\xc8\x01\x01R\x0b\x64isplayName\x12V\n\x0enatural_person\x18\x04 \x01(\x0b\x32-.meshtrade.compliance.client.v1.NaturalPersonH\x00R\rnaturalPerson\x12\x43\n\x07\x63ompany\x18\x05 \x01(\x0b\x32\'.meshtrade.compliance.client.v1.CompanyH\x00R\x07\x63ompany\x12:\n\x04\x66und\x18\x06 \x01(\x0b\x32$.meshtrade.compliance.client.v1.FundH\x00R\x04\x66und\x12=\n\x05trust\x18\x07 \x01(\x0b\x32%.meshtrade.compliance.client.v1.TrustH\x00R\x05trust\x12p\n\x13verification_status\x18\x08 \x01(\x0e\x32\x32.meshtrade.compliance.client.v1.VerificationStatusB\x0b\xbaH\x08\x82\x01\x02\x10\x01\xc8\x01\x01R\x12verificationStatus\x12\x85\x02\n\x16verification_authority\x18\t \x01(\tB\xcd\x01\xbaH\xc9\x01\xba\x01\xc5\x01\n&verification_authority.format.optional\x12\x46verification_authority must be empty or in the format clients/{ULIDv2}\x1aSsize(this) == 0 || this.matches(\'^clients/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')R\x15verificationAuthority\x12G\n\x11verification_date\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x10verificationDate\x12P\n\x16next_verification_date\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x14nextVerificationDateB\x0e\n\x0clegal_personBc\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1b\x06proto3')
36
35
 
37
36
  _globals = globals()
38
37
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -50,10 +49,6 @@ if not _descriptor._USE_C_DESCRIPTORS:
50
49
  _globals['_CLIENT'].fields_by_name['verification_status']._serialized_options = b'\272H\010\202\001\002\020\001\310\001\001'
51
50
  _globals['_CLIENT'].fields_by_name['verification_authority']._loaded_options = None
52
51
  _globals['_CLIENT'].fields_by_name['verification_authority']._serialized_options = b'\272H\311\001\272\001\305\001\n&verification_authority.format.optional\022Fverification_authority must be empty or in the format clients/{ULIDv2}\032Ssize(this) == 0 || this.matches(\'^clients/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')'
53
- _globals['_CLIENT'].fields_by_name['roles']._loaded_options = None
54
- _globals['_CLIENT'].fields_by_name['roles']._serialized_options = b'\272H\r\222\001\007\"\005\202\001\002\020\001\310\001\001'
55
- _globals['_CLIENT']._loaded_options = None
56
- _globals['_CLIENT']._serialized_options = b'\262\265\030\025\n\023\203\211z\301\215\267\001\303\215\267\001\305\215\267\001\307\215\267\001'
57
- _globals['_CLIENT']._serialized_start=420
58
- _globals['_CLIENT']._serialized_end=1680
52
+ _globals['_CLIENT']._serialized_start=386
53
+ _globals['_CLIENT']._serialized_end=1550
59
54
  # @@protoc_insertion_point(module_scope)
@@ -3,21 +3,19 @@ import datetime
3
3
  from buf.validate import validate_pb2 as _validate_pb2
4
4
  from google.protobuf import timestamp_pb2 as _timestamp_pb2
5
5
  from meshtrade.compliance.client.v1 import company_pb2 as _company_pb2
6
- from meshtrade.iam.role.v1 import role_pb2 as _role_pb2
7
6
  from meshtrade.compliance.client.v1 import fund_pb2 as _fund_pb2
8
7
  from meshtrade.compliance.client.v1 import natural_person_pb2 as _natural_person_pb2
9
8
  from meshtrade.compliance.client.v1 import trust_pb2 as _trust_pb2
10
9
  from meshtrade.compliance.client.v1 import verification_status_pb2 as _verification_status_pb2
11
- from google.protobuf.internal import containers as _containers
12
10
  from google.protobuf import descriptor as _descriptor
13
11
  from google.protobuf import message as _message
14
- from collections.abc import Iterable as _Iterable, Mapping as _Mapping
12
+ from collections.abc import Mapping as _Mapping
15
13
  from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
16
14
 
17
15
  DESCRIPTOR: _descriptor.FileDescriptor
18
16
 
19
17
  class Client(_message.Message):
20
- __slots__ = ("name", "owner", "display_name", "natural_person", "company", "fund", "trust", "verification_status", "verification_authority", "verification_date", "next_verification_date", "roles")
18
+ __slots__ = ("name", "owner", "display_name", "natural_person", "company", "fund", "trust", "verification_status", "verification_authority", "verification_date", "next_verification_date")
21
19
  NAME_FIELD_NUMBER: _ClassVar[int]
22
20
  OWNER_FIELD_NUMBER: _ClassVar[int]
23
21
  DISPLAY_NAME_FIELD_NUMBER: _ClassVar[int]
@@ -29,7 +27,6 @@ class Client(_message.Message):
29
27
  VERIFICATION_AUTHORITY_FIELD_NUMBER: _ClassVar[int]
30
28
  VERIFICATION_DATE_FIELD_NUMBER: _ClassVar[int]
31
29
  NEXT_VERIFICATION_DATE_FIELD_NUMBER: _ClassVar[int]
32
- ROLES_FIELD_NUMBER: _ClassVar[int]
33
30
  name: str
34
31
  owner: str
35
32
  display_name: str
@@ -41,5 +38,4 @@ class Client(_message.Message):
41
38
  verification_authority: str
42
39
  verification_date: _timestamp_pb2.Timestamp
43
40
  next_verification_date: _timestamp_pb2.Timestamp
44
- roles: _containers.RepeatedScalarFieldContainer[_role_pb2.Role]
45
- def __init__(self, name: _Optional[str] = ..., owner: _Optional[str] = ..., display_name: _Optional[str] = ..., natural_person: _Optional[_Union[_natural_person_pb2.NaturalPerson, _Mapping]] = ..., company: _Optional[_Union[_company_pb2.Company, _Mapping]] = ..., fund: _Optional[_Union[_fund_pb2.Fund, _Mapping]] = ..., trust: _Optional[_Union[_trust_pb2.Trust, _Mapping]] = ..., verification_status: _Optional[_Union[_verification_status_pb2.VerificationStatus, str]] = ..., verification_authority: _Optional[str] = ..., verification_date: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., next_verification_date: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., roles: _Optional[_Iterable[_Union[_role_pb2.Role, str]]] = ...) -> None: ...
41
+ def __init__(self, name: _Optional[str] = ..., owner: _Optional[str] = ..., display_name: _Optional[str] = ..., natural_person: _Optional[_Union[_natural_person_pb2.NaturalPerson, _Mapping]] = ..., company: _Optional[_Union[_company_pb2.Company, _Mapping]] = ..., fund: _Optional[_Union[_fund_pb2.Fund, _Mapping]] = ..., trust: _Optional[_Union[_trust_pb2.Trust, _Mapping]] = ..., verification_status: _Optional[_Union[_verification_status_pb2.VerificationStatus, str]] = ..., verification_authority: _Optional[str] = ..., verification_date: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., next_verification_date: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ...
@@ -17,14 +17,14 @@ from .api_credentials_pb2 import APICredentials
17
17
  from .api_user_pb2 import APIUser, APIUserAction, APIUserState
18
18
  from .service_pb2 import (
19
19
  ActivateApiUserRequest,
20
- AssignRoleToAPIUserRequest,
20
+ AssignRolesToAPIUserRequest,
21
21
  CreateApiUserRequest,
22
22
  DeactivateApiUserRequest,
23
23
  GetApiUserByKeyHashRequest,
24
24
  GetApiUserRequest,
25
25
  ListApiUsersRequest,
26
26
  ListApiUsersResponse,
27
- RevokeRoleFromAPIUserRequest,
27
+ RevokeRolesFromAPIUserRequest,
28
28
  SearchApiUsersRequest,
29
29
  SearchApiUsersResponse,
30
30
  )
@@ -82,14 +82,14 @@ __all__ = [
82
82
  "ApiUserService",
83
83
  "ApiUserServiceGRPCClient",
84
84
  "ApiUserServiceGRPCClientInterface",
85
- "AssignRoleToAPIUserRequest",
85
+ "AssignRolesToAPIUserRequest",
86
86
  "CreateApiUserRequest",
87
87
  "DeactivateApiUserRequest",
88
88
  "GetApiUserByKeyHashRequest",
89
89
  "GetApiUserRequest",
90
90
  "ListApiUsersRequest",
91
91
  "ListApiUsersResponse",
92
- "RevokeRoleFromAPIUserRequest",
92
+ "RevokeRolesFromAPIUserRequest",
93
93
  "SearchApiUsersRequest",
94
94
  "SearchApiUsersResponse",
95
95
  # Manual exports
@@ -25,7 +25,7 @@ _sym_db = _symbol_database.Default()
25
25
  from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2
26
26
 
27
27
 
28
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(meshtrade/iam/api_user/v1/api_user.proto\x12\x19meshtrade.iam.api_user.v1\x1a\x1b\x62uf/validate/validate.proto\"\x97\x06\n\x07\x41PIUser\x12\xc2\x01\n\x04name\x18\x01 \x01(\tB\xad\x01\xbaH\xa9\x01\xba\x01\xa5\x01\n\x14name.format.optional\x12\x36name must be empty or in the format api_users/{ULIDv2}\x1aUsize(this) == 0 || this.matches(\'^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')R\x04name\x12R\n\x05owner\x18\x02 \x01(\tB<\xbaH9r42/^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01!\xc8\x01\x01R\x05owner\x12\xb4\x01\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x90\x01\xbaH\x8c\x01r\x05\x10\x01\x18\xff\x01\xba\x01\x7f\n\x15\x64isplay_name.required\x12\x41\x64isplay name is required and must be between 1 and 255 characters\x1a#size(this) > 0 && size(this) <= 255\xc8\x01\x01R\x0b\x64isplayName\x12\xbe\x01\n\x05state\x18\x05 \x01(\x0e\x32\'.meshtrade.iam.api_user.v1.APIUserStateB\x7f\xbaH|\x82\x01\x02\x10\x01\xba\x01t\n\x0bstate.valid\x12/state must be a valid APIUserState if specified\x1a\x34int(this) == 0 || (int(this) >= 1 && int(this) <= 2)R\x05state\x12\x62\n\x05roles\x18\x06 \x03(\tBL\xbaHI\x92\x01\x46\"DrB2=^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/[1-9][0-9]{6}$\x98\x01)R\x05roles\x12\x17\n\x07\x61pi_key\x18\x07 \x01(\tR\x06\x61piKey*f\n\x0c\x41PIUserState\x12\x1e\n\x1a\x41PI_USER_STATE_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41PI_USER_STATE_ACTIVE\x10\x01\x12\x1b\n\x17\x41PI_USER_STATE_INACTIVE\x10\x02*\xa6\x01\n\rAPIUserAction\x12\x1f\n\x1b\x41PI_USER_ACTION_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41PI_USER_ACTION_ACTIVATE\x10\x01\x12\x1e\n\x1a\x41PI_USER_ACTION_DEACTIVATE\x10\x02\x12\x1a\n\x16\x41PI_USER_ACTION_CREATE\x10\x03\x12\x1a\n\x16\x41PI_USER_ACTION_UPDATE\x10\x04\x42[\n co.meshtrade.api.iam.api_user.v1Z7github.com/meshtrade/api/go/iam/api_user/v1;api_user_v1b\x06proto3')
28
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(meshtrade/iam/api_user/v1/api_user.proto\x12\x19meshtrade.iam.api_user.v1\x1a\x1b\x62uf/validate/validate.proto\"\xa0\x06\n\x07\x41PIUser\x12\xc2\x01\n\x04name\x18\x01 \x01(\tB\xad\x01\xbaH\xa9\x01\xba\x01\xa5\x01\n\x14name.format.optional\x12\x36name must be empty or in the format api_users/{ULIDv2}\x1aUsize(this) == 0 || this.matches(\'^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')R\x04name\x12R\n\x05owner\x18\x02 \x01(\tB<\xbaH9r42/^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01!\xc8\x01\x01R\x05owner\x12\xb4\x01\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x90\x01\xbaH\x8c\x01r\x05\x10\x01\x18\xff\x01\xba\x01\x7f\n\x15\x64isplay_name.required\x12\x41\x64isplay name is required and must be between 1 and 255 characters\x1a#size(this) > 0 && size(this) <= 255\xc8\x01\x01R\x0b\x64isplayName\x12\xbe\x01\n\x05state\x18\x04 \x01(\x0e\x32\'.meshtrade.iam.api_user.v1.APIUserStateB\x7f\xbaH|\x82\x01\x02\x10\x01\xba\x01t\n\x0bstate.valid\x12/state must be a valid APIUserState if specified\x1a\x34int(this) == 0 || (int(this) >= 1 && int(this) <= 2)R\x05state\x12k\n\x05roles\x18\x05 \x03(\tBU\xbaHR\x92\x01O\"MrK\x10/\x18\x30\x32\x45^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$R\x05roles\x12\x17\n\x07\x61pi_key\x18\x06 \x01(\tR\x06\x61piKey*f\n\x0c\x41PIUserState\x12\x1e\n\x1a\x41PI_USER_STATE_UNSPECIFIED\x10\x00\x12\x19\n\x15\x41PI_USER_STATE_ACTIVE\x10\x01\x12\x1b\n\x17\x41PI_USER_STATE_INACTIVE\x10\x02*\xa6\x01\n\rAPIUserAction\x12\x1f\n\x1b\x41PI_USER_ACTION_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41PI_USER_ACTION_ACTIVATE\x10\x01\x12\x1e\n\x1a\x41PI_USER_ACTION_DEACTIVATE\x10\x02\x12\x1a\n\x16\x41PI_USER_ACTION_CREATE\x10\x03\x12\x1a\n\x16\x41PI_USER_ACTION_UPDATE\x10\x04\x42[\n co.meshtrade.api.iam.api_user.v1Z7github.com/meshtrade/api/go/iam/api_user/v1;api_user_v1b\x06proto3')
29
29
 
30
30
  _globals = globals()
31
31
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -42,11 +42,11 @@ if not _descriptor._USE_C_DESCRIPTORS:
42
42
  _globals['_APIUSER'].fields_by_name['state']._loaded_options = None
43
43
  _globals['_APIUSER'].fields_by_name['state']._serialized_options = b'\272H|\202\001\002\020\001\272\001t\n\013state.valid\022/state must be a valid APIUserState if specified\0324int(this) == 0 || (int(this) >= 1 && int(this) <= 2)'
44
44
  _globals['_APIUSER'].fields_by_name['roles']._loaded_options = None
45
- _globals['_APIUSER'].fields_by_name['roles']._serialized_options = b'\272HI\222\001F\"DrB2=^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/[1-9][0-9]{6}$\230\001)'
46
- _globals['_APIUSERSTATE']._serialized_start=894
47
- _globals['_APIUSERSTATE']._serialized_end=996
48
- _globals['_APIUSERACTION']._serialized_start=999
49
- _globals['_APIUSERACTION']._serialized_end=1165
45
+ _globals['_APIUSER'].fields_by_name['roles']._serialized_options = b'\272HR\222\001O\"MrK\020/\03002E^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$'
46
+ _globals['_APIUSERSTATE']._serialized_start=903
47
+ _globals['_APIUSERSTATE']._serialized_end=1005
48
+ _globals['_APIUSERACTION']._serialized_start=1008
49
+ _globals['_APIUSERACTION']._serialized_end=1174
50
50
  _globals['_APIUSER']._serialized_start=101
51
- _globals['_APIUSER']._serialized_end=892
51
+ _globals['_APIUSER']._serialized_end=901
52
52
  # @@protoc_insertion_point(module_scope)
@@ -20,14 +20,14 @@ from .api_user_pb2 import APIUser
20
20
  from meshtrade.common.service_options import ServiceOptions
21
21
  from .service_pb2 import (
22
22
  ActivateApiUserRequest,
23
- AssignRoleToAPIUserRequest,
23
+ AssignRolesToAPIUserRequest,
24
24
  CreateApiUserRequest,
25
25
  DeactivateApiUserRequest,
26
26
  GetApiUserByKeyHashRequest,
27
27
  GetApiUserRequest,
28
28
  ListApiUsersRequest,
29
29
  ListApiUsersResponse,
30
- RevokeRoleFromAPIUserRequest,
30
+ RevokeRolesFromAPIUserRequest,
31
31
  SearchApiUsersRequest,
32
32
  SearchApiUsersResponse,
33
33
  )
@@ -172,37 +172,37 @@ class ApiUserService(BaseGRPCClient):
172
172
  """
173
173
  return self._execute_method("CreateApiUser", request, timeout)
174
174
 
175
- def assign_role_to_apiuser(self, request: AssignRoleToAPIUserRequest, timeout: Optional[timedelta] = None) -> APIUser:
176
- """AssignRoleToAPIUser method.
175
+ def assign_roles_to_apiuser(self, request: AssignRolesToAPIUserRequest, timeout: Optional[timedelta] = None) -> APIUser:
176
+ """AssignRolesToAPIUser method.
177
177
 
178
178
  Args:
179
- request: The AssignRoleToAPIUser request message
179
+ request: The AssignRolesToAPIUser request message
180
180
  timeout: Optional timeout override for this call
181
181
 
182
182
  Returns:
183
- The AssignRoleToAPIUser response message
183
+ The AssignRolesToAPIUser response message
184
184
 
185
185
  Raises:
186
186
  grpc.RpcError: If the gRPC call fails
187
187
  ValueError: If authentication credentials are missing
188
188
  """
189
- return self._execute_method("AssignRoleToAPIUser", request, timeout)
189
+ return self._execute_method("AssignRolesToAPIUser", request, timeout)
190
190
 
191
- def revoke_role_from_apiuser(self, request: RevokeRoleFromAPIUserRequest, timeout: Optional[timedelta] = None) -> APIUser:
192
- """RevokeRoleFromAPIUser method.
191
+ def revoke_roles_from_apiuser(self, request: RevokeRolesFromAPIUserRequest, timeout: Optional[timedelta] = None) -> APIUser:
192
+ """RevokeRolesFromAPIUser method.
193
193
 
194
194
  Args:
195
- request: The RevokeRoleFromAPIUser request message
195
+ request: The RevokeRolesFromAPIUser request message
196
196
  timeout: Optional timeout override for this call
197
197
 
198
198
  Returns:
199
- The RevokeRoleFromAPIUser response message
199
+ The RevokeRolesFromAPIUser response message
200
200
 
201
201
  Raises:
202
202
  grpc.RpcError: If the gRPC call fails
203
203
  ValueError: If authentication credentials are missing
204
204
  """
205
- return self._execute_method("RevokeRoleFromAPIUser", request, timeout)
205
+ return self._execute_method("RevokeRolesFromAPIUser", request, timeout)
206
206
 
207
207
  def list_api_users(self, request: ListApiUsersRequest, timeout: Optional[timedelta] = None) -> ListApiUsersResponse:
208
208
  """ListApiUsers method.
@@ -28,7 +28,7 @@ from meshtrade.iam.role.v1 import role_pb2 as meshtrade_dot_iam_dot_role_dot_v1_
28
28
  from meshtrade.option.v1 import method_type_pb2 as meshtrade_dot_option_dot_v1_dot_method__type__pb2
29
29
 
30
30
 
31
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'meshtrade/iam/api_user/v1/service.proto\x12\x19meshtrade.iam.api_user.v1\x1a\x1b\x62uf/validate/validate.proto\x1a(meshtrade/iam/api_user/v1/api_user.proto\x1a meshtrade/iam/role/v1/role.proto\x1a%meshtrade/option/v1/method_type.proto\"h\n\x11GetApiUserRequest\x12S\n\x04name\x18\x01 \x01(\tB?\xbaH<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01$\xc8\x01\x01R\x04name\"Z\n\x1aGetApiUserByKeyHashRequest\x12<\n\x08key_hash\x18\x01 \x01(\tB!\xbaH\x1er\x19\x32\x14^[A-Za-z0-9+/]{43}=$\x98\x01,\xc8\x01\x01R\x07keyHash\"]\n\x14\x43reateApiUserRequest\x12\x45\n\x08\x61pi_user\x18\x01 \x01(\x0b\x32\".meshtrade.iam.api_user.v1.APIUserB\x06\xbaH\x03\xc8\x01\x01R\x07\x61piUser\"\xd1\x01\n\x1a\x41ssignRoleToAPIUserRequest\x12S\n\x04name\x18\x01 \x01(\tB?\xbaH<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01$\xc8\x01\x01R\x04name\x12^\n\x04role\x18\x04 \x01(\tBJ\xbaHGrB2=^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/[1-9][0-9]{6}$\x98\x01)\xc8\x01\x01R\x04role\"\xd3\x01\n\x1cRevokeRoleFromAPIUserRequest\x12S\n\x04name\x18\x01 \x01(\tB?\xbaH<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01$\xc8\x01\x01R\x04name\x12^\n\x04role\x18\x02 \x01(\tBJ\xbaHGrB2=^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/[1-9][0-9]{6}$\x98\x01)\xc8\x01\x01R\x04role\"\x15\n\x13ListApiUsersRequest\"W\n\x14ListApiUsersResponse\x12?\n\tapi_users\x18\x01 \x03(\x0b\x32\".meshtrade.iam.api_user.v1.APIUserR\x08\x61piUsers\":\n\x15SearchApiUsersRequest\x12!\n\x0c\x64isplay_name\x18\x01 \x01(\tR\x0b\x64isplayName\"Y\n\x16SearchApiUsersResponse\x12?\n\tapi_users\x18\x01 \x03(\x0b\x32\".meshtrade.iam.api_user.v1.APIUserR\x08\x61piUsers\"m\n\x16\x41\x63tivateApiUserRequest\x12S\n\x04name\x18\x01 \x01(\tB?\xbaH<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01$\xc8\x01\x01R\x04name\"o\n\x18\x44\x65\x61\x63tivateApiUserRequest\x12S\n\x04name\x18\x01 \x01(\tB?\xbaH<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01$\xc8\x01\x01R\x04name2\xca\t\n\x0e\x41piUserService\x12z\n\nGetApiUser\x12,.meshtrade.iam.api_user.v1.GetApiUserRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc2\x8d\xb7\x01\xc3\x8d\xb7\x01\x12x\n\rCreateApiUser\x12/.meshtrade.iam.api_user.v1.CreateApiUserRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc2\x8d\xb7\x01\x12\x84\x01\n\x13\x41ssignRoleToAPIUser\x12\x35.meshtrade.iam.api_user.v1.AssignRoleToAPIUserRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc2\x8d\xb7\x01\x12\x88\x01\n\x15RevokeRoleFromAPIUser\x12\x37.meshtrade.iam.api_user.v1.RevokeRoleFromAPIUserRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc2\x8d\xb7\x01\x12\x8b\x01\n\x0cListApiUsers\x12..meshtrade.iam.api_user.v1.ListApiUsersRequest\x1a/.meshtrade.iam.api_user.v1.ListApiUsersResponse\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc2\x8d\xb7\x01\xc3\x8d\xb7\x01\x12\x91\x01\n\x0eSearchApiUsers\x12\x30.meshtrade.iam.api_user.v1.SearchApiUsersRequest\x1a\x31.meshtrade.iam.api_user.v1.SearchApiUsersResponse\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc2\x8d\xb7\x01\xc3\x8d\xb7\x01\x12|\n\x0f\x41\x63tivateApiUser\x12\x31.meshtrade.iam.api_user.v1.ActivateApiUserRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc2\x8d\xb7\x01\x12\x80\x01\n\x11\x44\x65\x61\x63tivateApiUser\x12\x33.meshtrade.iam.api_user.v1.DeactivateApiUserRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc2\x8d\xb7\x01\x12\x8c\x01\n\x13GetApiUserByKeyHash\x12\x35.meshtrade.iam.api_user.v1.GetApiUserByKeyHashRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc2\x8d\xb7\x01\xc3\x8d\xb7\x01\x42[\n co.meshtrade.api.iam.api_user.v1Z7github.com/meshtrade/api/go/iam/api_user/v1;api_user_v1b\x06proto3')
31
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'meshtrade/iam/api_user/v1/service.proto\x12\x19meshtrade.iam.api_user.v1\x1a\x1b\x62uf/validate/validate.proto\x1a(meshtrade/iam/api_user/v1/api_user.proto\x1a meshtrade/iam/role/v1/role.proto\x1a%meshtrade/option/v1/method_type.proto\"h\n\x11GetApiUserRequest\x12S\n\x04name\x18\x01 \x01(\tB?\xbaH<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01$\xc8\x01\x01R\x04name\"Z\n\x1aGetApiUserByKeyHashRequest\x12<\n\x08key_hash\x18\x01 \x01(\tB!\xbaH\x1er\x19\x32\x14^[A-Za-z0-9+/]{43}=$\x98\x01,\xc8\x01\x01R\x07keyHash\"]\n\x14\x43reateApiUserRequest\x12\x45\n\x08\x61pi_user\x18\x01 \x01(\x0b\x32\".meshtrade.iam.api_user.v1.APIUserB\x06\xbaH\x03\xc8\x01\x01R\x07\x61piUser\"\xe2\x01\n\x1b\x41ssignRolesToAPIUserRequest\x12S\n\x04name\x18\x01 \x01(\tB?\xbaH<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01$\xc8\x01\x01R\x04name\x12n\n\x05roles\x18\x02 \x03(\tBX\xbaHU\x92\x01O\"MrK\x10/\x18\x30\x32\x45^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$\xc8\x01\x01R\x05roles\"\xe4\x01\n\x1dRevokeRolesFromAPIUserRequest\x12S\n\x04name\x18\x01 \x01(\tB?\xbaH<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01$\xc8\x01\x01R\x04name\x12n\n\x05roles\x18\x02 \x03(\tBX\xbaHU\x92\x01O\"MrK\x10/\x18\x30\x32\x45^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$\xc8\x01\x01R\x05roles\"\x15\n\x13ListApiUsersRequest\"W\n\x14ListApiUsersResponse\x12?\n\tapi_users\x18\x01 \x03(\x0b\x32\".meshtrade.iam.api_user.v1.APIUserR\x08\x61piUsers\":\n\x15SearchApiUsersRequest\x12!\n\x0c\x64isplay_name\x18\x01 \x01(\tR\x0b\x64isplayName\"Y\n\x16SearchApiUsersResponse\x12?\n\tapi_users\x18\x01 \x03(\x0b\x32\".meshtrade.iam.api_user.v1.APIUserR\x08\x61piUsers\"m\n\x16\x41\x63tivateApiUserRequest\x12S\n\x04name\x18\x01 \x01(\tB?\xbaH<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01$\xc8\x01\x01R\x04name\"o\n\x18\x44\x65\x61\x63tivateApiUserRequest\x12S\n\x04name\x18\x01 \x01(\tB?\xbaH<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01$\xc8\x01\x01R\x04name2\xce\t\n\x0e\x41piUserService\x12z\n\nGetApiUser\x12,.meshtrade.iam.api_user.v1.GetApiUserRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc2\x8d\xb7\x01\xc3\x8d\xb7\x01\x12x\n\rCreateApiUser\x12/.meshtrade.iam.api_user.v1.CreateApiUserRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc2\x8d\xb7\x01\x12\x86\x01\n\x14\x41ssignRolesToAPIUser\x12\x36.meshtrade.iam.api_user.v1.AssignRolesToAPIUserRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc2\x8d\xb7\x01\x12\x8a\x01\n\x16RevokeRolesFromAPIUser\x12\x38.meshtrade.iam.api_user.v1.RevokeRolesFromAPIUserRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc2\x8d\xb7\x01\x12\x8b\x01\n\x0cListApiUsers\x12..meshtrade.iam.api_user.v1.ListApiUsersRequest\x1a/.meshtrade.iam.api_user.v1.ListApiUsersResponse\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc2\x8d\xb7\x01\xc3\x8d\xb7\x01\x12\x91\x01\n\x0eSearchApiUsers\x12\x30.meshtrade.iam.api_user.v1.SearchApiUsersRequest\x1a\x31.meshtrade.iam.api_user.v1.SearchApiUsersResponse\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc2\x8d\xb7\x01\xc3\x8d\xb7\x01\x12|\n\x0f\x41\x63tivateApiUser\x12\x31.meshtrade.iam.api_user.v1.ActivateApiUserRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc2\x8d\xb7\x01\x12\x80\x01\n\x11\x44\x65\x61\x63tivateApiUser\x12\x33.meshtrade.iam.api_user.v1.DeactivateApiUserRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc2\x8d\xb7\x01\x12\x8c\x01\n\x13GetApiUserByKeyHash\x12\x35.meshtrade.iam.api_user.v1.GetApiUserByKeyHashRequest\x1a\".meshtrade.iam.api_user.v1.APIUser\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc2\x8d\xb7\x01\xc3\x8d\xb7\x01\x42[\n co.meshtrade.api.iam.api_user.v1Z7github.com/meshtrade/api/go/iam/api_user/v1;api_user_v1b\x06proto3')
32
32
 
33
33
  _globals = globals()
34
34
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -42,14 +42,14 @@ if not _descriptor._USE_C_DESCRIPTORS:
42
42
  _globals['_GETAPIUSERBYKEYHASHREQUEST'].fields_by_name['key_hash']._serialized_options = b'\272H\036r\0312\024^[A-Za-z0-9+/]{43}=$\230\001,\310\001\001'
43
43
  _globals['_CREATEAPIUSERREQUEST'].fields_by_name['api_user']._loaded_options = None
44
44
  _globals['_CREATEAPIUSERREQUEST'].fields_by_name['api_user']._serialized_options = b'\272H\003\310\001\001'
45
- _globals['_ASSIGNROLETOAPIUSERREQUEST'].fields_by_name['name']._loaded_options = None
46
- _globals['_ASSIGNROLETOAPIUSERREQUEST'].fields_by_name['name']._serialized_options = b'\272H<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001$\310\001\001'
47
- _globals['_ASSIGNROLETOAPIUSERREQUEST'].fields_by_name['role']._loaded_options = None
48
- _globals['_ASSIGNROLETOAPIUSERREQUEST'].fields_by_name['role']._serialized_options = b'\272HGrB2=^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/[1-9][0-9]{6}$\230\001)\310\001\001'
49
- _globals['_REVOKEROLEFROMAPIUSERREQUEST'].fields_by_name['name']._loaded_options = None
50
- _globals['_REVOKEROLEFROMAPIUSERREQUEST'].fields_by_name['name']._serialized_options = b'\272H<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001$\310\001\001'
51
- _globals['_REVOKEROLEFROMAPIUSERREQUEST'].fields_by_name['role']._loaded_options = None
52
- _globals['_REVOKEROLEFROMAPIUSERREQUEST'].fields_by_name['role']._serialized_options = b'\272HGrB2=^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/[1-9][0-9]{6}$\230\001)\310\001\001'
45
+ _globals['_ASSIGNROLESTOAPIUSERREQUEST'].fields_by_name['name']._loaded_options = None
46
+ _globals['_ASSIGNROLESTOAPIUSERREQUEST'].fields_by_name['name']._serialized_options = b'\272H<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001$\310\001\001'
47
+ _globals['_ASSIGNROLESTOAPIUSERREQUEST'].fields_by_name['roles']._loaded_options = None
48
+ _globals['_ASSIGNROLESTOAPIUSERREQUEST'].fields_by_name['roles']._serialized_options = b'\272HU\222\001O\"MrK\020/\03002E^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$\310\001\001'
49
+ _globals['_REVOKEROLESFROMAPIUSERREQUEST'].fields_by_name['name']._loaded_options = None
50
+ _globals['_REVOKEROLESFROMAPIUSERREQUEST'].fields_by_name['name']._serialized_options = b'\272H<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001$\310\001\001'
51
+ _globals['_REVOKEROLESFROMAPIUSERREQUEST'].fields_by_name['roles']._loaded_options = None
52
+ _globals['_REVOKEROLESFROMAPIUSERREQUEST'].fields_by_name['roles']._serialized_options = b'\272HU\222\001O\"MrK\020/\03002E^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$\310\001\001'
53
53
  _globals['_ACTIVATEAPIUSERREQUEST'].fields_by_name['name']._loaded_options = None
54
54
  _globals['_ACTIVATEAPIUSERREQUEST'].fields_by_name['name']._serialized_options = b'\272H<r722^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001$\310\001\001'
55
55
  _globals['_DEACTIVATEAPIUSERREQUEST'].fields_by_name['name']._loaded_options = None
@@ -58,10 +58,10 @@ if not _descriptor._USE_C_DESCRIPTORS:
58
58
  _globals['_APIUSERSERVICE'].methods_by_name['GetApiUser']._serialized_options = b'\240\265\030\001\252\265\030\022\n\020\300\215\267\001\301\215\267\001\302\215\267\001\303\215\267\001'
59
59
  _globals['_APIUSERSERVICE'].methods_by_name['CreateApiUser']._loaded_options = None
60
60
  _globals['_APIUSERSERVICE'].methods_by_name['CreateApiUser']._serialized_options = b'\240\265\030\002\252\265\030\n\n\010\300\215\267\001\302\215\267\001'
61
- _globals['_APIUSERSERVICE'].methods_by_name['AssignRoleToAPIUser']._loaded_options = None
62
- _globals['_APIUSERSERVICE'].methods_by_name['AssignRoleToAPIUser']._serialized_options = b'\240\265\030\002\252\265\030\n\n\010\300\215\267\001\302\215\267\001'
63
- _globals['_APIUSERSERVICE'].methods_by_name['RevokeRoleFromAPIUser']._loaded_options = None
64
- _globals['_APIUSERSERVICE'].methods_by_name['RevokeRoleFromAPIUser']._serialized_options = b'\240\265\030\002\252\265\030\n\n\010\300\215\267\001\302\215\267\001'
61
+ _globals['_APIUSERSERVICE'].methods_by_name['AssignRolesToAPIUser']._loaded_options = None
62
+ _globals['_APIUSERSERVICE'].methods_by_name['AssignRolesToAPIUser']._serialized_options = b'\240\265\030\002\252\265\030\n\n\010\300\215\267\001\302\215\267\001'
63
+ _globals['_APIUSERSERVICE'].methods_by_name['RevokeRolesFromAPIUser']._loaded_options = None
64
+ _globals['_APIUSERSERVICE'].methods_by_name['RevokeRolesFromAPIUser']._serialized_options = b'\240\265\030\002\252\265\030\n\n\010\300\215\267\001\302\215\267\001'
65
65
  _globals['_APIUSERSERVICE'].methods_by_name['ListApiUsers']._loaded_options = None
66
66
  _globals['_APIUSERSERVICE'].methods_by_name['ListApiUsers']._serialized_options = b'\240\265\030\001\252\265\030\022\n\020\300\215\267\001\301\215\267\001\302\215\267\001\303\215\267\001'
67
67
  _globals['_APIUSERSERVICE'].methods_by_name['SearchApiUsers']._loaded_options = None
@@ -78,22 +78,22 @@ if not _descriptor._USE_C_DESCRIPTORS:
78
78
  _globals['_GETAPIUSERBYKEYHASHREQUEST']._serialized_end=410
79
79
  _globals['_CREATEAPIUSERREQUEST']._serialized_start=412
80
80
  _globals['_CREATEAPIUSERREQUEST']._serialized_end=505
81
- _globals['_ASSIGNROLETOAPIUSERREQUEST']._serialized_start=508
82
- _globals['_ASSIGNROLETOAPIUSERREQUEST']._serialized_end=717
83
- _globals['_REVOKEROLEFROMAPIUSERREQUEST']._serialized_start=720
84
- _globals['_REVOKEROLEFROMAPIUSERREQUEST']._serialized_end=931
85
- _globals['_LISTAPIUSERSREQUEST']._serialized_start=933
86
- _globals['_LISTAPIUSERSREQUEST']._serialized_end=954
87
- _globals['_LISTAPIUSERSRESPONSE']._serialized_start=956
88
- _globals['_LISTAPIUSERSRESPONSE']._serialized_end=1043
89
- _globals['_SEARCHAPIUSERSREQUEST']._serialized_start=1045
90
- _globals['_SEARCHAPIUSERSREQUEST']._serialized_end=1103
91
- _globals['_SEARCHAPIUSERSRESPONSE']._serialized_start=1105
92
- _globals['_SEARCHAPIUSERSRESPONSE']._serialized_end=1194
93
- _globals['_ACTIVATEAPIUSERREQUEST']._serialized_start=1196
94
- _globals['_ACTIVATEAPIUSERREQUEST']._serialized_end=1305
95
- _globals['_DEACTIVATEAPIUSERREQUEST']._serialized_start=1307
96
- _globals['_DEACTIVATEAPIUSERREQUEST']._serialized_end=1418
97
- _globals['_APIUSERSERVICE']._serialized_start=1421
98
- _globals['_APIUSERSERVICE']._serialized_end=2647
81
+ _globals['_ASSIGNROLESTOAPIUSERREQUEST']._serialized_start=508
82
+ _globals['_ASSIGNROLESTOAPIUSERREQUEST']._serialized_end=734
83
+ _globals['_REVOKEROLESFROMAPIUSERREQUEST']._serialized_start=737
84
+ _globals['_REVOKEROLESFROMAPIUSERREQUEST']._serialized_end=965
85
+ _globals['_LISTAPIUSERSREQUEST']._serialized_start=967
86
+ _globals['_LISTAPIUSERSREQUEST']._serialized_end=988
87
+ _globals['_LISTAPIUSERSRESPONSE']._serialized_start=990
88
+ _globals['_LISTAPIUSERSRESPONSE']._serialized_end=1077
89
+ _globals['_SEARCHAPIUSERSREQUEST']._serialized_start=1079
90
+ _globals['_SEARCHAPIUSERSREQUEST']._serialized_end=1137
91
+ _globals['_SEARCHAPIUSERSRESPONSE']._serialized_start=1139
92
+ _globals['_SEARCHAPIUSERSRESPONSE']._serialized_end=1228
93
+ _globals['_ACTIVATEAPIUSERREQUEST']._serialized_start=1230
94
+ _globals['_ACTIVATEAPIUSERREQUEST']._serialized_end=1339
95
+ _globals['_DEACTIVATEAPIUSERREQUEST']._serialized_start=1341
96
+ _globals['_DEACTIVATEAPIUSERREQUEST']._serialized_end=1452
97
+ _globals['_APIUSERSERVICE']._serialized_start=1455
98
+ _globals['_APIUSERSERVICE']._serialized_end=2685
99
99
  # @@protoc_insertion_point(module_scope)
@@ -28,21 +28,21 @@ class CreateApiUserRequest(_message.Message):
28
28
  api_user: _api_user_pb2.APIUser
29
29
  def __init__(self, api_user: _Optional[_Union[_api_user_pb2.APIUser, _Mapping]] = ...) -> None: ...
30
30
 
31
- class AssignRoleToAPIUserRequest(_message.Message):
32
- __slots__ = ("name", "role")
31
+ class AssignRolesToAPIUserRequest(_message.Message):
32
+ __slots__ = ("name", "roles")
33
33
  NAME_FIELD_NUMBER: _ClassVar[int]
34
- ROLE_FIELD_NUMBER: _ClassVar[int]
34
+ ROLES_FIELD_NUMBER: _ClassVar[int]
35
35
  name: str
36
- role: str
37
- def __init__(self, name: _Optional[str] = ..., role: _Optional[str] = ...) -> None: ...
36
+ roles: _containers.RepeatedScalarFieldContainer[str]
37
+ def __init__(self, name: _Optional[str] = ..., roles: _Optional[_Iterable[str]] = ...) -> None: ...
38
38
 
39
- class RevokeRoleFromAPIUserRequest(_message.Message):
40
- __slots__ = ("name", "role")
39
+ class RevokeRolesFromAPIUserRequest(_message.Message):
40
+ __slots__ = ("name", "roles")
41
41
  NAME_FIELD_NUMBER: _ClassVar[int]
42
- ROLE_FIELD_NUMBER: _ClassVar[int]
42
+ ROLES_FIELD_NUMBER: _ClassVar[int]
43
43
  name: str
44
- role: str
45
- def __init__(self, name: _Optional[str] = ..., role: _Optional[str] = ...) -> None: ...
44
+ roles: _containers.RepeatedScalarFieldContainer[str]
45
+ def __init__(self, name: _Optional[str] = ..., roles: _Optional[_Iterable[str]] = ...) -> None: ...
46
46
 
47
47
  class ListApiUsersRequest(_message.Message):
48
48
  __slots__ = ()
@@ -37,14 +37,14 @@ class ApiUserServiceStub(object):
37
37
  request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.CreateApiUserRequest.SerializeToString,
38
38
  response_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
39
39
  _registered_method=True)
40
- self.AssignRoleToAPIUser = channel.unary_unary(
41
- '/meshtrade.iam.api_user.v1.ApiUserService/AssignRoleToAPIUser',
42
- request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.AssignRoleToAPIUserRequest.SerializeToString,
40
+ self.AssignRolesToAPIUser = channel.unary_unary(
41
+ '/meshtrade.iam.api_user.v1.ApiUserService/AssignRolesToAPIUser',
42
+ request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.AssignRolesToAPIUserRequest.SerializeToString,
43
43
  response_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
44
44
  _registered_method=True)
45
- self.RevokeRoleFromAPIUser = channel.unary_unary(
46
- '/meshtrade.iam.api_user.v1.ApiUserService/RevokeRoleFromAPIUser',
47
- request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.RevokeRoleFromAPIUserRequest.SerializeToString,
45
+ self.RevokeRolesFromAPIUser = channel.unary_unary(
46
+ '/meshtrade.iam.api_user.v1.ApiUserService/RevokeRolesFromAPIUser',
47
+ request_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.RevokeRolesFromAPIUserRequest.SerializeToString,
48
48
  response_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
49
49
  _registered_method=True)
50
50
  self.ListApiUsers = channel.unary_unary(
@@ -109,9 +109,9 @@ class ApiUserServiceServicer(object):
109
109
  context.set_details('Method not implemented!')
110
110
  raise NotImplementedError('Method not implemented!')
111
111
 
112
- def AssignRoleToAPIUser(self, request, context):
112
+ def AssignRolesToAPIUser(self, request, context):
113
113
  """
114
- Assigns a role to an existing api user within the authenticated group context.
114
+ Assign roles to an existing api user within the authenticated group context.
115
115
 
116
116
  The role assignment enables the api user to perform operations according
117
117
  to the permissions associated with that role within the group hierarchy.
@@ -120,9 +120,9 @@ class ApiUserServiceServicer(object):
120
120
  context.set_details('Method not implemented!')
121
121
  raise NotImplementedError('Method not implemented!')
122
122
 
123
- def RevokeRoleFromAPIUser(self, request, context):
123
+ def RevokeRolesFromAPIUser(self, request, context):
124
124
  """
125
- Revokes a role from an existing API user within the authenticated group context.
125
+ Revoke roles from an existing API user within the authenticated group context.
126
126
 
127
127
  The role revocation removes the permissions associated with that role from
128
128
  the API user within the group hierarchy. The API user will no longer be able
@@ -200,14 +200,14 @@ def add_ApiUserServiceServicer_to_server(servicer, server):
200
200
  request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.CreateApiUserRequest.FromString,
201
201
  response_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.SerializeToString,
202
202
  ),
203
- 'AssignRoleToAPIUser': grpc.unary_unary_rpc_method_handler(
204
- servicer.AssignRoleToAPIUser,
205
- request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.AssignRoleToAPIUserRequest.FromString,
203
+ 'AssignRolesToAPIUser': grpc.unary_unary_rpc_method_handler(
204
+ servicer.AssignRolesToAPIUser,
205
+ request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.AssignRolesToAPIUserRequest.FromString,
206
206
  response_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.SerializeToString,
207
207
  ),
208
- 'RevokeRoleFromAPIUser': grpc.unary_unary_rpc_method_handler(
209
- servicer.RevokeRoleFromAPIUser,
210
- request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.RevokeRoleFromAPIUserRequest.FromString,
208
+ 'RevokeRolesFromAPIUser': grpc.unary_unary_rpc_method_handler(
209
+ servicer.RevokeRolesFromAPIUser,
210
+ request_deserializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.RevokeRolesFromAPIUserRequest.FromString,
211
211
  response_serializer=meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.SerializeToString,
212
212
  ),
213
213
  'ListApiUsers': grpc.unary_unary_rpc_method_handler(
@@ -313,7 +313,7 @@ class ApiUserService(object):
313
313
  _registered_method=True)
314
314
 
315
315
  @staticmethod
316
- def AssignRoleToAPIUser(request,
316
+ def AssignRolesToAPIUser(request,
317
317
  target,
318
318
  options=(),
319
319
  channel_credentials=None,
@@ -326,8 +326,8 @@ class ApiUserService(object):
326
326
  return grpc.experimental.unary_unary(
327
327
  request,
328
328
  target,
329
- '/meshtrade.iam.api_user.v1.ApiUserService/AssignRoleToAPIUser',
330
- meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.AssignRoleToAPIUserRequest.SerializeToString,
329
+ '/meshtrade.iam.api_user.v1.ApiUserService/AssignRolesToAPIUser',
330
+ meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.AssignRolesToAPIUserRequest.SerializeToString,
331
331
  meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
332
332
  options,
333
333
  channel_credentials,
@@ -340,7 +340,7 @@ class ApiUserService(object):
340
340
  _registered_method=True)
341
341
 
342
342
  @staticmethod
343
- def RevokeRoleFromAPIUser(request,
343
+ def RevokeRolesFromAPIUser(request,
344
344
  target,
345
345
  options=(),
346
346
  channel_credentials=None,
@@ -353,8 +353,8 @@ class ApiUserService(object):
353
353
  return grpc.experimental.unary_unary(
354
354
  request,
355
355
  target,
356
- '/meshtrade.iam.api_user.v1.ApiUserService/RevokeRoleFromAPIUser',
357
- meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.RevokeRoleFromAPIUserRequest.SerializeToString,
356
+ '/meshtrade.iam.api_user.v1.ApiUserService/RevokeRolesFromAPIUser',
357
+ meshtrade_dot_iam_dot_api__user_dot_v1_dot_service__pb2.RevokeRolesFromAPIUserRequest.SerializeToString,
358
358
  meshtrade_dot_iam_dot_api__user_dot_v1_dot_api__user__pb2.APIUser.FromString,
359
359
  options,
360
360
  channel_credentials,
@@ -1,7 +1,7 @@
1
1
  """Role utility functions for Mesh API.
2
2
 
3
3
  This module provides helper functions for working with Role enums and their resource names.
4
- All functions use the 3-part integer format: groups/{groupID}/{roleNumber}
4
+ All functions use the 4-part integer format: groups/{groupID}/roles/{roleNumber}
5
5
  for cross-language compatibility.
6
6
  """
7
7
 
@@ -47,7 +47,7 @@ def role_is_valid_and_specified(role: Role) -> bool:
47
47
  def role_full_resource_name_from_group_id(role: Role, group_id: str) -> str:
48
48
  """Generate full resource name from role and group ID.
49
49
 
50
- Format: groups/{group_id}/{role_int}
50
+ Format: groups/{group_id}/roles/{role_int}
51
51
 
52
52
  Args:
53
53
  role: Role enum value (integer)
@@ -58,9 +58,9 @@ def role_full_resource_name_from_group_id(role: Role, group_id: str) -> str:
58
58
 
59
59
  Example:
60
60
  >>> role_full_resource_name_from_group_id(Role.ROLE_IAM_ADMIN, "01DD32GZ7R0000000000000001")
61
- 'groups/01DD32GZ7R0000000000000001/3000000'
61
+ 'groups/01DD32GZ7R0000000000000001/roles/3000000'
62
62
  """
63
- return f"groups/{group_id}/{int(role)}"
63
+ return f"groups/{group_id}/roles/{int(role)}"
64
64
 
65
65
 
66
66
  def role_full_resource_name_from_group(role: Role, group: str) -> str:
@@ -78,7 +78,7 @@ def role_full_resource_name_from_group(role: Role, group: str) -> str:
78
78
 
79
79
  Example:
80
80
  >>> role_full_resource_name_from_group(Role.ROLE_IAM_ADMIN, "groups/01DD32GZ7R0000000000000001")
81
- 'groups/01DD32GZ7R0000000000000001/3000000'
81
+ 'groups/01DD32GZ7R0000000000000001/roles/3000000'
82
82
  """
83
83
  if not group.startswith("groups/"):
84
84
  raise ValueError(f"invalid group format, expected groups/{{groupID}}, got: {group}")
@@ -94,13 +94,13 @@ def role_from_full_resource_name(full_resource_name: str) -> Role:
94
94
  """Extract Role from full resource name.
95
95
 
96
96
  Args:
97
- full_resource_name: Full resource name (e.g., "groups/{id}/{role_int}")
97
+ full_resource_name: Full resource name (e.g., "groups/{id}/roles/{role_int}")
98
98
 
99
99
  Returns:
100
100
  Role enum value (integer), or ROLE_UNSPECIFIED if parsing fails
101
101
 
102
102
  Example:
103
- >>> role_from_full_resource_name("groups/01DD32GZ7R0000000000000001/3000000")
103
+ >>> role_from_full_resource_name("groups/01DD32GZ7R0000000000000001/roles/3000000")
104
104
  3000000
105
105
  >>> role_from_full_resource_name("invalid/format")
106
106
  0
@@ -118,7 +118,7 @@ def role_from_full_resource_name(full_resource_name: str) -> Role:
118
118
  def parse_role_parts(role_full_resource_name: str) -> tuple[str, int]:
119
119
  """Parse full resource name into group ID and Role.
120
120
 
121
- Expected format: groups/{group_id}/{role_int}
121
+ Expected format: groups/{group_id}/roles/{role_int}
122
122
 
123
123
  Args:
124
124
  role_full_resource_name: Full resource name
@@ -130,21 +130,21 @@ def parse_role_parts(role_full_resource_name: str) -> tuple[str, int]:
130
130
  ValueError: If format is invalid or role number cannot be parsed
131
131
 
132
132
  Example:
133
- >>> parse_role_parts("groups/01DD32GZ7R0000000000000001/3000000")
133
+ >>> parse_role_parts("groups/01DD32GZ7R0000000000000001/roles/3000000")
134
134
  ('01DD32GZ7R0000000000000001', 3000000)
135
135
  """
136
136
  parts = role_full_resource_name.split("/")
137
- if len(parts) != 3 or parts[0] != "groups":
138
- raise ValueError(f"invalid role format, expected groups/{{groupID}}/{{role}}, got {role_full_resource_name}")
137
+ if len(parts) != 4 or parts[0] != "groups" or parts[2] != "roles":
138
+ raise ValueError(f"invalid role format, expected groups/{{groupID}}/roles/{{role}}, got {role_full_resource_name}")
139
139
 
140
140
  group_id = parts[1]
141
141
  if not group_id:
142
142
  raise ValueError("group ID cannot be empty")
143
143
 
144
144
  try:
145
- role_int = int(parts[2])
145
+ role_int = int(parts[3])
146
146
  except ValueError as e:
147
- raise ValueError(f"error parsing role enum value '{parts[2]}'") from e
147
+ raise ValueError(f"error parsing role enum value '{parts[3]}'") from e
148
148
 
149
149
  if role_int < 0:
150
150
  raise ValueError(f"invalid role number in full resource name: {role_full_resource_name}")
@@ -168,7 +168,7 @@ def must_parse_role_parts(role_full_resource_name: str) -> tuple[str, int]:
168
168
  ValueError: If format is invalid
169
169
 
170
170
  Example:
171
- >>> must_parse_role_parts("groups/01DD32GZ7R0000000000000001/3000000")
171
+ >>> must_parse_role_parts("groups/01DD32GZ7R0000000000000001/roles/3000000")
172
172
  ('01DD32GZ7R0000000000000001', 3000000)
173
173
  """
174
174
  return parse_role_parts(role_full_resource_name)
@@ -15,11 +15,12 @@
15
15
  # Generated protobuf imports
16
16
  from .user_pb2 import User
17
17
  from .service_pb2 import (
18
- AssignRoleToUserRequest,
18
+ AssignRolesToUserRequest,
19
19
  CreateUserRequest,
20
20
  GetUserRequest,
21
21
  ListUsersRequest,
22
22
  ListUsersResponse,
23
+ RevokeRolesFromUserRequest,
23
24
  SearchUsersRequest,
24
25
  SearchUsersResponse,
25
26
  UpdateUserRequest,
@@ -52,11 +53,12 @@ from .service_meshpy import (
52
53
  # Combined auto-generated and manual exports
53
54
  __all__ = [
54
55
  # Generated exports
55
- "AssignRoleToUserRequest",
56
+ "AssignRolesToUserRequest",
56
57
  "CreateUserRequest",
57
58
  "GetUserRequest",
58
59
  "ListUsersRequest",
59
60
  "ListUsersResponse",
61
+ "RevokeRolesFromUserRequest",
60
62
  "SearchUsersRequest",
61
63
  "SearchUsersResponse",
62
64
  "UpdateUserRequest",
@@ -19,11 +19,12 @@ from meshtrade.iam.api_user.v1.api_credentials import find_credentials
19
19
  from .user_pb2 import User
20
20
  from meshtrade.common.service_options import ServiceOptions
21
21
  from .service_pb2 import (
22
- AssignRoleToUserRequest,
22
+ AssignRolesToUserRequest,
23
23
  CreateUserRequest,
24
24
  GetUserRequest,
25
25
  ListUsersRequest,
26
26
  ListUsersResponse,
27
+ RevokeRolesFromUserRequest,
27
28
  SearchUsersRequest,
28
29
  SearchUsersResponse,
29
30
  UpdateUserRequest,
@@ -137,21 +138,37 @@ class UserService(BaseGRPCClient):
137
138
  tls=options.tls,
138
139
  )
139
140
 
140
- def assign_role_to_user(self, request: AssignRoleToUserRequest, timeout: Optional[timedelta] = None) -> User:
141
- """AssignRoleToUser method.
141
+ def assign_roles_to_user(self, request: AssignRolesToUserRequest, timeout: Optional[timedelta] = None) -> User:
142
+ """AssignRolesToUser method.
142
143
 
143
144
  Args:
144
- request: The AssignRoleToUser request message
145
+ request: The AssignRolesToUser request message
145
146
  timeout: Optional timeout override for this call
146
147
 
147
148
  Returns:
148
- The AssignRoleToUser response message
149
+ The AssignRolesToUser response message
149
150
 
150
151
  Raises:
151
152
  grpc.RpcError: If the gRPC call fails
152
153
  ValueError: If authentication credentials are missing
153
154
  """
154
- return self._execute_method("AssignRoleToUser", request, timeout)
155
+ return self._execute_method("AssignRolesToUser", request, timeout)
156
+
157
+ def revoke_roles_from_user(self, request: RevokeRolesFromUserRequest, timeout: Optional[timedelta] = None) -> User:
158
+ """RevokeRolesFromUser method.
159
+
160
+ Args:
161
+ request: The RevokeRolesFromUser request message
162
+ timeout: Optional timeout override for this call
163
+
164
+ Returns:
165
+ The RevokeRolesFromUser response message
166
+
167
+ Raises:
168
+ grpc.RpcError: If the gRPC call fails
169
+ ValueError: If authentication credentials are missing
170
+ """
171
+ return self._execute_method("RevokeRolesFromUser", request, timeout)
155
172
 
156
173
  def get_user(self, request: GetUserRequest, timeout: Optional[timedelta] = None) -> User:
157
174
  """GetUser method.
@@ -29,7 +29,7 @@ from meshtrade.option.v1 import method_type_pb2 as meshtrade_dot_option_dot_v1_d
29
29
  from meshtrade.type.v1 import sorting_pb2 as meshtrade_dot_type_dot_v1_dot_sorting__pb2
30
30
 
31
31
 
32
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#meshtrade/iam/user/v1/service.proto\x12\x15meshtrade.iam.user.v1\x1a\x1b\x62uf/validate/validate.proto\x1a meshtrade/iam/role/v1/role.proto\x1a meshtrade/iam/user/v1/user.proto\x1a%meshtrade/option/v1/method_type.proto\x1a\x1fmeshtrade/type/v1/sorting.proto\"\xc7\x01\n\x17\x41ssignRoleToUserRequest\x12L\n\x04name\x18\x01 \x01(\tB8\xbaH5r32.^users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01 R\x04name\x12^\n\x04role\x18\x04 \x01(\tBJ\xbaHGrB2=^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/[1-9][0-9]{6}$\x98\x01)\xc8\x01\x01R\x04role\"a\n\x0eGetUserRequest\x12O\n\x04name\x18\x01 \x01(\tB;\xbaH8r32.^users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01 \xc8\x01\x01R\x04name\"\x94\x02\n\x10ListUsersRequest\x12I\n\x07sorting\x18\x01 \x01(\x0b\x32/.meshtrade.iam.user.v1.ListUsersRequest.SortingR\x07sorting\x1a\xb4\x01\n\x07Sorting\x12r\n\x05\x66ield\x18\x01 \x01(\tB\\\xbaHYr\tR\x00R\x05\x65mail\xba\x01K\n\x0b\x66ield.valid\x12%field must be one of: email, or empty\x1a\x15this in [\'\', \'email\']R\x05\x66ield\x12\x35\n\x05order\x18\x02 \x01(\x0e\x32\x1f.meshtrade.type.v1.SortingOrderR\x05order\"F\n\x11ListUsersResponse\x12\x31\n\x05users\x18\x01 \x03(\x0b\x32\x1b.meshtrade.iam.user.v1.UserR\x05users\"\xae\x02\n\x12SearchUsersRequest\x12\x14\n\x05\x65mail\x18\x01 \x01(\tR\x05\x65mail\x12K\n\x07sorting\x18\x02 \x01(\x0b\x32\x31.meshtrade.iam.user.v1.SearchUsersRequest.SortingR\x07sorting\x1a\xb4\x01\n\x07Sorting\x12r\n\x05\x66ield\x18\x01 \x01(\tB\\\xbaHYr\tR\x00R\x05\x65mail\xba\x01K\n\x0b\x66ield.valid\x12%field must be one of: email, or empty\x1a\x15this in [\'\', \'email\']R\x05\x66ield\x12\x35\n\x05order\x18\x02 \x01(\x0e\x32\x1f.meshtrade.type.v1.SortingOrderR\x05order\"H\n\x13SearchUsersResponse\x12\x31\n\x05users\x18\x01 \x03(\x0b\x32\x1b.meshtrade.iam.user.v1.UserR\x05users\"L\n\x11\x43reateUserRequest\x12\x37\n\x04user\x18\x01 \x01(\x0b\x32\x1b.meshtrade.iam.user.v1.UserB\x06\xbaH\x03\xc8\x01\x01R\x04user\"L\n\x11UpdateUserRequest\x12\x37\n\x04user\x18\x01 \x01(\x0b\x32\x1b.meshtrade.iam.user.v1.UserB\x06\xbaH\x03\xc8\x01\x01R\x04user2\xbe\x05\n\x0bUserService\x12s\n\x10\x41ssignRoleToUser\x12..meshtrade.iam.user.v1.AssignRoleToUserRequest\x1a\x1b.meshtrade.iam.user.v1.User\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc6\x8d\xb7\x01\x12i\n\x07GetUser\x12%.meshtrade.iam.user.v1.GetUserRequest\x1a\x1b.meshtrade.iam.user.v1.User\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc6\x8d\xb7\x01\xc7\x8d\xb7\x01\x12z\n\tListUsers\x12\'.meshtrade.iam.user.v1.ListUsersRequest\x1a(.meshtrade.iam.user.v1.ListUsersResponse\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc6\x8d\xb7\x01\xc7\x8d\xb7\x01\x12\x80\x01\n\x0bSearchUsers\x12).meshtrade.iam.user.v1.SearchUsersRequest\x1a*.meshtrade.iam.user.v1.SearchUsersResponse\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc6\x8d\xb7\x01\xc7\x8d\xb7\x01\x12g\n\nCreateUser\x12(.meshtrade.iam.user.v1.CreateUserRequest\x1a\x1b.meshtrade.iam.user.v1.User\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc6\x8d\xb7\x01\x12g\n\nUpdateUser\x12(.meshtrade.iam.user.v1.UpdateUserRequest\x1a\x1b.meshtrade.iam.user.v1.User\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc6\x8d\xb7\x01\x42O\n\x1c\x63o.meshtrade.api.iam.user.v1Z/github.com/meshtrade/api/go/iam/user/v1;user_v1b\x06proto3')
32
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#meshtrade/iam/user/v1/service.proto\x12\x15meshtrade.iam.user.v1\x1a\x1b\x62uf/validate/validate.proto\x1a meshtrade/iam/role/v1/role.proto\x1a meshtrade/iam/user/v1/user.proto\x1a%meshtrade/option/v1/method_type.proto\x1a\x1fmeshtrade/type/v1/sorting.proto\"\xdb\x01\n\x18\x41ssignRolesToUserRequest\x12O\n\x04name\x18\x01 \x01(\tB;\xbaH8r32.^users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01 \xc8\x01\x01R\x04name\x12n\n\x05roles\x18\x02 \x03(\tBX\xbaHU\x92\x01O\"MrK\x10/\x18\x30\x32\x45^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$\xc8\x01\x01R\x05roles\"\xdd\x01\n\x1aRevokeRolesFromUserRequest\x12O\n\x04name\x18\x01 \x01(\tB;\xbaH8r32.^users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01 \xc8\x01\x01R\x04name\x12n\n\x05roles\x18\x02 \x03(\tBX\xbaHU\x92\x01O\"MrK\x10/\x18\x30\x32\x45^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$\xc8\x01\x01R\x05roles\"a\n\x0eGetUserRequest\x12O\n\x04name\x18\x01 \x01(\tB;\xbaH8r32.^users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01 \xc8\x01\x01R\x04name\"\x94\x02\n\x10ListUsersRequest\x12I\n\x07sorting\x18\x01 \x01(\x0b\x32/.meshtrade.iam.user.v1.ListUsersRequest.SortingR\x07sorting\x1a\xb4\x01\n\x07Sorting\x12r\n\x05\x66ield\x18\x01 \x01(\tB\\\xbaHYr\tR\x00R\x05\x65mail\xba\x01K\n\x0b\x66ield.valid\x12%field must be one of: email, or empty\x1a\x15this in [\'\', \'email\']R\x05\x66ield\x12\x35\n\x05order\x18\x02 \x01(\x0e\x32\x1f.meshtrade.type.v1.SortingOrderR\x05order\"F\n\x11ListUsersResponse\x12\x31\n\x05users\x18\x01 \x03(\x0b\x32\x1b.meshtrade.iam.user.v1.UserR\x05users\"\xae\x02\n\x12SearchUsersRequest\x12\x14\n\x05\x65mail\x18\x01 \x01(\tR\x05\x65mail\x12K\n\x07sorting\x18\x02 \x01(\x0b\x32\x31.meshtrade.iam.user.v1.SearchUsersRequest.SortingR\x07sorting\x1a\xb4\x01\n\x07Sorting\x12r\n\x05\x66ield\x18\x01 \x01(\tB\\\xbaHYr\tR\x00R\x05\x65mail\xba\x01K\n\x0b\x66ield.valid\x12%field must be one of: email, or empty\x1a\x15this in [\'\', \'email\']R\x05\x66ield\x12\x35\n\x05order\x18\x02 \x01(\x0e\x32\x1f.meshtrade.type.v1.SortingOrderR\x05order\"H\n\x13SearchUsersResponse\x12\x31\n\x05users\x18\x01 \x03(\x0b\x32\x1b.meshtrade.iam.user.v1.UserR\x05users\"L\n\x11\x43reateUserRequest\x12\x37\n\x04user\x18\x01 \x01(\x0b\x32\x1b.meshtrade.iam.user.v1.UserB\x06\xbaH\x03\xc8\x01\x01R\x04user\"L\n\x11UpdateUserRequest\x12\x37\n\x04user\x18\x01 \x01(\x0b\x32\x1b.meshtrade.iam.user.v1.UserB\x06\xbaH\x03\xc8\x01\x01R\x04user2\xbb\x06\n\x0bUserService\x12u\n\x11\x41ssignRolesToUser\x12/.meshtrade.iam.user.v1.AssignRolesToUserRequest\x1a\x1b.meshtrade.iam.user.v1.User\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc6\x8d\xb7\x01\x12y\n\x13RevokeRolesFromUser\x12\x31.meshtrade.iam.user.v1.RevokeRolesFromUserRequest\x1a\x1b.meshtrade.iam.user.v1.User\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc6\x8d\xb7\x01\x12i\n\x07GetUser\x12%.meshtrade.iam.user.v1.GetUserRequest\x1a\x1b.meshtrade.iam.user.v1.User\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc6\x8d\xb7\x01\xc7\x8d\xb7\x01\x12z\n\tListUsers\x12\'.meshtrade.iam.user.v1.ListUsersRequest\x1a(.meshtrade.iam.user.v1.ListUsersResponse\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc6\x8d\xb7\x01\xc7\x8d\xb7\x01\x12\x80\x01\n\x0bSearchUsers\x12).meshtrade.iam.user.v1.SearchUsersRequest\x1a*.meshtrade.iam.user.v1.SearchUsersResponse\"\x1a\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\x10\xc0\x8d\xb7\x01\xc1\x8d\xb7\x01\xc6\x8d\xb7\x01\xc7\x8d\xb7\x01\x12g\n\nCreateUser\x12(.meshtrade.iam.user.v1.CreateUserRequest\x1a\x1b.meshtrade.iam.user.v1.User\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc6\x8d\xb7\x01\x12g\n\nUpdateUser\x12(.meshtrade.iam.user.v1.UpdateUserRequest\x1a\x1b.meshtrade.iam.user.v1.User\"\x12\xa0\xb5\x18\x02\xaa\xb5\x18\n\n\x08\xc0\x8d\xb7\x01\xc6\x8d\xb7\x01\x42O\n\x1c\x63o.meshtrade.api.iam.user.v1Z/github.com/meshtrade/api/go/iam/user/v1;user_v1b\x06proto3')
33
33
 
34
34
  _globals = globals()
35
35
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -37,10 +37,14 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.iam.user.v1.servi
37
37
  if not _descriptor._USE_C_DESCRIPTORS:
38
38
  _globals['DESCRIPTOR']._loaded_options = None
39
39
  _globals['DESCRIPTOR']._serialized_options = b'\n\034co.meshtrade.api.iam.user.v1Z/github.com/meshtrade/api/go/iam/user/v1;user_v1'
40
- _globals['_ASSIGNROLETOUSERREQUEST'].fields_by_name['name']._loaded_options = None
41
- _globals['_ASSIGNROLETOUSERREQUEST'].fields_by_name['name']._serialized_options = b'\272H5r32.^users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001 '
42
- _globals['_ASSIGNROLETOUSERREQUEST'].fields_by_name['role']._loaded_options = None
43
- _globals['_ASSIGNROLETOUSERREQUEST'].fields_by_name['role']._serialized_options = b'\272HGrB2=^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/[1-9][0-9]{6}$\230\001)\310\001\001'
40
+ _globals['_ASSIGNROLESTOUSERREQUEST'].fields_by_name['name']._loaded_options = None
41
+ _globals['_ASSIGNROLESTOUSERREQUEST'].fields_by_name['name']._serialized_options = b'\272H8r32.^users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001 \310\001\001'
42
+ _globals['_ASSIGNROLESTOUSERREQUEST'].fields_by_name['roles']._loaded_options = None
43
+ _globals['_ASSIGNROLESTOUSERREQUEST'].fields_by_name['roles']._serialized_options = b'\272HU\222\001O\"MrK\020/\03002E^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$\310\001\001'
44
+ _globals['_REVOKEROLESFROMUSERREQUEST'].fields_by_name['name']._loaded_options = None
45
+ _globals['_REVOKEROLESFROMUSERREQUEST'].fields_by_name['name']._serialized_options = b'\272H8r32.^users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001 \310\001\001'
46
+ _globals['_REVOKEROLESFROMUSERREQUEST'].fields_by_name['roles']._loaded_options = None
47
+ _globals['_REVOKEROLESFROMUSERREQUEST'].fields_by_name['roles']._serialized_options = b'\272HU\222\001O\"MrK\020/\03002E^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$\310\001\001'
44
48
  _globals['_GETUSERREQUEST'].fields_by_name['name']._loaded_options = None
45
49
  _globals['_GETUSERREQUEST'].fields_by_name['name']._serialized_options = b'\272H8r32.^users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001 \310\001\001'
46
50
  _globals['_LISTUSERSREQUEST_SORTING'].fields_by_name['field']._loaded_options = None
@@ -51,8 +55,10 @@ if not _descriptor._USE_C_DESCRIPTORS:
51
55
  _globals['_CREATEUSERREQUEST'].fields_by_name['user']._serialized_options = b'\272H\003\310\001\001'
52
56
  _globals['_UPDATEUSERREQUEST'].fields_by_name['user']._loaded_options = None
53
57
  _globals['_UPDATEUSERREQUEST'].fields_by_name['user']._serialized_options = b'\272H\003\310\001\001'
54
- _globals['_USERSERVICE'].methods_by_name['AssignRoleToUser']._loaded_options = None
55
- _globals['_USERSERVICE'].methods_by_name['AssignRoleToUser']._serialized_options = b'\240\265\030\002\252\265\030\n\n\010\300\215\267\001\306\215\267\001'
58
+ _globals['_USERSERVICE'].methods_by_name['AssignRolesToUser']._loaded_options = None
59
+ _globals['_USERSERVICE'].methods_by_name['AssignRolesToUser']._serialized_options = b'\240\265\030\002\252\265\030\n\n\010\300\215\267\001\306\215\267\001'
60
+ _globals['_USERSERVICE'].methods_by_name['RevokeRolesFromUser']._loaded_options = None
61
+ _globals['_USERSERVICE'].methods_by_name['RevokeRolesFromUser']._serialized_options = b'\240\265\030\002\252\265\030\n\n\010\300\215\267\001\306\215\267\001'
56
62
  _globals['_USERSERVICE'].methods_by_name['GetUser']._loaded_options = None
57
63
  _globals['_USERSERVICE'].methods_by_name['GetUser']._serialized_options = b'\240\265\030\001\252\265\030\022\n\020\300\215\267\001\301\215\267\001\306\215\267\001\307\215\267\001'
58
64
  _globals['_USERSERVICE'].methods_by_name['ListUsers']._loaded_options = None
@@ -63,26 +69,28 @@ if not _descriptor._USE_C_DESCRIPTORS:
63
69
  _globals['_USERSERVICE'].methods_by_name['CreateUser']._serialized_options = b'\240\265\030\002\252\265\030\n\n\010\300\215\267\001\306\215\267\001'
64
70
  _globals['_USERSERVICE'].methods_by_name['UpdateUser']._loaded_options = None
65
71
  _globals['_USERSERVICE'].methods_by_name['UpdateUser']._serialized_options = b'\240\265\030\002\252\265\030\n\n\010\300\215\267\001\306\215\267\001'
66
- _globals['_ASSIGNROLETOUSERREQUEST']._serialized_start=232
67
- _globals['_ASSIGNROLETOUSERREQUEST']._serialized_end=431
68
- _globals['_GETUSERREQUEST']._serialized_start=433
69
- _globals['_GETUSERREQUEST']._serialized_end=530
70
- _globals['_LISTUSERSREQUEST']._serialized_start=533
71
- _globals['_LISTUSERSREQUEST']._serialized_end=809
72
- _globals['_LISTUSERSREQUEST_SORTING']._serialized_start=629
73
- _globals['_LISTUSERSREQUEST_SORTING']._serialized_end=809
74
- _globals['_LISTUSERSRESPONSE']._serialized_start=811
75
- _globals['_LISTUSERSRESPONSE']._serialized_end=881
76
- _globals['_SEARCHUSERSREQUEST']._serialized_start=884
77
- _globals['_SEARCHUSERSREQUEST']._serialized_end=1186
78
- _globals['_SEARCHUSERSREQUEST_SORTING']._serialized_start=629
79
- _globals['_SEARCHUSERSREQUEST_SORTING']._serialized_end=809
80
- _globals['_SEARCHUSERSRESPONSE']._serialized_start=1188
81
- _globals['_SEARCHUSERSRESPONSE']._serialized_end=1260
82
- _globals['_CREATEUSERREQUEST']._serialized_start=1262
83
- _globals['_CREATEUSERREQUEST']._serialized_end=1338
84
- _globals['_UPDATEUSERREQUEST']._serialized_start=1340
85
- _globals['_UPDATEUSERREQUEST']._serialized_end=1416
86
- _globals['_USERSERVICE']._serialized_start=1419
87
- _globals['_USERSERVICE']._serialized_end=2121
72
+ _globals['_ASSIGNROLESTOUSERREQUEST']._serialized_start=232
73
+ _globals['_ASSIGNROLESTOUSERREQUEST']._serialized_end=451
74
+ _globals['_REVOKEROLESFROMUSERREQUEST']._serialized_start=454
75
+ _globals['_REVOKEROLESFROMUSERREQUEST']._serialized_end=675
76
+ _globals['_GETUSERREQUEST']._serialized_start=677
77
+ _globals['_GETUSERREQUEST']._serialized_end=774
78
+ _globals['_LISTUSERSREQUEST']._serialized_start=777
79
+ _globals['_LISTUSERSREQUEST']._serialized_end=1053
80
+ _globals['_LISTUSERSREQUEST_SORTING']._serialized_start=873
81
+ _globals['_LISTUSERSREQUEST_SORTING']._serialized_end=1053
82
+ _globals['_LISTUSERSRESPONSE']._serialized_start=1055
83
+ _globals['_LISTUSERSRESPONSE']._serialized_end=1125
84
+ _globals['_SEARCHUSERSREQUEST']._serialized_start=1128
85
+ _globals['_SEARCHUSERSREQUEST']._serialized_end=1430
86
+ _globals['_SEARCHUSERSREQUEST_SORTING']._serialized_start=873
87
+ _globals['_SEARCHUSERSREQUEST_SORTING']._serialized_end=1053
88
+ _globals['_SEARCHUSERSRESPONSE']._serialized_start=1432
89
+ _globals['_SEARCHUSERSRESPONSE']._serialized_end=1504
90
+ _globals['_CREATEUSERREQUEST']._serialized_start=1506
91
+ _globals['_CREATEUSERREQUEST']._serialized_end=1582
92
+ _globals['_UPDATEUSERREQUEST']._serialized_start=1584
93
+ _globals['_UPDATEUSERREQUEST']._serialized_end=1660
94
+ _globals['_USERSERVICE']._serialized_start=1663
95
+ _globals['_USERSERVICE']._serialized_end=2490
88
96
  # @@protoc_insertion_point(module_scope)
@@ -11,13 +11,21 @@ from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
11
11
 
12
12
  DESCRIPTOR: _descriptor.FileDescriptor
13
13
 
14
- class AssignRoleToUserRequest(_message.Message):
15
- __slots__ = ("name", "role")
14
+ class AssignRolesToUserRequest(_message.Message):
15
+ __slots__ = ("name", "roles")
16
16
  NAME_FIELD_NUMBER: _ClassVar[int]
17
- ROLE_FIELD_NUMBER: _ClassVar[int]
17
+ ROLES_FIELD_NUMBER: _ClassVar[int]
18
18
  name: str
19
- role: str
20
- def __init__(self, name: _Optional[str] = ..., role: _Optional[str] = ...) -> None: ...
19
+ roles: _containers.RepeatedScalarFieldContainer[str]
20
+ def __init__(self, name: _Optional[str] = ..., roles: _Optional[_Iterable[str]] = ...) -> None: ...
21
+
22
+ class RevokeRolesFromUserRequest(_message.Message):
23
+ __slots__ = ("name", "roles")
24
+ NAME_FIELD_NUMBER: _ClassVar[int]
25
+ ROLES_FIELD_NUMBER: _ClassVar[int]
26
+ name: str
27
+ roles: _containers.RepeatedScalarFieldContainer[str]
28
+ def __init__(self, name: _Optional[str] = ..., roles: _Optional[_Iterable[str]] = ...) -> None: ...
21
29
 
22
30
  class GetUserRequest(_message.Message):
23
31
  __slots__ = ("name",)
@@ -25,9 +25,14 @@ class UserServiceStub(object):
25
25
  Args:
26
26
  channel: A grpc.Channel.
27
27
  """
28
- self.AssignRoleToUser = channel.unary_unary(
29
- '/meshtrade.iam.user.v1.UserService/AssignRoleToUser',
30
- request_serializer=meshtrade_dot_iam_dot_user_dot_v1_dot_service__pb2.AssignRoleToUserRequest.SerializeToString,
28
+ self.AssignRolesToUser = channel.unary_unary(
29
+ '/meshtrade.iam.user.v1.UserService/AssignRolesToUser',
30
+ request_serializer=meshtrade_dot_iam_dot_user_dot_v1_dot_service__pb2.AssignRolesToUserRequest.SerializeToString,
31
+ response_deserializer=meshtrade_dot_iam_dot_user_dot_v1_dot_user__pb2.User.FromString,
32
+ _registered_method=True)
33
+ self.RevokeRolesFromUser = channel.unary_unary(
34
+ '/meshtrade.iam.user.v1.UserService/RevokeRolesFromUser',
35
+ request_serializer=meshtrade_dot_iam_dot_user_dot_v1_dot_service__pb2.RevokeRolesFromUserRequest.SerializeToString,
31
36
  response_deserializer=meshtrade_dot_iam_dot_user_dot_v1_dot_user__pb2.User.FromString,
32
37
  _registered_method=True)
33
38
  self.GetUser = channel.unary_unary(
@@ -70,9 +75,9 @@ class UserServiceServicer(object):
70
75
  the authenticated group context.
71
76
  """
72
77
 
73
- def AssignRoleToUser(self, request, context):
78
+ def AssignRolesToUser(self, request, context):
74
79
  """
75
- Assigns a role to an existing user within the authenticated group context.
80
+ Assign roles to an existing user within the authenticated group context.
76
81
 
77
82
  The role assignment enables the user to perform operations according
78
83
  to the permissions associated with that role within the group hierarchy.
@@ -81,6 +86,18 @@ class UserServiceServicer(object):
81
86
  context.set_details('Method not implemented!')
82
87
  raise NotImplementedError('Method not implemented!')
83
88
 
89
+ def RevokeRolesFromUser(self, request, context):
90
+ """
91
+ Revoke roles from an existing user within the authenticated group context.
92
+
93
+ The role revocation removes the permissions associated with that role from
94
+ the user within the group hierarchy. The user will no longer be able
95
+ to perform operations that require the revoked role.
96
+ """
97
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
98
+ context.set_details('Method not implemented!')
99
+ raise NotImplementedError('Method not implemented!')
100
+
84
101
  def GetUser(self, request, context):
85
102
  """
86
103
  Retrieves a single user by its unique identifier.
@@ -142,9 +159,14 @@ class UserServiceServicer(object):
142
159
 
143
160
  def add_UserServiceServicer_to_server(servicer, server):
144
161
  rpc_method_handlers = {
145
- 'AssignRoleToUser': grpc.unary_unary_rpc_method_handler(
146
- servicer.AssignRoleToUser,
147
- request_deserializer=meshtrade_dot_iam_dot_user_dot_v1_dot_service__pb2.AssignRoleToUserRequest.FromString,
162
+ 'AssignRolesToUser': grpc.unary_unary_rpc_method_handler(
163
+ servicer.AssignRolesToUser,
164
+ request_deserializer=meshtrade_dot_iam_dot_user_dot_v1_dot_service__pb2.AssignRolesToUserRequest.FromString,
165
+ response_serializer=meshtrade_dot_iam_dot_user_dot_v1_dot_user__pb2.User.SerializeToString,
166
+ ),
167
+ 'RevokeRolesFromUser': grpc.unary_unary_rpc_method_handler(
168
+ servicer.RevokeRolesFromUser,
169
+ request_deserializer=meshtrade_dot_iam_dot_user_dot_v1_dot_service__pb2.RevokeRolesFromUserRequest.FromString,
148
170
  response_serializer=meshtrade_dot_iam_dot_user_dot_v1_dot_user__pb2.User.SerializeToString,
149
171
  ),
150
172
  'GetUser': grpc.unary_unary_rpc_method_handler(
@@ -194,7 +216,34 @@ class UserService(object):
194
216
  """
195
217
 
196
218
  @staticmethod
197
- def AssignRoleToUser(request,
219
+ def AssignRolesToUser(request,
220
+ target,
221
+ options=(),
222
+ channel_credentials=None,
223
+ call_credentials=None,
224
+ insecure=False,
225
+ compression=None,
226
+ wait_for_ready=None,
227
+ timeout=None,
228
+ metadata=None):
229
+ return grpc.experimental.unary_unary(
230
+ request,
231
+ target,
232
+ '/meshtrade.iam.user.v1.UserService/AssignRolesToUser',
233
+ meshtrade_dot_iam_dot_user_dot_v1_dot_service__pb2.AssignRolesToUserRequest.SerializeToString,
234
+ meshtrade_dot_iam_dot_user_dot_v1_dot_user__pb2.User.FromString,
235
+ options,
236
+ channel_credentials,
237
+ insecure,
238
+ call_credentials,
239
+ compression,
240
+ wait_for_ready,
241
+ timeout,
242
+ metadata,
243
+ _registered_method=True)
244
+
245
+ @staticmethod
246
+ def RevokeRolesFromUser(request,
198
247
  target,
199
248
  options=(),
200
249
  channel_credentials=None,
@@ -207,8 +256,8 @@ class UserService(object):
207
256
  return grpc.experimental.unary_unary(
208
257
  request,
209
258
  target,
210
- '/meshtrade.iam.user.v1.UserService/AssignRoleToUser',
211
- meshtrade_dot_iam_dot_user_dot_v1_dot_service__pb2.AssignRoleToUserRequest.SerializeToString,
259
+ '/meshtrade.iam.user.v1.UserService/RevokeRolesFromUser',
260
+ meshtrade_dot_iam_dot_user_dot_v1_dot_service__pb2.RevokeRolesFromUserRequest.SerializeToString,
212
261
  meshtrade_dot_iam_dot_user_dot_v1_dot_user__pb2.User.FromString,
213
262
  options,
214
263
  channel_credentials,
@@ -25,7 +25,7 @@ _sym_db = _symbol_database.Default()
25
25
  from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2
26
26
 
27
27
 
28
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n meshtrade/iam/user/v1/user.proto\x12\x15meshtrade.iam.user.v1\x1a\x1b\x62uf/validate/validate.proto\"\x9d\x03\n\x04User\x12\xba\x01\n\x04name\x18\x01 \x01(\tB\xa5\x01\xbaH\xa1\x01\xba\x01\x9d\x01\n\x14name.format.optional\x12\x32name must be empty or in the format users/{ULIDv2}\x1aQsize(this) == 0 || this.matches(\'^users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')R\x04name\x12R\n\x05owner\x18\x02 \x01(\tB<\xbaH9r42/^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01!\xc8\x01\x01R\x05owner\x12 \n\x05\x65mail\x18\x04 \x01(\tB\n\xbaH\x07r\x02`\x01\xc8\x01\x01R\x05\x65mail\x12\x62\n\x05roles\x18\x06 \x03(\tBL\xbaHI\x92\x01\x46\"DrB2=^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/[1-9][0-9]{6}$\x98\x01)R\x05rolesBO\n\x1c\x63o.meshtrade.api.iam.user.v1Z/github.com/meshtrade/api/go/iam/user/v1;user_v1b\x06proto3')
28
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n meshtrade/iam/user/v1/user.proto\x12\x15meshtrade.iam.user.v1\x1a\x1b\x62uf/validate/validate.proto\"\xa6\x03\n\x04User\x12\xba\x01\n\x04name\x18\x01 \x01(\tB\xa5\x01\xbaH\xa1\x01\xba\x01\x9d\x01\n\x14name.format.optional\x12\x32name must be empty or in the format users/{ULIDv2}\x1aQsize(this) == 0 || this.matches(\'^users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')R\x04name\x12R\n\x05owner\x18\x02 \x01(\tB<\xbaH9r42/^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01!\xc8\x01\x01R\x05owner\x12 \n\x05\x65mail\x18\x03 \x01(\tB\n\xbaH\x07r\x02`\x01\xc8\x01\x01R\x05\x65mail\x12k\n\x05roles\x18\x04 \x03(\tBU\xbaHR\x92\x01O\"MrK\x10/\x18\x30\x32\x45^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$R\x05rolesBO\n\x1c\x63o.meshtrade.api.iam.user.v1Z/github.com/meshtrade/api/go/iam/user/v1;user_v1b\x06proto3')
29
29
 
30
30
  _globals = globals()
31
31
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -40,7 +40,7 @@ if not _descriptor._USE_C_DESCRIPTORS:
40
40
  _globals['_USER'].fields_by_name['email']._loaded_options = None
41
41
  _globals['_USER'].fields_by_name['email']._serialized_options = b'\272H\007r\002`\001\310\001\001'
42
42
  _globals['_USER'].fields_by_name['roles']._loaded_options = None
43
- _globals['_USER'].fields_by_name['roles']._serialized_options = b'\272HI\222\001F\"DrB2=^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/[1-9][0-9]{6}$\230\001)'
43
+ _globals['_USER'].fields_by_name['roles']._serialized_options = b'\272HR\222\001O\"MrK\020/\03002E^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$'
44
44
  _globals['_USER']._serialized_start=89
45
- _globals['_USER']._serialized_end=502
45
+ _globals['_USER']._serialized_end=511
46
46
  # @@protoc_insertion_point(module_scope)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshtrade
3
- Version: 1.23.1
3
+ Version: 1.25.0
4
4
  Summary: Integration SDK for Mesh API Services
5
5
  Author-email: Bernard Bussy <bernard@meshtrade.co>
6
6
  License: LicenseRef-My-Custom-License
@@ -7,11 +7,10 @@ meshtrade/common/grpc_client.py,sha256=1gzXEVs4G5ASoezwExw7HX47wZmrrUNnIUkCeMojg
7
7
  meshtrade/common/service_options.py,sha256=DWGVZ7uOMD0mMjNvnYUklxDvuCL6eljbcBomdOfHcfQ,1393
8
8
  meshtrade/compliance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  meshtrade/compliance/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- meshtrade/compliance/client/v1/__init__.py,sha256=xYL3vBhG-w8je0QglfD2bPPnQ3nmCaVA5ZkGXMi9ewQ,3314
11
- meshtrade/compliance/client/v1/client_pb2.py,sha256=hSmwb5nXYc_0KXcfoXfRGQtrKz_uMXiI14bvj9GOAdg,6529
12
- meshtrade/compliance/client/v1/client_pb2.pyi,sha256=j9zwElgm5Ui9-lWWNrtS_-Lu4UWO2_2T7bKlH4GhFSo,2975
10
+ meshtrade/compliance/client/v1/__init__.py,sha256=HIqwU8rwiCq-fc-oOK0YDQX-S6nJVim4y9zat4c485Y,2974
11
+ meshtrade/compliance/client/v1/client_pb2.py,sha256=iXi8P7BRGE9DSRQtXwp6JidpDQ_X6v5cwMzJKK7BuDk,5765
12
+ meshtrade/compliance/client/v1/client_pb2.pyi,sha256=imJNz3FXJ87730TRsavqzXDB8p54fvDw9AIIdWS6tMA,2653
13
13
  meshtrade/compliance/client/v1/client_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
14
- meshtrade/compliance/client/v1/client_roles.py,sha256=uBa4ODK3lF786BokRARTF6O5CVxIoZ2Bp97FoJGX1tw,4302
15
14
  meshtrade/compliance/client/v1/company_pb2.py,sha256=qwDmX-zz6uvPR5-NzmIZUlAyxe6nQaUXlIZQMWtploo,8246
16
15
  meshtrade/compliance/client/v1/company_pb2.pyi,sha256=-hq1v7vEvIIZ4Romag8GHNLO-ztU5Q-qDSO9Bx7JsvY,6606
17
16
  meshtrade/compliance/client/v1/company_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
@@ -56,20 +55,19 @@ meshtrade/compliance/client/v1/verification_status_pb2.py,sha256=RBI8-LnSLSSv6pV
56
55
  meshtrade/compliance/client/v1/verification_status_pb2.pyi,sha256=kqP24po3o2Ks8HWAoQ-tLlMirCJCKwxlQlWJXWkRmAI,880
57
56
  meshtrade/compliance/client/v1/verification_status_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
58
57
  meshtrade/iam/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
- meshtrade/iam/api_user/v1/__init__.py,sha256=7Eil0rRCLqVYubjJqt5pUpJBhtKlKciu4m4F4JrSWGY,3204
58
+ meshtrade/iam/api_user/v1/__init__.py,sha256=rCF1utiWDqUKSuNi-bfSLL18YZvTLfayjlDFsCui_VY,3208
60
59
  meshtrade/iam/api_user/v1/api_credentials.py,sha256=apo3p_YcncNphbxLXegqoYh35bPydhjR-ULsZ7kj4D4,5272
61
60
  meshtrade/iam/api_user/v1/api_credentials_pb2.py,sha256=ssnkOj_oJWlMPXot99Fp1vn4V5u2zKDmie4hKL49x20,3098
62
61
  meshtrade/iam/api_user/v1/api_credentials_pb2.pyi,sha256=TRv0xnm4VJ62sCMz_utdLvQR_vNQqWH_wCE0mtF3ZsY,547
63
62
  meshtrade/iam/api_user/v1/api_credentials_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
64
- meshtrade/iam/api_user/v1/api_user_pb2.py,sha256=k0HZUg-XMKGr1ZpAejXqqv6xZMgTQM-te4jEND5iVcY,4953
63
+ meshtrade/iam/api_user/v1/api_user_pb2.py,sha256=XeyypHdmSgA6IqFQSBxH9dhm9eMluklxogL_6xIiwe0,4976
65
64
  meshtrade/iam/api_user/v1/api_user_pb2.pyi,sha256=ke6t8bEYc6QUw6V8GWC7iTqju7-WrYrRIj5Lw2rdNZ0,2158
66
65
  meshtrade/iam/api_user/v1/api_user_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
67
66
  meshtrade/iam/api_user/v1/api_user_state_machine.py,sha256=fmi0DcYHwpIcUQ7cm01wf0-g0Oj9GSvT_ry7Y53SlmQ,3274
68
- meshtrade/iam/api_user/v1/service.py,sha256=_7-LK9LDkKh7JOQHOryNBE1Xgr-DclAMO2QQhGoumUg,1827
69
- meshtrade/iam/api_user/v1/service_meshpy.py,sha256=tQE0aFvF3hwON0ZIfC_9Lchenqn5RYjz_x68DorYxM8,10617
70
- meshtrade/iam/api_user/v1/service_pb2.py,sha256=50ZseqB-n61OIBMxWUYT9tHtXURFZyYSdjhgpG--2R0,11858
71
- meshtrade/iam/api_user/v1/service_pb2.pyi,sha256=6EfMPzUQuCUn_Dgzqybv-4Opt62xYGHpfafWhBBsw5A,3173
72
- meshtrade/iam/api_user/v1/service_pb2_grpc.py,sha256=PQ06cCgKtjQU6cbQQpT5AaeaK1UFpByZPYVTQlHfG_4,22280
67
+ meshtrade/iam/api_user/v1/service_meshpy.py,sha256=L-XCZj-29fvTTcKoigMMqGAAS0luI7PkpyXkHmS-dB0,10631
68
+ meshtrade/iam/api_user/v1/service_pb2.py,sha256=a5q-2NR7boAeQ4n70FZoFZO0VpRjUHJcYLKsg2YwwQk,11990
69
+ meshtrade/iam/api_user/v1/service_pb2.pyi,sha256=rN4yA9xXMmQdAqFmdcLV_XAUT-1Fp-5Ov_-UwhaSOwI,3289
70
+ meshtrade/iam/api_user/v1/service_pb2_grpc.py,sha256=sslBzpNHPXMtRIO18hqe6IeWDYezL_-bkKSrwECsE8o,22296
73
71
  meshtrade/iam/group/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
72
  meshtrade/iam/group/v1/__init__.py,sha256=KAIMS3_Lp-oqlm5dAAZzWRKgbadBffgv0x_K1j1CZl8,1998
75
73
  meshtrade/iam/group/v1/group_pb2.py,sha256=5VZ1m6uUDm7_dRPP1CPHdBfc35UO_D7BcWscU2fp29c,3187
@@ -80,16 +78,16 @@ meshtrade/iam/group/v1/service_pb2.py,sha256=6_rGs0f190vP8QNSXtXwwoWIi30R16s0aZ9
80
78
  meshtrade/iam/group/v1/service_pb2.pyi,sha256=xg9tmab0dl6szbEAtmRNBPUOYoSQPSzKF7jALB6I2pY,3370
81
79
  meshtrade/iam/group/v1/service_pb2_grpc.py,sha256=RHubfJy336fjw6TTTGyRASCl51SVIgE4oyl2nTWYeKk,13142
82
80
  meshtrade/iam/role/v1/__init__.py,sha256=4VPt1fX9Jl3MtZMmqdHAiFbvzVeujXnTNtV6yULS-44,1904
83
- meshtrade/iam/role/v1/role.py,sha256=rMTeqvsSEfSlg8dYsr0BCfgIKeTu5DrTpr8RwuRYTRk,5061
81
+ meshtrade/iam/role/v1/role.py,sha256=CnKup6yOQAZCA_lNJfCQtep8w8tfpHqXUQ66p7rDAK8,5150
84
82
  meshtrade/iam/role/v1/role_pb2.py,sha256=n4bylzkICavD4uaPInp-T9VBL53JLsa3ppJk6AD1XtM,3635
85
83
  meshtrade/iam/role/v1/role_pb2.pyi,sha256=9zpg4jbD1tVwerq2lIRQ-m8IaNNEKa1esAPOHjolnYw,3048
86
84
  meshtrade/iam/role/v1/role_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
87
- meshtrade/iam/user/v1/__init__.py,sha256=jVIneFgOIOwSZJsXggdUpabdnBJWaLxJ-Cjn_MVB4fk,2034
88
- meshtrade/iam/user/v1/service_meshpy.py,sha256=mzS9E5Up0lo1xzVCdsozHchJi0TgoSKTlQLNMF5A6nc,8530
89
- meshtrade/iam/user/v1/service_pb2.py,sha256=QPQm7uGKqOeZUoaGDhSdUgAjJxjCwWlIyVkNy1EohQk,9554
90
- meshtrade/iam/user/v1/service_pb2.pyi,sha256=-jBiRko_1qAVZl3mZ-S2s7HQiXymT_L4ykzlRZON04g,3459
91
- meshtrade/iam/user/v1/service_pb2_grpc.py,sha256=3oo77hLOMVOB24jdpOdFgtJVpJVJgfFiNUPeaAEK6ek,15245
92
- meshtrade/iam/user/v1/user_pb2.py,sha256=UqpvvmyUAGRF-RJPyx7XMl6M96s-HcCSriDEwcPaSXA,3199
85
+ meshtrade/iam/user/v1/__init__.py,sha256=e4iDNLEKYpoT2tXyEP8j4FKEzNEnyLPpfe39O_6LEFE,2102
86
+ meshtrade/iam/user/v1/service_meshpy.py,sha256=7vDP803eJ3csyCJ-dHoo3UtwfVbNZHisWY7mWOSwlp0,9155
87
+ meshtrade/iam/user/v1/service_pb2.py,sha256=piyN65Lpdth0zEPQygpmpYmdRXIXWl1q1ZIIbiXH4TI,11098
88
+ meshtrade/iam/user/v1/service_pb2.pyi,sha256=GiHgohmNrai2iQS6xgZkLMO_jvlkFPqwQwbhxQVThWc,3856
89
+ meshtrade/iam/user/v1/service_pb2_grpc.py,sha256=ZDh8Xxb_Mpm2UhRDnfAz9z1xSNk-jZ6WC8LuEq4dBAg,17494
90
+ meshtrade/iam/user/v1/user_pb2.py,sha256=zwUvVFb2bfTXxWiBDbm9yid1MwkEON1yOzcmmf8KZUs,3220
93
91
  meshtrade/iam/user/v1/user_pb2.pyi,sha256=Z3x3J5zUhHTr-HNjxJ6pTa37KB4fSOeNumY_GCFYFRs,875
94
92
  meshtrade/iam/user/v1/user_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
95
93
  meshtrade/ledger/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -204,7 +202,7 @@ meshtrade/wallet/account/v1/service_meshpy.py,sha256=n9RS90vovMnngy0gX13e97E8oz-
204
202
  meshtrade/wallet/account/v1/service_pb2.py,sha256=5nCMFtZlx3T9XPO3cycrjPbSSD7_v0lttuPy2iSDjHg,11527
205
203
  meshtrade/wallet/account/v1/service_pb2.pyi,sha256=-DT_P3Pw7The581dI02FbxT53VpZAK8BtdvvoUTe_Nc,4734
206
204
  meshtrade/wallet/account/v1/service_pb2_grpc.py,sha256=yXPgA-VvToS7uQqq8Wla8zttwgesTDYW3hNRUmA4sT4,18555
207
- meshtrade-1.23.1.dist-info/METADATA,sha256=k58Z8PS9D3mryFTbMylskbk7Bo3A-NplReZYYeA-fjQ,3007
208
- meshtrade-1.23.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
209
- meshtrade-1.23.1.dist-info/top_level.txt,sha256=NV0mf_yWXSvBwj2_q5aSz2hN5hQF0QypAiJwV4schJI,14
210
- meshtrade-1.23.1.dist-info/RECORD,,
205
+ meshtrade-1.25.0.dist-info/METADATA,sha256=3EKJ40KeUMqRxaKyh86o2nDlmh1TFPNh0xe0SPUsMj4,3007
206
+ meshtrade-1.25.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
207
+ meshtrade-1.25.0.dist-info/top_level.txt,sha256=NV0mf_yWXSvBwj2_q5aSz2hN5hQF0QypAiJwV4schJI,14
208
+ meshtrade-1.25.0.dist-info/RECORD,,
@@ -1,123 +0,0 @@
1
- """Client roles utility functions."""
2
-
3
- from meshtrade.compliance.client.v1.client_pb2 import Client
4
- from meshtrade.iam.role.v1 import role_pb2
5
- from meshtrade.iam.role.v1.role_pb2 import Role
6
-
7
- # Cache for client default roles extracted from protobuf
8
- _client_default_roles: list[Role] | None = None
9
- _client_default_roles_error: str | None = None
10
-
11
-
12
- def _initialize_client_default_roles() -> None:
13
- """Initialize client default roles from protobuf extensions.
14
-
15
- This function is called once to extract roles from the Client message's
16
- message_roles extension. Results are cached for subsequent calls.
17
- """
18
- global _client_default_roles, _client_default_roles_error
19
-
20
- if _client_default_roles is not None or _client_default_roles_error is not None:
21
- return
22
-
23
- try:
24
- # Get the Client message descriptor
25
- client_descriptor = Client.DESCRIPTOR
26
-
27
- # Get message options
28
- options = client_descriptor.GetOptions()
29
-
30
- # Get the message_roles extension descriptor
31
- message_roles_ext = role_pb2.message_roles
32
-
33
- # Check if extension is present
34
- # Type ignore: protobuf extension API has overly strict type stubs
35
- if not options.HasExtension(message_roles_ext): # type: ignore[arg-type]
36
- _client_default_roles_error = f"proto message {client_descriptor.full_name} does not define extension {message_roles_ext.full_name}"
37
- return
38
-
39
- # Get the RoleList from the extension
40
- # Type ignore: protobuf extension API has overly strict type stubs
41
- role_list = options.Extensions[message_roles_ext] # type: ignore[arg-type]
42
-
43
- # Extract roles and make a copy
44
- _client_default_roles = list(role_list.roles)
45
-
46
- except Exception as e:
47
- _client_default_roles_error = f"failed to extract roles from Client message: {e}"
48
-
49
-
50
- def get_client_default_roles() -> list[Role]:
51
- """Get default roles for a client.
52
-
53
- Returns the roles declared on the meshtrade.compliance.client.v1.Client
54
- message via the meshtrade.iam.role.v1.message_roles option. The returned
55
- list is a copy so callers can safely mutate it without affecting subsequent reads.
56
-
57
- Returns:
58
- List of default Role values for clients
59
- Empty list if retrieval fails
60
- """
61
- try:
62
- return must_get_client_default_roles()
63
- except ValueError:
64
- return []
65
-
66
-
67
- def must_get_client_default_roles() -> list[Role]:
68
- """Get default roles for a client, raising error on failure.
69
-
70
- Returns the roles declared on the meshtrade.compliance.client.v1.Client
71
- message via the meshtrade.iam.role.v1.message_roles option. The returned
72
- list is a copy so callers can safely mutate it without affecting subsequent reads.
73
-
74
- Returns:
75
- List of default Role values for clients
76
-
77
- Raises:
78
- ValueError: If default roles cannot be determined
79
- """
80
- _initialize_client_default_roles()
81
-
82
- if _client_default_roles_error is not None:
83
- raise ValueError(_client_default_roles_error)
84
-
85
- if _client_default_roles is None:
86
- raise ValueError("client default roles not initialized")
87
-
88
- # Return a copy to prevent mutation
89
- return list(_client_default_roles)
90
-
91
-
92
- def get_client_default_role_index() -> dict[Role, bool]:
93
- """Get default roles as a lookup index.
94
-
95
- Builds a set-like map keyed by roles declared on the
96
- meshtrade.compliance.client.v1.Client message. The map's values are always
97
- True; the structure is intended for efficient membership checks.
98
-
99
- Returns:
100
- Dictionary mapping Role to True for default roles
101
- Empty dict if retrieval fails
102
- """
103
- try:
104
- return must_get_client_default_role_index()
105
- except ValueError:
106
- return {}
107
-
108
-
109
- def must_get_client_default_role_index() -> dict[Role, bool]:
110
- """Get default roles as lookup index, raising error on failure.
111
-
112
- Builds a set-like map keyed by roles declared on the
113
- meshtrade.compliance.client.v1.Client message. The map's values are always
114
- True; the structure is intended for efficient membership checks.
115
-
116
- Returns:
117
- Dictionary mapping Role to True for default roles
118
-
119
- Raises:
120
- ValueError: If default roles cannot be determined
121
- """
122
- roles = must_get_client_default_roles()
123
- return dict.fromkeys(roles, True)
@@ -1,58 +0,0 @@
1
- """
2
- ApiUserService interface definition.
3
- """
4
-
5
- from abc import ABC, abstractmethod
6
- from datetime import timedelta
7
-
8
- from .api_user_pb2 import APIUser
9
- from .service_pb2 import (
10
- ActivateApiUserRequest,
11
- CreateApiUserRequest,
12
- DeactivateApiUserRequest,
13
- GetApiUserByKeyHashRequest,
14
- GetApiUserRequest,
15
- ListApiUsersRequest,
16
- ListApiUsersResponse,
17
- SearchApiUsersRequest,
18
- SearchApiUsersResponse,
19
- )
20
-
21
-
22
- class ApiUserService(ABC):
23
- """Abstract base class defining the ApiUserService interface."""
24
-
25
- @abstractmethod
26
- def get_api_user(self, request: GetApiUserRequest, timeout: timedelta | None = None) -> APIUser:
27
- """Get an API user by name."""
28
- pass
29
-
30
- @abstractmethod
31
- def create_api_user(self, request: CreateApiUserRequest, timeout: timedelta | None = None) -> APIUser:
32
- """Create a new API user."""
33
- pass
34
-
35
- @abstractmethod
36
- def list_api_users(self, request: ListApiUsersRequest, timeout: timedelta | None = None) -> ListApiUsersResponse:
37
- """List API users."""
38
- pass
39
-
40
- @abstractmethod
41
- def search_api_users(self, request: SearchApiUsersRequest, timeout: timedelta | None = None) -> SearchApiUsersResponse:
42
- """Search API users by display name."""
43
- pass
44
-
45
- @abstractmethod
46
- def activate_api_user(self, request: ActivateApiUserRequest, timeout: timedelta | None = None) -> APIUser:
47
- """Activate an API user."""
48
- pass
49
-
50
- @abstractmethod
51
- def deactivate_api_user(self, request: DeactivateApiUserRequest, timeout: timedelta | None = None) -> APIUser:
52
- """Deactivate an API user."""
53
- pass
54
-
55
- @abstractmethod
56
- def get_api_user_by_key_hash(self, request: GetApiUserByKeyHashRequest, timeout: timedelta | None = None) -> APIUser:
57
- """Get an API user by key hash."""
58
- pass