meshtrade 1.0.1__py3-none-any.whl → 1.29.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.
Files changed (163) hide show
  1. meshtrade/common/__init__.py +2 -4
  2. meshtrade/common/config.py +3 -4
  3. meshtrade/common/grpc_client.py +140 -0
  4. meshtrade/common/service_options.py +46 -0
  5. meshtrade/compliance/client/v1/__init__.py +0 -2
  6. meshtrade/compliance/client/v1/client_pb2.py +15 -4
  7. meshtrade/compliance/client/v1/client_pb2.pyi +1 -0
  8. meshtrade/compliance/client/v1/company_pb2.py +25 -8
  9. meshtrade/compliance/client/v1/company_pb2.pyi +1 -0
  10. meshtrade/compliance/client/v1/company_representative_pb2.py +9 -4
  11. meshtrade/compliance/client/v1/company_representative_pb2.pyi +1 -0
  12. meshtrade/compliance/client/v1/company_representative_role_pb2.py +2 -2
  13. meshtrade/compliance/client/v1/fund_pb2.py +13 -4
  14. meshtrade/compliance/client/v1/fund_pb2.pyi +1 -0
  15. meshtrade/compliance/client/v1/identification_document_type_pb2.py +2 -2
  16. meshtrade/compliance/client/v1/industry_classification_pb2.py +2 -2
  17. meshtrade/compliance/client/v1/natural_person_connection_type_pb2.py +2 -2
  18. meshtrade/compliance/client/v1/natural_person_pb2.py +19 -4
  19. meshtrade/compliance/client/v1/natural_person_pb2.pyi +1 -0
  20. meshtrade/compliance/client/v1/pep_status_pb2.py +2 -2
  21. meshtrade/compliance/client/v1/service_meshpy.py +2 -1
  22. meshtrade/compliance/client/v1/service_pb2.py +21 -17
  23. meshtrade/compliance/client/v1/service_pb2.pyi +2 -2
  24. meshtrade/compliance/client/v1/source_of_income_and_wealth_pb2.py +2 -2
  25. meshtrade/compliance/client/v1/tax_residency_pb2.py +9 -4
  26. meshtrade/compliance/client/v1/tax_residency_pb2.pyi +1 -0
  27. meshtrade/compliance/client/v1/trust_pb2.py +13 -4
  28. meshtrade/compliance/client/v1/trust_pb2.pyi +1 -0
  29. meshtrade/compliance/client/v1/verification_status_pb2.py +2 -2
  30. meshtrade/iam/api_user/v1/__init__.py +34 -26
  31. meshtrade/iam/api_user/v1/api_credentials_pb2.py +5 -5
  32. meshtrade/iam/api_user/v1/api_user_pb2.py +13 -9
  33. meshtrade/iam/api_user/v1/api_user_pb2.pyi +2 -4
  34. meshtrade/iam/api_user/v1/api_user_state_machine.py +104 -0
  35. meshtrade/iam/api_user/v1/service_meshpy.py +96 -61
  36. meshtrade/iam/api_user/v1/service_pb2.py +61 -40
  37. meshtrade/iam/api_user/v1/service_pb2.pyi +26 -11
  38. meshtrade/iam/api_user/v1/service_pb2_grpc.py +179 -135
  39. meshtrade/iam/group/v1/__init__.py +4 -2
  40. meshtrade/iam/group/v1/group_pb2.py +13 -4
  41. meshtrade/iam/group/v1/group_pb2.pyi +9 -2
  42. meshtrade/iam/group/v1/service_meshpy.py +41 -6
  43. meshtrade/iam/group/v1/service_pb2.py +47 -20
  44. meshtrade/iam/group/v1/service_pb2.pyi +46 -13
  45. meshtrade/iam/group/v1/service_pb2_grpc.py +151 -16
  46. meshtrade/iam/role/v1/__init__.py +17 -4
  47. meshtrade/iam/role/v1/role.py +162 -11
  48. meshtrade/iam/role/v1/role_pb2.py +4 -7
  49. meshtrade/iam/role/v1/role_pb2.pyi +53 -23
  50. meshtrade/iam/user/v1/__init__.py +22 -4
  51. meshtrade/iam/user/v1/service_meshpy.py +129 -7
  52. meshtrade/iam/user/v1/service_pb2.py +66 -16
  53. meshtrade/iam/user/v1/service_pb2.pyi +81 -9
  54. meshtrade/iam/user/v1/service_pb2_grpc.py +385 -14
  55. meshtrade/iam/user/v1/user_pb2.py +13 -4
  56. meshtrade/iam/user/v1/user_pb2.pyi +7 -2
  57. meshtrade/ledger/transaction/v1/__init__.py +25 -1
  58. meshtrade/ledger/transaction/v1/service_meshpy.py +176 -0
  59. meshtrade/ledger/transaction/v1/service_pb2.py +56 -0
  60. meshtrade/ledger/transaction/v1/service_pb2.pyi +32 -0
  61. meshtrade/ledger/transaction/v1/service_pb2_grpc.py +131 -0
  62. meshtrade/ledger/transaction/v1/transaction_action_pb2.py +2 -2
  63. meshtrade/ledger/transaction/v1/transaction_state_machine.py +75 -0
  64. meshtrade/ledger/transaction/v1/transaction_state_pb2.py +2 -2
  65. meshtrade/{reporting/income_report → market_data/price}/v1/__init__.py +11 -20
  66. meshtrade/market_data/price/v1/price_pb2.py +40 -0
  67. meshtrade/market_data/price/v1/price_pb2.pyi +23 -0
  68. meshtrade/market_data/price/v1/service_meshpy.py +152 -0
  69. meshtrade/market_data/price/v1/service_pb2.py +49 -0
  70. meshtrade/market_data/price/v1/service_pb2.pyi +18 -0
  71. meshtrade/market_data/price/v1/service_pb2_grpc.py +84 -0
  72. meshtrade/option/method_options/v1/__init__.py +41 -0
  73. meshtrade/option/method_options/v1/method_options_pb2.py +43 -0
  74. meshtrade/option/method_options/v1/method_options_pb2.pyi +40 -0
  75. meshtrade/reporting/account_report/v1/__init__.py +66 -0
  76. meshtrade/reporting/account_report/v1/account_report_pb2.py +46 -0
  77. meshtrade/reporting/account_report/v1/account_report_pb2.pyi +49 -0
  78. meshtrade/reporting/{income_report → account_report}/v1/disclaimer_pb2.py +7 -7
  79. meshtrade/reporting/account_report/v1/fee_entry_pb2.py +39 -0
  80. meshtrade/reporting/account_report/v1/fee_entry_pb2.pyi +26 -0
  81. meshtrade/reporting/account_report/v1/fee_entry_pb2_grpc.py +4 -0
  82. meshtrade/reporting/account_report/v1/income_entry.py +35 -0
  83. meshtrade/reporting/account_report/v1/income_entry_pb2.py +42 -0
  84. meshtrade/reporting/{income_report/v1/entry_pb2.pyi → account_report/v1/income_entry_pb2.pyi} +18 -10
  85. meshtrade/reporting/account_report/v1/income_entry_pb2_grpc.py +4 -0
  86. meshtrade/reporting/{income_report → account_report}/v1/service_meshpy.py +37 -36
  87. meshtrade/reporting/account_report/v1/service_pb2.py +72 -0
  88. meshtrade/reporting/account_report/v1/service_pb2.pyi +43 -0
  89. meshtrade/reporting/account_report/v1/service_pb2_grpc.py +161 -0
  90. meshtrade/reporting/account_report/v1/trading_statement_entry_pb2.py +39 -0
  91. meshtrade/reporting/account_report/v1/trading_statement_entry_pb2.pyi +30 -0
  92. meshtrade/reporting/account_report/v1/trading_statement_entry_pb2_grpc.py +4 -0
  93. meshtrade/studio/instrument/v1/__init__.py +43 -0
  94. meshtrade/studio/instrument/v1/instrument_pb2.py +45 -0
  95. meshtrade/studio/instrument/v1/instrument_pb2.pyi +20 -0
  96. meshtrade/studio/instrument/v1/instrument_pb2_grpc.py +4 -0
  97. meshtrade/studio/instrument/v1/instrument_type_pb2.py +37 -0
  98. meshtrade/studio/instrument/v1/instrument_type_pb2.pyi +64 -0
  99. meshtrade/studio/instrument/v1/instrument_type_pb2_grpc.py +4 -0
  100. meshtrade/studio/instrument/v1/unit_pb2.py +37 -0
  101. meshtrade/studio/instrument/v1/unit_pb2.pyi +46 -0
  102. meshtrade/studio/instrument/v1/unit_pb2_grpc.py +4 -0
  103. meshtrade/trading/limit_order/v1/__init__.py +22 -4
  104. meshtrade/trading/limit_order/v1/limit_order_pb2.py +24 -4
  105. meshtrade/trading/limit_order/v1/limit_order_pb2.pyi +55 -5
  106. meshtrade/trading/limit_order/v1/service_meshpy.py +113 -2
  107. meshtrade/trading/limit_order/v1/service_pb2.py +49 -9
  108. meshtrade/trading/limit_order/v1/service_pb2.pyi +67 -7
  109. meshtrade/trading/limit_order/v1/service_pb2_grpc.py +321 -4
  110. meshtrade/trading/market_order/v1/__init__.py +0 -2
  111. meshtrade/trading/market_order/v1/market_order_pb2.py +2 -2
  112. meshtrade/trading/market_order/v1/service_meshpy.py +3 -2
  113. meshtrade/trading/market_order/v1/service_pb2.py +8 -9
  114. meshtrade/trading/market_order/v1/service_pb2.pyi +1 -2
  115. meshtrade/type/v1/__init__.py +82 -12
  116. meshtrade/type/v1/address_pb2.py +2 -2
  117. meshtrade/type/v1/amount.py +429 -5
  118. meshtrade/type/v1/amount_pb2.py +2 -2
  119. meshtrade/type/v1/contact_details_pb2.py +2 -2
  120. meshtrade/type/v1/date_pb2.py +2 -2
  121. meshtrade/type/v1/decimal_built_in_conversions.py +8 -3
  122. meshtrade/type/v1/decimal_operations.py +354 -0
  123. meshtrade/type/v1/decimal_pb2.py +2 -2
  124. meshtrade/type/v1/ledger.py +76 -1
  125. meshtrade/type/v1/ledger_pb2.py +2 -2
  126. meshtrade/type/v1/sorting_pb2.py +2 -2
  127. meshtrade/type/v1/time_of_day_pb2.py +2 -2
  128. meshtrade/type/v1/token.py +144 -0
  129. meshtrade/type/v1/token_pb2.py +2 -2
  130. meshtrade/wallet/account/v1/__init__.py +21 -3
  131. meshtrade/wallet/account/v1/account_pb2.py +28 -4
  132. meshtrade/wallet/account/v1/account_pb2.pyi +57 -3
  133. meshtrade/wallet/account/v1/service_meshpy.py +72 -1
  134. meshtrade/wallet/account/v1/service_pb2.py +67 -23
  135. meshtrade/wallet/account/v1/service_pb2.pyi +81 -21
  136. meshtrade/wallet/account/v1/service_pb2_grpc.py +242 -8
  137. {meshtrade-1.0.1.dist-info → meshtrade-1.29.0.dist-info}/METADATA +1 -1
  138. meshtrade-1.29.0.dist-info/RECORD +217 -0
  139. meshtrade/compliance/client/v1/service_options_meshpy.py +0 -65
  140. meshtrade/iam/api_user/v1/service.py +0 -58
  141. meshtrade/iam/api_user/v1/service_options_meshpy.py +0 -65
  142. meshtrade/iam/group/v1/service_options_meshpy.py +0 -65
  143. meshtrade/iam/user/v1/service_options_meshpy.py +0 -65
  144. meshtrade/option/v1/method_type_pb2.py +0 -38
  145. meshtrade/option/v1/method_type_pb2.pyi +0 -17
  146. meshtrade/reporting/income_report/v1/entry_pb2.py +0 -42
  147. meshtrade/reporting/income_report/v1/income_report_pb2.py +0 -44
  148. meshtrade/reporting/income_report/v1/income_report_pb2.pyi +0 -42
  149. meshtrade/reporting/income_report/v1/service_options_meshpy.py +0 -65
  150. meshtrade/reporting/income_report/v1/service_pb2.py +0 -58
  151. meshtrade/reporting/income_report/v1/service_pb2.pyi +0 -37
  152. meshtrade/reporting/income_report/v1/service_pb2_grpc.py +0 -170
  153. meshtrade/trading/limit_order/v1/service_options_meshpy.py +0 -65
  154. meshtrade/trading/market_order/v1/service_options_meshpy.py +0 -65
  155. meshtrade/wallet/account/v1/service_options_meshpy.py +0 -65
  156. meshtrade-1.0.1.dist-info/RECORD +0 -191
  157. /meshtrade/{option/v1/method_type_pb2_grpc.py → market_data/price/v1/price_pb2_grpc.py} +0 -0
  158. /meshtrade/{reporting/income_report/v1/disclaimer_pb2_grpc.py → option/method_options/v1/method_options_pb2_grpc.py} +0 -0
  159. /meshtrade/reporting/{income_report/v1/entry_pb2_grpc.py → account_report/v1/account_report_pb2_grpc.py} +0 -0
  160. /meshtrade/reporting/{income_report → account_report}/v1/disclaimer_pb2.pyi +0 -0
  161. /meshtrade/reporting/{income_report/v1/income_report_pb2_grpc.py → account_report/v1/disclaimer_pb2_grpc.py} +0 -0
  162. {meshtrade-1.0.1.dist-info → meshtrade-1.29.0.dist-info}/WHEEL +0 -0
  163. {meshtrade-1.0.1.dist-info → meshtrade-1.29.0.dist-info}/top_level.txt +0 -0
@@ -24,14 +24,14 @@ _sym_db = _symbol_database.Default()
24
24
 
25
25
 
26
26
 
27
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/meshtrade/compliance/client/v1/pep_status.proto\x12\x1emeshtrade.compliance.client.v1*v\n\tPepStatus\x12\x1a\n\x16PEP_STATUS_UNSPECIFIED\x10\x00\x12\x19\n\x15PEP_STATUS_IS_NOT_PEP\x10\x01\x12\x15\n\x11PEP_STATUS_IS_PEP\x10\x02\x12\x1b\n\x17PEP_STATUS_IS_ASSOCIATE\x10\x03\x42\x62\n%co.meshtrade.api.compliance.client.v1Z9github.com/meshtrade/api/go/compliance/client/v1;clientv1b\x06proto3')
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/meshtrade/compliance/client/v1/pep_status.proto\x12\x1emeshtrade.compliance.client.v1*v\n\tPepStatus\x12\x1a\n\x16PEP_STATUS_UNSPECIFIED\x10\x00\x12\x19\n\x15PEP_STATUS_IS_NOT_PEP\x10\x01\x12\x15\n\x11PEP_STATUS_IS_PEP\x10\x02\x12\x1b\n\x17PEP_STATUS_IS_ASSOCIATE\x10\x03\x42\x63\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1b\x06proto3')
28
28
 
29
29
  _globals = globals()
30
30
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
31
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.compliance.client.v1.pep_status_pb2', _globals)
32
32
  if not _descriptor._USE_C_DESCRIPTORS:
33
33
  _globals['DESCRIPTOR']._loaded_options = None
34
- _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.compliance.client.v1Z9github.com/meshtrade/api/go/compliance/client/v1;clientv1'
34
+ _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1'
35
35
  _globals['_PEPSTATUS']._serialized_start=83
36
36
  _globals['_PEPSTATUS']._serialized_end=201
37
37
  # @@protoc_insertion_point(module_scope)
@@ -9,6 +9,7 @@ the service interface with resource management capabilities, providing authentic
9
9
  timeouts, and proper connection handling.
10
10
  """
11
11
 
12
+ from collections.abc import Iterator
12
13
  from datetime import timedelta
13
14
  from typing import Optional
14
15
 
@@ -16,7 +17,7 @@ from meshtrade.common import BaseGRPCClient
16
17
  from meshtrade.iam.api_user.v1.api_credentials import find_credentials
17
18
 
18
19
  from .client_pb2 import Client
19
- from .service_options_meshpy import ServiceOptions
20
+ from meshtrade.common.service_options import ServiceOptions
20
21
  from .service_pb2 import (
21
22
  CreateClientRequest,
22
23
  GetClientRequest,
@@ -22,33 +22,37 @@ _runtime_version.ValidateProtobufRuntimeVersion(
22
22
  _sym_db = _symbol_database.Default()
23
23
 
24
24
 
25
+ from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2
25
26
  from meshtrade.compliance.client.v1 import client_pb2 as meshtrade_dot_compliance_dot_client_dot_v1_dot_client__pb2
26
- from meshtrade.iam.role.v1 import role_pb2 as meshtrade_dot_iam_dot_role_dot_v1_dot_role__pb2
27
- from meshtrade.option.v1 import method_type_pb2 as meshtrade_dot_option_dot_v1_dot_method__type__pb2
27
+ from meshtrade.option.method_options.v1 import method_options_pb2 as meshtrade_dot_option_dot_method__options_dot_v1_dot_method__options__pb2
28
28
 
29
29
 
30
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,meshtrade/compliance/client/v1/service.proto\x12\x1emeshtrade.compliance.client.v1\x1a+meshtrade/compliance/client/v1/client.proto\x1a meshtrade/iam/role/v1/role.proto\x1a%meshtrade/option/v1/method_type.proto\"&\n\x10GetClientRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\"U\n\x13\x43reateClientRequest\x12>\n\x06\x63lient\x18\x01 \x01(\x0b\x32&.meshtrade.compliance.client.v1.ClientR\x06\x63lient\"\x14\n\x12ListClientsRequest\"W\n\x13ListClientsResponse\x12@\n\x07\x63lients\x18\x01 \x03(\x0b\x32&.meshtrade.compliance.client.v1.ClientR\x07\x63lients2\x8f\x03\n\rClientService\x12z\n\x0c\x43reateClient\x12\x33.meshtrade.compliance.client.v1.CreateClientRequest\x1a&.meshtrade.compliance.client.v1.Client\"\r\xa0\xb5\x18\x02\xaa\xb5\x18\x05\n\x03\x80\x89z\x12w\n\tGetClient\x12\x30.meshtrade.compliance.client.v1.GetClientRequest\x1a&.meshtrade.compliance.client.v1.Client\"\x10\xa0\xb5\x18\x01\xaa\xb5\x18\x08\n\x06\x80\x89z\x81\x89z\x12\x88\x01\n\x0bListClients\x12\x32.meshtrade.compliance.client.v1.ListClientsRequest\x1a\x33.meshtrade.compliance.client.v1.ListClientsResponse\"\x10\xa0\xb5\x18\x01\xaa\xb5\x18\x08\n\x06\x80\x89z\x81\x89zBb\n%co.meshtrade.api.compliance.client.v1Z9github.com/meshtrade/api/go/compliance/client/v1;clientv1b\x06proto3')
30
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,meshtrade/compliance/client/v1/service.proto\x12\x1emeshtrade.compliance.client.v1\x1a\x1b\x62uf/validate/validate.proto\x1a+meshtrade/compliance/client/v1/client.proto\x1a\x37meshtrade/option/method_options/v1/method_options.proto\"e\n\x10GetClientRequest\x12Q\n\x04name\x18\x01 \x01(\tB=\xbaH:r520^clients/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01!\xc8\x01\x01R\x04name\"]\n\x13\x43reateClientRequest\x12\x46\n\x06\x63lient\x18\x01 \x01(\x0b\x32&.meshtrade.compliance.client.v1.ClientB\x06\xbaH\x03\xc8\x01\x01R\x06\x63lient\"\x14\n\x12ListClientsRequest\"W\n\x13ListClientsResponse\x12@\n\x07\x63lients\x18\x01 \x03(\x0b\x32&.meshtrade.compliance.client.v1.ClientR\x07\x63lients2\x9e\x03\n\rClientService\x12}\n\x0c\x43reateClient\x12\x33.meshtrade.compliance.client.v1.CreateClientRequest\x1a&.meshtrade.compliance.client.v1.Client\"\x10\xb2\xb5\x18\x0c\x08\x02\x10\x02\x1a\x06\x80\x89z\x82\x89z\x12}\n\tGetClient\x12\x30.meshtrade.compliance.client.v1.GetClientRequest\x1a&.meshtrade.compliance.client.v1.Client\"\x16\xb2\xb5\x18\x12\x08\x01\x10\x02\x1a\x0c\x80\x89z\x81\x89z\x82\x89z\x83\x89z\x12\x8e\x01\n\x0bListClients\x12\x32.meshtrade.compliance.client.v1.ListClientsRequest\x1a\x33.meshtrade.compliance.client.v1.ListClientsResponse\"\x16\xb2\xb5\x18\x12\x08\x01\x10\x02\x1a\x0c\x80\x89z\x81\x89z\x82\x89z\x83\x89zBc\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1b\x06proto3')
31
31
 
32
32
  _globals = globals()
33
33
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
34
34
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.compliance.client.v1.service_pb2', _globals)
35
35
  if not _descriptor._USE_C_DESCRIPTORS:
36
36
  _globals['DESCRIPTOR']._loaded_options = None
37
- _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.compliance.client.v1Z9github.com/meshtrade/api/go/compliance/client/v1;clientv1'
37
+ _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1'
38
+ _globals['_GETCLIENTREQUEST'].fields_by_name['name']._loaded_options = None
39
+ _globals['_GETCLIENTREQUEST'].fields_by_name['name']._serialized_options = b'\272H:r520^clients/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001!\310\001\001'
40
+ _globals['_CREATECLIENTREQUEST'].fields_by_name['client']._loaded_options = None
41
+ _globals['_CREATECLIENTREQUEST'].fields_by_name['client']._serialized_options = b'\272H\003\310\001\001'
38
42
  _globals['_CLIENTSERVICE'].methods_by_name['CreateClient']._loaded_options = None
39
- _globals['_CLIENTSERVICE'].methods_by_name['CreateClient']._serialized_options = b'\240\265\030\002\252\265\030\005\n\003\200\211z'
43
+ _globals['_CLIENTSERVICE'].methods_by_name['CreateClient']._serialized_options = b'\262\265\030\014\010\002\020\002\032\006\200\211z\202\211z'
40
44
  _globals['_CLIENTSERVICE'].methods_by_name['GetClient']._loaded_options = None
41
- _globals['_CLIENTSERVICE'].methods_by_name['GetClient']._serialized_options = b'\240\265\030\001\252\265\030\010\n\006\200\211z\201\211z'
45
+ _globals['_CLIENTSERVICE'].methods_by_name['GetClient']._serialized_options = b'\262\265\030\022\010\001\020\002\032\014\200\211z\201\211z\202\211z\203\211z'
42
46
  _globals['_CLIENTSERVICE'].methods_by_name['ListClients']._loaded_options = None
43
- _globals['_CLIENTSERVICE'].methods_by_name['ListClients']._serialized_options = b'\240\265\030\001\252\265\030\010\n\006\200\211z\201\211z'
44
- _globals['_GETCLIENTREQUEST']._serialized_start=198
45
- _globals['_GETCLIENTREQUEST']._serialized_end=236
46
- _globals['_CREATECLIENTREQUEST']._serialized_start=238
47
- _globals['_CREATECLIENTREQUEST']._serialized_end=323
48
- _globals['_LISTCLIENTSREQUEST']._serialized_start=325
49
- _globals['_LISTCLIENTSREQUEST']._serialized_end=345
50
- _globals['_LISTCLIENTSRESPONSE']._serialized_start=347
51
- _globals['_LISTCLIENTSRESPONSE']._serialized_end=434
52
- _globals['_CLIENTSERVICE']._serialized_start=437
53
- _globals['_CLIENTSERVICE']._serialized_end=836
47
+ _globals['_CLIENTSERVICE'].methods_by_name['ListClients']._serialized_options = b'\262\265\030\022\010\001\020\002\032\014\200\211z\201\211z\202\211z\203\211z'
48
+ _globals['_GETCLIENTREQUEST']._serialized_start=211
49
+ _globals['_GETCLIENTREQUEST']._serialized_end=312
50
+ _globals['_CREATECLIENTREQUEST']._serialized_start=314
51
+ _globals['_CREATECLIENTREQUEST']._serialized_end=407
52
+ _globals['_LISTCLIENTSREQUEST']._serialized_start=409
53
+ _globals['_LISTCLIENTSREQUEST']._serialized_end=429
54
+ _globals['_LISTCLIENTSRESPONSE']._serialized_start=431
55
+ _globals['_LISTCLIENTSRESPONSE']._serialized_end=518
56
+ _globals['_CLIENTSERVICE']._serialized_start=521
57
+ _globals['_CLIENTSERVICE']._serialized_end=935
54
58
  # @@protoc_insertion_point(module_scope)
@@ -1,6 +1,6 @@
1
+ from buf.validate import validate_pb2 as _validate_pb2
1
2
  from meshtrade.compliance.client.v1 import client_pb2 as _client_pb2
2
- from meshtrade.iam.role.v1 import role_pb2 as _role_pb2
3
- from meshtrade.option.v1 import method_type_pb2 as _method_type_pb2
3
+ from meshtrade.option.method_options.v1 import method_options_pb2 as _method_options_pb2
4
4
  from google.protobuf.internal import containers as _containers
5
5
  from google.protobuf import descriptor as _descriptor
6
6
  from google.protobuf import message as _message
@@ -24,14 +24,14 @@ _sym_db = _symbol_database.Default()
24
24
 
25
25
 
26
26
 
27
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n@meshtrade/compliance/client/v1/source_of_income_and_wealth.proto\x12\x1emeshtrade.compliance.client.v1*\x99\t\n\x17SourceOfIncomeAndWealth\x12+\n\'SOURCE_OF_INCOME_AND_WEALTH_UNSPECIFIED\x10\x00\x12*\n&SOURCE_OF_INCOME_AND_WEALTH_ALLOWANCES\x10\x01\x12\'\n#SOURCE_OF_INCOME_AND_WEALTH_BURSARY\x10\x02\x12+\n\'SOURCE_OF_INCOME_AND_WEALTH_COURT_ORDER\x10\x03\x12:\n6SOURCE_OF_INCOME_AND_WEALTH_LOAN_FINANCIAL_INSTITUTION\x10\x04\x12*\n&SOURCE_OF_INCOME_AND_WEALTH_LOAN_OTHER\x10\x05\x12+\n\'SOURCE_OF_INCOME_AND_WEALTH_MAINTENANCE\x10\x06\x12\x34\n0SOURCE_OF_INCOME_AND_WEALTH_MATURING_INVESTMENTS\x10\x07\x12\'\n#SOURCE_OF_INCOME_AND_WEALTH_PENSION\x10\x08\x12-\n)SOURCE_OF_INCOME_AND_WEALTH_RENTAL_INCOME\x10\t\x12/\n+SOURCE_OF_INCOME_AND_WEALTH_COMPANY_PROFITS\x10\n\x12,\n(SOURCE_OF_INCOME_AND_WEALTH_COMPANY_SALE\x10\x0b\x12/\n+SOURCE_OF_INCOME_AND_WEALTH_DECEASED_ESTATE\x10\x0c\x12\x32\n.SOURCE_OF_INCOME_AND_WEALTH_DIVORCE_SETTLEMENT\x10\r\x12\x30\n,SOURCE_OF_INCOME_AND_WEALTH_GIFT_OR_DONATION\x10\x0e\x12\x36\n2SOURCE_OF_INCOME_AND_WEALTH_INCOME_FROM_EMPLOYMENT\x10\x0f\x12?\n;SOURCE_OF_INCOME_AND_WEALTH_INCOME_FROM_PREVIOUS_EMPLOYMENT\x10\x10\x12+\n\'SOURCE_OF_INCOME_AND_WEALTH_INHERITANCE\x10\x11\x12<\n8SOURCE_OF_INCOME_AND_WEALTH_LOTTERY_WINNINGS_OR_GAMBLING\x10\x12\x12-\n)SOURCE_OF_INCOME_AND_WEALTH_SALE_OF_ASSET\x10\x13\x12.\n*SOURCE_OF_INCOME_AND_WEALTH_SALE_OF_SHARES\x10\x14\x12>\n:SOURCE_OF_INCOME_AND_WEALTH_SAVINGS_INVESTMENT_OR_DIVIDEND\x10\x15\x12\x33\n/SOURCE_OF_INCOME_AND_WEALTH_TRUST_DISTRIBUTIONS\x10\x16\x42\x62\n%co.meshtrade.api.compliance.client.v1Z9github.com/meshtrade/api/go/compliance/client/v1;clientv1b\x06proto3')
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n@meshtrade/compliance/client/v1/source_of_income_and_wealth.proto\x12\x1emeshtrade.compliance.client.v1*\x99\t\n\x17SourceOfIncomeAndWealth\x12+\n\'SOURCE_OF_INCOME_AND_WEALTH_UNSPECIFIED\x10\x00\x12*\n&SOURCE_OF_INCOME_AND_WEALTH_ALLOWANCES\x10\x01\x12\'\n#SOURCE_OF_INCOME_AND_WEALTH_BURSARY\x10\x02\x12+\n\'SOURCE_OF_INCOME_AND_WEALTH_COURT_ORDER\x10\x03\x12:\n6SOURCE_OF_INCOME_AND_WEALTH_LOAN_FINANCIAL_INSTITUTION\x10\x04\x12*\n&SOURCE_OF_INCOME_AND_WEALTH_LOAN_OTHER\x10\x05\x12+\n\'SOURCE_OF_INCOME_AND_WEALTH_MAINTENANCE\x10\x06\x12\x34\n0SOURCE_OF_INCOME_AND_WEALTH_MATURING_INVESTMENTS\x10\x07\x12\'\n#SOURCE_OF_INCOME_AND_WEALTH_PENSION\x10\x08\x12-\n)SOURCE_OF_INCOME_AND_WEALTH_RENTAL_INCOME\x10\t\x12/\n+SOURCE_OF_INCOME_AND_WEALTH_COMPANY_PROFITS\x10\n\x12,\n(SOURCE_OF_INCOME_AND_WEALTH_COMPANY_SALE\x10\x0b\x12/\n+SOURCE_OF_INCOME_AND_WEALTH_DECEASED_ESTATE\x10\x0c\x12\x32\n.SOURCE_OF_INCOME_AND_WEALTH_DIVORCE_SETTLEMENT\x10\r\x12\x30\n,SOURCE_OF_INCOME_AND_WEALTH_GIFT_OR_DONATION\x10\x0e\x12\x36\n2SOURCE_OF_INCOME_AND_WEALTH_INCOME_FROM_EMPLOYMENT\x10\x0f\x12?\n;SOURCE_OF_INCOME_AND_WEALTH_INCOME_FROM_PREVIOUS_EMPLOYMENT\x10\x10\x12+\n\'SOURCE_OF_INCOME_AND_WEALTH_INHERITANCE\x10\x11\x12<\n8SOURCE_OF_INCOME_AND_WEALTH_LOTTERY_WINNINGS_OR_GAMBLING\x10\x12\x12-\n)SOURCE_OF_INCOME_AND_WEALTH_SALE_OF_ASSET\x10\x13\x12.\n*SOURCE_OF_INCOME_AND_WEALTH_SALE_OF_SHARES\x10\x14\x12>\n:SOURCE_OF_INCOME_AND_WEALTH_SAVINGS_INVESTMENT_OR_DIVIDEND\x10\x15\x12\x33\n/SOURCE_OF_INCOME_AND_WEALTH_TRUST_DISTRIBUTIONS\x10\x16\x42\x63\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1b\x06proto3')
28
28
 
29
29
  _globals = globals()
30
30
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
31
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.compliance.client.v1.source_of_income_and_wealth_pb2', _globals)
32
32
  if not _descriptor._USE_C_DESCRIPTORS:
33
33
  _globals['DESCRIPTOR']._loaded_options = None
34
- _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.compliance.client.v1Z9github.com/meshtrade/api/go/compliance/client/v1;clientv1'
34
+ _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1'
35
35
  _globals['_SOURCEOFINCOMEANDWEALTH']._serialized_start=101
36
36
  _globals['_SOURCEOFINCOMEANDWEALTH']._serialized_end=1278
37
37
  # @@protoc_insertion_point(module_scope)
@@ -22,16 +22,21 @@ _runtime_version.ValidateProtobufRuntimeVersion(
22
22
  _sym_db = _symbol_database.Default()
23
23
 
24
24
 
25
+ from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2
25
26
 
26
27
 
27
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2meshtrade/compliance/client/v1/tax_residency.proto\x12\x1emeshtrade.compliance.client.v1\"C\n\x0cTaxResidency\x12!\n\x0c\x63ountry_code\x18\x01 \x01(\tR\x0b\x63ountryCode\x12\x10\n\x03tin\x18\x02 \x01(\tR\x03tinBb\n%co.meshtrade.api.compliance.client.v1Z9github.com/meshtrade/api/go/compliance/client/v1;clientv1b\x06proto3')
28
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2meshtrade/compliance/client/v1/tax_residency.proto\x12\x1emeshtrade.compliance.client.v1\x1a\x1b\x62uf/validate/validate.proto\"\xec\x01\n\x0cTaxResidency\x12\xc0\x01\n\x0c\x63ountry_code\x18\x01 \x01(\tB\x9c\x01\xbaH\x98\x01\xba\x01\x94\x01\n\x1c\x63ountry_code.format.optional\x12\x45\x63ountry_code must be empty or a valid ISO 3166-1 alpha-2 country code\x1a-size(this) == 0 || this.matches(\'^[A-Z]{2}$\')R\x0b\x63ountryCode\x12\x19\n\x03tin\x18\x02 \x01(\tB\x07\xbaH\x04r\x02\x18\x64R\x03tinBc\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1b\x06proto3')
28
29
 
29
30
  _globals = globals()
30
31
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
32
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.compliance.client.v1.tax_residency_pb2', _globals)
32
33
  if not _descriptor._USE_C_DESCRIPTORS:
33
34
  _globals['DESCRIPTOR']._loaded_options = None
34
- _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.compliance.client.v1Z9github.com/meshtrade/api/go/compliance/client/v1;clientv1'
35
- _globals['_TAXRESIDENCY']._serialized_start=86
36
- _globals['_TAXRESIDENCY']._serialized_end=153
35
+ _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1'
36
+ _globals['_TAXRESIDENCY'].fields_by_name['country_code']._loaded_options = None
37
+ _globals['_TAXRESIDENCY'].fields_by_name['country_code']._serialized_options = b'\272H\230\001\272\001\224\001\n\034country_code.format.optional\022Ecountry_code must be empty or a valid ISO 3166-1 alpha-2 country code\032-size(this) == 0 || this.matches(\'^[A-Z]{2}$\')'
38
+ _globals['_TAXRESIDENCY'].fields_by_name['tin']._loaded_options = None
39
+ _globals['_TAXRESIDENCY'].fields_by_name['tin']._serialized_options = b'\272H\004r\002\030d'
40
+ _globals['_TAXRESIDENCY']._serialized_start=116
41
+ _globals['_TAXRESIDENCY']._serialized_end=352
37
42
  # @@protoc_insertion_point(module_scope)
@@ -1,3 +1,4 @@
1
+ from buf.validate import validate_pb2 as _validate_pb2
1
2
  from google.protobuf import descriptor as _descriptor
2
3
  from google.protobuf import message as _message
3
4
  from typing import ClassVar as _ClassVar, Optional as _Optional
@@ -22,17 +22,26 @@ _runtime_version.ValidateProtobufRuntimeVersion(
22
22
  _sym_db = _symbol_database.Default()
23
23
 
24
24
 
25
+ from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2
25
26
  from google.type import date_pb2 as google_dot_type_dot_date__pb2
26
27
 
27
28
 
28
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*meshtrade/compliance/client/v1/trust.proto\x12\x1emeshtrade.compliance.client.v1\x1a\x16google/type/date.proto\"\xf7\x01\n\x05Trust\x12\'\n\x0fregistered_name\x18\x01 \x01(\tR\x0eregisteredName\x12/\n\x13registration_number\x18\x02 \x01(\tR\x12registrationNumber\x12%\n\x0etax_identifier\x18\x03 \x01(\tR\rtaxIdentifier\x12.\n\x13\x63ountry_of_domicile\x18\x04 \x01(\tR\x11\x63ountryOfDomicile\x12=\n\x11\x64\x61te_of_inception\x18\x05 \x01(\x0b\x32\x11.google.type.DateR\x0f\x64\x61teOfInceptionBb\n%co.meshtrade.api.compliance.client.v1Z9github.com/meshtrade/api/go/compliance/client/v1;clientv1b\x06proto3')
29
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*meshtrade/compliance/client/v1/trust.proto\x12\x1emeshtrade.compliance.client.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\x16google/type/date.proto\"\xba\x03\n\x05Trust\x12\x31\n\x0fregistered_name\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\x0eregisteredName\x12\x38\n\x13registration_number\x18\x02 \x01(\tB\x07\xbaH\x04r\x02\x18\x64R\x12registrationNumber\x12.\n\x0etax_identifier\x18\x03 \x01(\tB\x07\xbaH\x04r\x02\x18\x32R\rtaxIdentifier\x12\xd4\x01\n\x13\x63ountry_of_domicile\x18\x04 \x01(\tB\xa3\x01\xbaH\x9f\x01\xba\x01\x9b\x01\n\x1c\x63ountry_code.format.optional\x12Lcountry_of_domicile must be empty or a valid ISO 3166-1 alpha-2 country code\x1a-size(this) == 0 || this.matches(\'^[A-Z]{2}$\')R\x11\x63ountryOfDomicile\x12=\n\x11\x64\x61te_of_inception\x18\x05 \x01(\x0b\x32\x11.google.type.DateR\x0f\x64\x61teOfInceptionBc\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1b\x06proto3')
29
30
 
30
31
  _globals = globals()
31
32
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
32
33
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.compliance.client.v1.trust_pb2', _globals)
33
34
  if not _descriptor._USE_C_DESCRIPTORS:
34
35
  _globals['DESCRIPTOR']._loaded_options = None
35
- _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.compliance.client.v1Z9github.com/meshtrade/api/go/compliance/client/v1;clientv1'
36
- _globals['_TRUST']._serialized_start=103
37
- _globals['_TRUST']._serialized_end=350
36
+ _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1'
37
+ _globals['_TRUST'].fields_by_name['registered_name']._loaded_options = None
38
+ _globals['_TRUST'].fields_by_name['registered_name']._serialized_options = b'\272H\005r\003\030\377\001'
39
+ _globals['_TRUST'].fields_by_name['registration_number']._loaded_options = None
40
+ _globals['_TRUST'].fields_by_name['registration_number']._serialized_options = b'\272H\004r\002\030d'
41
+ _globals['_TRUST'].fields_by_name['tax_identifier']._loaded_options = None
42
+ _globals['_TRUST'].fields_by_name['tax_identifier']._serialized_options = b'\272H\004r\002\0302'
43
+ _globals['_TRUST'].fields_by_name['country_of_domicile']._loaded_options = None
44
+ _globals['_TRUST'].fields_by_name['country_of_domicile']._serialized_options = b'\272H\237\001\272\001\233\001\n\034country_code.format.optional\022Lcountry_of_domicile must be empty or a valid ISO 3166-1 alpha-2 country code\032-size(this) == 0 || this.matches(\'^[A-Z]{2}$\')'
45
+ _globals['_TRUST']._serialized_start=132
46
+ _globals['_TRUST']._serialized_end=574
38
47
  # @@protoc_insertion_point(module_scope)
@@ -1,3 +1,4 @@
1
+ from buf.validate import validate_pb2 as _validate_pb2
1
2
  from google.type import date_pb2 as _date_pb2
2
3
  from google.protobuf import descriptor as _descriptor
3
4
  from google.protobuf import message as _message
@@ -24,14 +24,14 @@ _sym_db = _symbol_database.Default()
24
24
 
25
25
 
26
26
 
27
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8meshtrade/compliance/client/v1/verification_status.proto\x12\x1emeshtrade.compliance.client.v1*\xc1\x01\n\x12VerificationStatus\x12#\n\x1fVERIFICATION_STATUS_UNSPECIFIED\x10\x00\x12#\n\x1fVERIFICATION_STATUS_NOT_STARTED\x10\x01\x12\x1f\n\x1bVERIFICATION_STATUS_PENDING\x10\x02\x12 \n\x1cVERIFICATION_STATUS_VERIFIED\x10\x03\x12\x1e\n\x1aVERIFICATION_STATUS_FAILED\x10\x04\x42\x62\n%co.meshtrade.api.compliance.client.v1Z9github.com/meshtrade/api/go/compliance/client/v1;clientv1b\x06proto3')
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8meshtrade/compliance/client/v1/verification_status.proto\x12\x1emeshtrade.compliance.client.v1*\xc1\x01\n\x12VerificationStatus\x12#\n\x1fVERIFICATION_STATUS_UNSPECIFIED\x10\x00\x12#\n\x1fVERIFICATION_STATUS_NOT_STARTED\x10\x01\x12\x1f\n\x1bVERIFICATION_STATUS_PENDING\x10\x02\x12 \n\x1cVERIFICATION_STATUS_VERIFIED\x10\x03\x12\x1e\n\x1aVERIFICATION_STATUS_FAILED\x10\x04\x42\x63\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1b\x06proto3')
28
28
 
29
29
  _globals = globals()
30
30
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
31
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.compliance.client.v1.verification_status_pb2', _globals)
32
32
  if not _descriptor._USE_C_DESCRIPTORS:
33
33
  _globals['DESCRIPTOR']._loaded_options = None
34
- _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.compliance.client.v1Z9github.com/meshtrade/api/go/compliance/client/v1;clientv1'
34
+ _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.compliance.client.v1Z:github.com/meshtrade/api/go/compliance/client/v1;client_v1'
35
35
  _globals['_VERIFICATIONSTATUS']._serialized_start=93
36
36
  _globals['_VERIFICATIONSTATUS']._serialized_end=286
37
37
  # @@protoc_insertion_point(module_scope)
@@ -16,24 +16,25 @@
16
16
  from .api_credentials_pb2 import APICredentials
17
17
  from .api_user_pb2 import APIUser, APIUserAction, APIUserState
18
18
  from .service_pb2 import (
19
- ActivateApiUserRequest,
20
- CreateApiUserRequest,
21
- DeactivateApiUserRequest,
22
- GetApiUserByKeyHashRequest,
23
- GetApiUserRequest,
24
- ListApiUsersRequest,
25
- ListApiUsersResponse,
26
- SearchApiUsersRequest,
27
- SearchApiUsersResponse,
19
+ ActivateAPIUserRequest,
20
+ AssignRolesToAPIUserRequest,
21
+ CreateAPIUserRequest,
22
+ DeactivateAPIUserRequest,
23
+ GetAPIUserByKeyHashRequest,
24
+ GetAPIUserRequest,
25
+ ListAPIUsersRequest,
26
+ ListAPIUsersResponse,
27
+ RevokeRolesFromAPIUserRequest,
28
+ SearchAPIUsersRequest,
29
+ SearchAPIUsersResponse,
28
30
  )
29
31
 
30
32
  # Generated service imports
31
33
  from .service_meshpy import (
32
- ApiUserService,
33
- ApiUserServiceGRPCClient,
34
- ApiUserServiceGRPCClientInterface,
34
+ APIUserService,
35
+ APIUserServiceGRPCClient,
36
+ APIUserServiceGRPCClientInterface,
35
37
  )
36
- from .service_options_meshpy import ClientOptions
37
38
 
38
39
  # ===================================================================
39
40
  # END OF AUTO-GENERATED SECTION
@@ -61,7 +62,10 @@ from meshtrade.common import (
61
62
  from .api_credentials import (
62
63
  MESH_API_CREDENTIALS_ENV_VAR,
63
64
  api_credentials_from_environment,
65
+ default_credentials_path,
66
+ find_credentials,
64
67
  load_api_credentials_from_file,
68
+ load_default_credentials,
65
69
  )
66
70
 
67
71
  # ===================================================================
@@ -73,20 +77,21 @@ __all__ = [
73
77
  "APICredentials",
74
78
  "APIUser",
75
79
  "APIUserAction",
80
+ "APIUserService",
81
+ "APIUserServiceGRPCClient",
82
+ "APIUserServiceGRPCClientInterface",
76
83
  "APIUserState",
77
- "ActivateApiUserRequest",
78
- "ApiUserService",
79
- "ApiUserServiceGRPCClient",
80
- "ApiUserServiceGRPCClientInterface",
81
- "ClientOptions",
82
- "CreateApiUserRequest",
83
- "DeactivateApiUserRequest",
84
- "GetApiUserByKeyHashRequest",
85
- "GetApiUserRequest",
86
- "ListApiUsersRequest",
87
- "ListApiUsersResponse",
88
- "SearchApiUsersRequest",
89
- "SearchApiUsersResponse",
84
+ "ActivateAPIUserRequest",
85
+ "AssignRolesToAPIUserRequest",
86
+ "CreateAPIUserRequest",
87
+ "DeactivateAPIUserRequest",
88
+ "GetAPIUserByKeyHashRequest",
89
+ "GetAPIUserRequest",
90
+ "ListAPIUsersRequest",
91
+ "ListAPIUsersResponse",
92
+ "RevokeRolesFromAPIUserRequest",
93
+ "SearchAPIUsersRequest",
94
+ "SearchAPIUsersResponse",
90
95
  # Manual exports
91
96
  "DEFAULT_GRPC_PORT",
92
97
  "DEFAULT_GRPC_URL",
@@ -95,5 +100,8 @@ __all__ = [
95
100
  "MESH_API_CREDENTIALS_ENV_VAR",
96
101
  "api_credentials_from_environment",
97
102
  "create_auth_metadata",
103
+ "default_credentials_path",
104
+ "find_credentials",
98
105
  "load_api_credentials_from_file",
106
+ "load_default_credentials",
99
107
  ]
@@ -25,18 +25,18 @@ _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_credentials.proto\x12\x19meshtrade.iam.api_user.v1\x1a\x1b\x62uf/validate/validate.proto\"\x81\x05\n\x0e\x41PICredentials\x12\xbd\x02\n\x07\x61pi_key\x18\x01 \x01(\tB\xa3\x02\xbaH\x9f\x02r\x18\x32\x13^[A-Za-z0-9_-]{43}$\x98\x01+\xba\x01u\n\x10\x61pi_key.required\x12Oapi_key is required and must be exactly 43 characters (base64 URL-safe encoded)\x1a\x10size(this) == 43\xba\x01\x89\x01\n\x0e\x61pi_key.format\x12Rapi_key must be base64 URL-safe encoded (43 characters, alphanumeric plus _ and -)\x1a#this.matches(\'^[A-Za-z0-9_-]{43}$\')R\x06\x61piKey\x12\xae\x02\n\x05group\x18\x02 \x01(\tB\x97\x02\xbaH\x93\x02r\x1a\x32\x15^groups/[0-9A-Z]{26}$\x98\x01!\xba\x01Y\n\x0egroup.required\x12\x35group is required and must be in format groups/{ulid}\x1a\x10size(this) == 33\xba\x01\x97\x01\n\x0cgroup.format\x12`group must be in format groups/{ulid} where ulid is a 26-character ULID (uppercase alphanumeric)\x1a%this.matches(\'^groups/[0-9A-Z]{26}$\')R\x05groupBZ\n co.meshtrade.api.iam.api_user.v1Z6github.com/meshtrade/api/go/iam/api_user/v1;api_userv1b\x06proto3')
28
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/meshtrade/iam/api_user/v1/api_credentials.proto\x12\x19meshtrade.iam.api_user.v1\x1a\x1b\x62uf/validate/validate.proto\"\xb0\x03\n\x0e\x41PICredentials\x12\x39\n\x07\x61pi_key\x18\x01 \x01(\tB \xbaH\x1dr\x18\x32\x13^[A-Za-z0-9_-]{43}$\x98\x01+\xc8\x01\x01R\x06\x61piKey\x12\xe2\x02\n\x05group\x18\x02 \x01(\tB\xcb\x02\xbaH\xc7\x02r42/^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01!\xba\x01Y\n\x0egroup.required\x12\x35group is required and must be in format groups/{ulid}\x1a\x10size(this) == 33\xba\x01\xb1\x01\n\x0cgroup.format\x12`group must be in format groups/{ulid} where ulid is a 26-character ULID (uppercase alphanumeric)\x1a?this.matches(\'^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')R\x05groupB[\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)
32
32
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.iam.api_user.v1.api_credentials_pb2', _globals)
33
33
  if not _descriptor._USE_C_DESCRIPTORS:
34
34
  _globals['DESCRIPTOR']._loaded_options = None
35
- _globals['DESCRIPTOR']._serialized_options = b'\n co.meshtrade.api.iam.api_user.v1Z6github.com/meshtrade/api/go/iam/api_user/v1;api_userv1'
35
+ _globals['DESCRIPTOR']._serialized_options = b'\n co.meshtrade.api.iam.api_user.v1Z7github.com/meshtrade/api/go/iam/api_user/v1;api_user_v1'
36
36
  _globals['_APICREDENTIALS'].fields_by_name['api_key']._loaded_options = None
37
- _globals['_APICREDENTIALS'].fields_by_name['api_key']._serialized_options = b'\272H\237\002r\0302\023^[A-Za-z0-9_-]{43}$\230\001+\272\001u\n\020api_key.required\022Oapi_key is required and must be exactly 43 characters (base64 URL-safe encoded)\032\020size(this) == 43\272\001\211\001\n\016api_key.format\022Rapi_key must be base64 URL-safe encoded (43 characters, alphanumeric plus _ and -)\032#this.matches(\'^[A-Za-z0-9_-]{43}$\')'
37
+ _globals['_APICREDENTIALS'].fields_by_name['api_key']._serialized_options = b'\272H\035r\0302\023^[A-Za-z0-9_-]{43}$\230\001+\310\001\001'
38
38
  _globals['_APICREDENTIALS'].fields_by_name['group']._loaded_options = None
39
- _globals['_APICREDENTIALS'].fields_by_name['group']._serialized_options = b'\272H\223\002r\0322\025^groups/[0-9A-Z]{26}$\230\001!\272\001Y\n\016group.required\0225group is required and must be in format groups/{ulid}\032\020size(this) == 33\272\001\227\001\n\014group.format\022`group must be in format groups/{ulid} where ulid is a 26-character ULID (uppercase alphanumeric)\032%this.matches(\'^groups/[0-9A-Z]{26}$\')'
39
+ _globals['_APICREDENTIALS'].fields_by_name['group']._serialized_options = b'\272H\307\002r42/^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001!\272\001Y\n\016group.required\0225group is required and must be in format groups/{ulid}\032\020size(this) == 33\272\001\261\001\n\014group.format\022`group must be in format groups/{ulid} where ulid is a 26-character ULID (uppercase alphanumeric)\032?this.matches(\'^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')'
40
40
  _globals['_APICREDENTIALS']._serialized_start=108
41
- _globals['_APICREDENTIALS']._serialized_end=749
41
+ _globals['_APICREDENTIALS']._serialized_end=540
42
42
  # @@protoc_insertion_point(module_scope)
@@ -25,24 +25,28 @@ _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\"\xd9\x06\n\x07\x41PIUser\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\xfd\x02\n\x05owner\x18\x02 \x01(\tB\xe6\x02\xbaH\xe2\x02r4\x10\x01\x32\x30^groups/[a-zA-Z0-9]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$\xba\x01[\n\x0eowner.required\x12\x39owner is required and must be in format groups/{group_id}\x1a\x0esize(this) > 0\xba\x01\xca\x01\n\x0cowner.format\x12xowner must be in format groups/{group_id} where group_id contains only alphanumeric characters, underscores, and hyphens\x1a@this.matches(\'^groups/[a-zA-Z0-9]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$\')R\x05owner\x12\x16\n\x06owners\x18\x03 \x03(\tR\x06owners\x12\xb1\x01\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x8d\x01\xbaH\x89\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) <= 255R\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\x14\n\x05roles\x18\x06 \x03(\tR\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\x42Z\n co.meshtrade.api.iam.api_user.v1Z6github.com/meshtrade/api/go/iam/api_user/v1;api_userv1b\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)
32
32
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.iam.api_user.v1.api_user_pb2', _globals)
33
33
  if not _descriptor._USE_C_DESCRIPTORS:
34
34
  _globals['DESCRIPTOR']._loaded_options = None
35
- _globals['DESCRIPTOR']._serialized_options = b'\n co.meshtrade.api.iam.api_user.v1Z6github.com/meshtrade/api/go/iam/api_user/v1;api_userv1'
35
+ _globals['DESCRIPTOR']._serialized_options = b'\n co.meshtrade.api.iam.api_user.v1Z7github.com/meshtrade/api/go/iam/api_user/v1;api_user_v1'
36
+ _globals['_APIUSER'].fields_by_name['name']._loaded_options = None
37
+ _globals['_APIUSER'].fields_by_name['name']._serialized_options = b'\272H\251\001\272\001\245\001\n\024name.format.optional\0226name must be empty or in the format api_users/{ULIDv2}\032Usize(this) == 0 || this.matches(\'^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')'
36
38
  _globals['_APIUSER'].fields_by_name['owner']._loaded_options = None
37
- _globals['_APIUSER'].fields_by_name['owner']._serialized_options = b'\272H\342\002r4\020\00120^groups/[a-zA-Z0-9]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$\272\001[\n\016owner.required\0229owner is required and must be in format groups/{group_id}\032\016size(this) > 0\272\001\312\001\n\014owner.format\022xowner must be in format groups/{group_id} where group_id contains only alphanumeric characters, underscores, and hyphens\032@this.matches(\'^groups/[a-zA-Z0-9]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$\')'
39
+ _globals['_APIUSER'].fields_by_name['owner']._serialized_options = b'\272H9r42/^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001!\310\001\001'
38
40
  _globals['_APIUSER'].fields_by_name['display_name']._loaded_options = None
39
- _globals['_APIUSER'].fields_by_name['display_name']._serialized_options = b'\272H\211\001r\005\020\001\030\377\001\272\001\177\n\025display_name.required\022Adisplay name is required and must be between 1 and 255 characters\032#size(this) > 0 && size(this) <= 255'
41
+ _globals['_APIUSER'].fields_by_name['display_name']._serialized_options = b'\272H\214\001r\005\020\001\030\377\001\272\001\177\n\025display_name.required\022Adisplay name is required and must be between 1 and 255 characters\032#size(this) > 0 && size(this) <= 255\310\001\001'
40
42
  _globals['_APIUSER'].fields_by_name['state']._loaded_options = None
41
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)'
42
- _globals['_APIUSERSTATE']._serialized_start=960
43
- _globals['_APIUSERSTATE']._serialized_end=1062
44
- _globals['_APIUSERACTION']._serialized_start=1065
45
- _globals['_APIUSERACTION']._serialized_end=1231
44
+ _globals['_APIUSER'].fields_by_name['roles']._loaded_options = None
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
46
50
  _globals['_APIUSER']._serialized_start=101
47
- _globals['_APIUSER']._serialized_end=958
51
+ _globals['_APIUSER']._serialized_end=901
48
52
  # @@protoc_insertion_point(module_scope)
@@ -31,19 +31,17 @@ API_USER_ACTION_CREATE: APIUserAction
31
31
  API_USER_ACTION_UPDATE: APIUserAction
32
32
 
33
33
  class APIUser(_message.Message):
34
- __slots__ = ("name", "owner", "owners", "display_name", "state", "roles", "api_key")
34
+ __slots__ = ("name", "owner", "display_name", "state", "roles", "api_key")
35
35
  NAME_FIELD_NUMBER: _ClassVar[int]
36
36
  OWNER_FIELD_NUMBER: _ClassVar[int]
37
- OWNERS_FIELD_NUMBER: _ClassVar[int]
38
37
  DISPLAY_NAME_FIELD_NUMBER: _ClassVar[int]
39
38
  STATE_FIELD_NUMBER: _ClassVar[int]
40
39
  ROLES_FIELD_NUMBER: _ClassVar[int]
41
40
  API_KEY_FIELD_NUMBER: _ClassVar[int]
42
41
  name: str
43
42
  owner: str
44
- owners: _containers.RepeatedScalarFieldContainer[str]
45
43
  display_name: str
46
44
  state: APIUserState
47
45
  roles: _containers.RepeatedScalarFieldContainer[str]
48
46
  api_key: str
49
- def __init__(self, name: _Optional[str] = ..., owner: _Optional[str] = ..., owners: _Optional[_Iterable[str]] = ..., display_name: _Optional[str] = ..., state: _Optional[_Union[APIUserState, str]] = ..., roles: _Optional[_Iterable[str]] = ..., api_key: _Optional[str] = ...) -> None: ...
47
+ def __init__(self, name: _Optional[str] = ..., owner: _Optional[str] = ..., display_name: _Optional[str] = ..., state: _Optional[_Union[APIUserState, str]] = ..., roles: _Optional[_Iterable[str]] = ..., api_key: _Optional[str] = ...) -> None: ...
@@ -0,0 +1,104 @@
1
+ """API User state machine validation and transition logic.
2
+
3
+ This module provides validation and state machine functions for API User states
4
+ and actions, implementing the API User lifecycle management logic.
5
+ """
6
+
7
+ from meshtrade.iam.api_user.v1.api_user_pb2 import APIUserAction, APIUserState
8
+
9
+
10
+ def api_user_state_is_valid(state: APIUserState | None) -> bool:
11
+ """Check if the APIUserState is a valid enum value.
12
+
13
+ Args:
14
+ state: The APIUserState to validate (can be None)
15
+
16
+ Returns:
17
+ True if the state is a valid enum value, False otherwise
18
+
19
+ None Safety:
20
+ Returns False if state is None
21
+
22
+ Example:
23
+ >>> api_user_state_is_valid(APIUserState.API_USER_STATE_ACTIVE)
24
+ True
25
+ >>> api_user_state_is_valid(999) # Invalid enum value
26
+ False
27
+ >>> api_user_state_is_valid(None)
28
+ False
29
+ """
30
+ if state is None:
31
+ return False
32
+ return state in APIUserState.values()
33
+
34
+
35
+ def api_user_state_is_valid_and_defined(state: APIUserState) -> bool:
36
+ """Check if the APIUserState is valid and not unspecified.
37
+
38
+ Args:
39
+ state: The APIUserState to validate
40
+
41
+ Returns:
42
+ True if the state is valid and not UNSPECIFIED, False otherwise
43
+
44
+ Example:
45
+ >>> api_user_state_is_valid_and_defined(APIUserState.API_USER_STATE_ACTIVE)
46
+ True
47
+ >>> api_user_state_is_valid_and_defined(APIUserState.API_USER_STATE_UNSPECIFIED)
48
+ False
49
+ """
50
+ return api_user_state_is_valid(state) and state != APIUserState.API_USER_STATE_UNSPECIFIED
51
+
52
+
53
+ def api_user_state_can_perform_action_at_state(state: APIUserState | None, action: APIUserAction | None) -> bool:
54
+ """Check if the given action can be performed at the current state.
55
+
56
+ This implements the state machine logic for API User lifecycle management.
57
+
58
+ State Transitions:
59
+ - INACTIVE -> ACTIVATE -> ACTIVE
60
+ - ACTIVE -> DEACTIVATE -> INACTIVE
61
+ - UPDATE action allowed in any state
62
+
63
+ Args:
64
+ state: The current APIUserState (can be None)
65
+ action: The APIUserAction to perform (can be None)
66
+
67
+ Returns:
68
+ True if the action can be performed at the given state, False otherwise
69
+
70
+ None Safety:
71
+ Returns False if either state or action is None
72
+
73
+ Example:
74
+ >>> can_perform_action_at_state(
75
+ ... APIUserState.API_USER_STATE_INACTIVE,
76
+ ... APIUserAction.API_USER_ACTION_ACTIVATE
77
+ ... )
78
+ True
79
+ >>> can_perform_action_at_state(
80
+ ... APIUserState.API_USER_STATE_INACTIVE,
81
+ ... APIUserAction.API_USER_ACTION_DEACTIVATE
82
+ ... )
83
+ False
84
+ """
85
+ if state is None or action is None:
86
+ return False
87
+
88
+ # Define actions that are allowed regardless of state (update operations)
89
+ general_update_actions = {
90
+ APIUserAction.API_USER_ACTION_UPDATE: True,
91
+ }
92
+
93
+ if state == APIUserState.API_USER_STATE_INACTIVE:
94
+ if action == APIUserAction.API_USER_ACTION_ACTIVATE:
95
+ return True
96
+ return general_update_actions.get(action, False)
97
+
98
+ elif state == APIUserState.API_USER_STATE_ACTIVE:
99
+ if action == APIUserAction.API_USER_ACTION_DEACTIVATE:
100
+ return True
101
+ return general_update_actions.get(action, False)
102
+
103
+ else:
104
+ return False