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.
- meshtrade/common/__init__.py +2 -4
- meshtrade/common/config.py +3 -4
- meshtrade/common/grpc_client.py +140 -0
- meshtrade/common/service_options.py +46 -0
- meshtrade/compliance/client/v1/__init__.py +0 -2
- meshtrade/compliance/client/v1/client_pb2.py +15 -4
- meshtrade/compliance/client/v1/client_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/company_pb2.py +25 -8
- meshtrade/compliance/client/v1/company_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/company_representative_pb2.py +9 -4
- meshtrade/compliance/client/v1/company_representative_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/company_representative_role_pb2.py +2 -2
- meshtrade/compliance/client/v1/fund_pb2.py +13 -4
- meshtrade/compliance/client/v1/fund_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/identification_document_type_pb2.py +2 -2
- meshtrade/compliance/client/v1/industry_classification_pb2.py +2 -2
- meshtrade/compliance/client/v1/natural_person_connection_type_pb2.py +2 -2
- meshtrade/compliance/client/v1/natural_person_pb2.py +19 -4
- meshtrade/compliance/client/v1/natural_person_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/pep_status_pb2.py +2 -2
- meshtrade/compliance/client/v1/service_meshpy.py +2 -1
- meshtrade/compliance/client/v1/service_pb2.py +21 -17
- meshtrade/compliance/client/v1/service_pb2.pyi +2 -2
- meshtrade/compliance/client/v1/source_of_income_and_wealth_pb2.py +2 -2
- meshtrade/compliance/client/v1/tax_residency_pb2.py +9 -4
- meshtrade/compliance/client/v1/tax_residency_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/trust_pb2.py +13 -4
- meshtrade/compliance/client/v1/trust_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/verification_status_pb2.py +2 -2
- meshtrade/iam/api_user/v1/__init__.py +34 -26
- meshtrade/iam/api_user/v1/api_credentials_pb2.py +5 -5
- meshtrade/iam/api_user/v1/api_user_pb2.py +13 -9
- meshtrade/iam/api_user/v1/api_user_pb2.pyi +2 -4
- meshtrade/iam/api_user/v1/api_user_state_machine.py +104 -0
- meshtrade/iam/api_user/v1/service_meshpy.py +96 -61
- meshtrade/iam/api_user/v1/service_pb2.py +61 -40
- meshtrade/iam/api_user/v1/service_pb2.pyi +26 -11
- meshtrade/iam/api_user/v1/service_pb2_grpc.py +179 -135
- meshtrade/iam/group/v1/__init__.py +4 -2
- meshtrade/iam/group/v1/group_pb2.py +13 -4
- meshtrade/iam/group/v1/group_pb2.pyi +9 -2
- meshtrade/iam/group/v1/service_meshpy.py +41 -6
- meshtrade/iam/group/v1/service_pb2.py +47 -20
- meshtrade/iam/group/v1/service_pb2.pyi +46 -13
- meshtrade/iam/group/v1/service_pb2_grpc.py +151 -16
- meshtrade/iam/role/v1/__init__.py +17 -4
- meshtrade/iam/role/v1/role.py +162 -11
- meshtrade/iam/role/v1/role_pb2.py +4 -7
- meshtrade/iam/role/v1/role_pb2.pyi +53 -23
- meshtrade/iam/user/v1/__init__.py +22 -4
- meshtrade/iam/user/v1/service_meshpy.py +129 -7
- meshtrade/iam/user/v1/service_pb2.py +66 -16
- meshtrade/iam/user/v1/service_pb2.pyi +81 -9
- meshtrade/iam/user/v1/service_pb2_grpc.py +385 -14
- meshtrade/iam/user/v1/user_pb2.py +13 -4
- meshtrade/iam/user/v1/user_pb2.pyi +7 -2
- meshtrade/ledger/transaction/v1/__init__.py +25 -1
- meshtrade/ledger/transaction/v1/service_meshpy.py +176 -0
- meshtrade/ledger/transaction/v1/service_pb2.py +56 -0
- meshtrade/ledger/transaction/v1/service_pb2.pyi +32 -0
- meshtrade/ledger/transaction/v1/service_pb2_grpc.py +131 -0
- meshtrade/ledger/transaction/v1/transaction_action_pb2.py +2 -2
- meshtrade/ledger/transaction/v1/transaction_state_machine.py +75 -0
- meshtrade/ledger/transaction/v1/transaction_state_pb2.py +2 -2
- meshtrade/{reporting/income_report → market_data/price}/v1/__init__.py +11 -20
- meshtrade/market_data/price/v1/price_pb2.py +40 -0
- meshtrade/market_data/price/v1/price_pb2.pyi +23 -0
- meshtrade/market_data/price/v1/service_meshpy.py +152 -0
- meshtrade/market_data/price/v1/service_pb2.py +49 -0
- meshtrade/market_data/price/v1/service_pb2.pyi +18 -0
- meshtrade/market_data/price/v1/service_pb2_grpc.py +84 -0
- meshtrade/option/method_options/v1/__init__.py +41 -0
- meshtrade/option/method_options/v1/method_options_pb2.py +43 -0
- meshtrade/option/method_options/v1/method_options_pb2.pyi +40 -0
- meshtrade/reporting/account_report/v1/__init__.py +66 -0
- meshtrade/reporting/account_report/v1/account_report_pb2.py +46 -0
- meshtrade/reporting/account_report/v1/account_report_pb2.pyi +49 -0
- meshtrade/reporting/{income_report → account_report}/v1/disclaimer_pb2.py +7 -7
- meshtrade/reporting/account_report/v1/fee_entry_pb2.py +39 -0
- meshtrade/reporting/account_report/v1/fee_entry_pb2.pyi +26 -0
- meshtrade/reporting/account_report/v1/fee_entry_pb2_grpc.py +4 -0
- meshtrade/reporting/account_report/v1/income_entry.py +35 -0
- meshtrade/reporting/account_report/v1/income_entry_pb2.py +42 -0
- meshtrade/reporting/{income_report/v1/entry_pb2.pyi → account_report/v1/income_entry_pb2.pyi} +18 -10
- meshtrade/reporting/account_report/v1/income_entry_pb2_grpc.py +4 -0
- meshtrade/reporting/{income_report → account_report}/v1/service_meshpy.py +37 -36
- meshtrade/reporting/account_report/v1/service_pb2.py +72 -0
- meshtrade/reporting/account_report/v1/service_pb2.pyi +43 -0
- meshtrade/reporting/account_report/v1/service_pb2_grpc.py +161 -0
- meshtrade/reporting/account_report/v1/trading_statement_entry_pb2.py +39 -0
- meshtrade/reporting/account_report/v1/trading_statement_entry_pb2.pyi +30 -0
- meshtrade/reporting/account_report/v1/trading_statement_entry_pb2_grpc.py +4 -0
- meshtrade/studio/instrument/v1/__init__.py +43 -0
- meshtrade/studio/instrument/v1/instrument_pb2.py +45 -0
- meshtrade/studio/instrument/v1/instrument_pb2.pyi +20 -0
- meshtrade/studio/instrument/v1/instrument_pb2_grpc.py +4 -0
- meshtrade/studio/instrument/v1/instrument_type_pb2.py +37 -0
- meshtrade/studio/instrument/v1/instrument_type_pb2.pyi +64 -0
- meshtrade/studio/instrument/v1/instrument_type_pb2_grpc.py +4 -0
- meshtrade/studio/instrument/v1/unit_pb2.py +37 -0
- meshtrade/studio/instrument/v1/unit_pb2.pyi +46 -0
- meshtrade/studio/instrument/v1/unit_pb2_grpc.py +4 -0
- meshtrade/trading/limit_order/v1/__init__.py +22 -4
- meshtrade/trading/limit_order/v1/limit_order_pb2.py +24 -4
- meshtrade/trading/limit_order/v1/limit_order_pb2.pyi +55 -5
- meshtrade/trading/limit_order/v1/service_meshpy.py +113 -2
- meshtrade/trading/limit_order/v1/service_pb2.py +49 -9
- meshtrade/trading/limit_order/v1/service_pb2.pyi +67 -7
- meshtrade/trading/limit_order/v1/service_pb2_grpc.py +321 -4
- meshtrade/trading/market_order/v1/__init__.py +0 -2
- meshtrade/trading/market_order/v1/market_order_pb2.py +2 -2
- meshtrade/trading/market_order/v1/service_meshpy.py +3 -2
- meshtrade/trading/market_order/v1/service_pb2.py +8 -9
- meshtrade/trading/market_order/v1/service_pb2.pyi +1 -2
- meshtrade/type/v1/__init__.py +82 -12
- meshtrade/type/v1/address_pb2.py +2 -2
- meshtrade/type/v1/amount.py +429 -5
- meshtrade/type/v1/amount_pb2.py +2 -2
- meshtrade/type/v1/contact_details_pb2.py +2 -2
- meshtrade/type/v1/date_pb2.py +2 -2
- meshtrade/type/v1/decimal_built_in_conversions.py +8 -3
- meshtrade/type/v1/decimal_operations.py +354 -0
- meshtrade/type/v1/decimal_pb2.py +2 -2
- meshtrade/type/v1/ledger.py +76 -1
- meshtrade/type/v1/ledger_pb2.py +2 -2
- meshtrade/type/v1/sorting_pb2.py +2 -2
- meshtrade/type/v1/time_of_day_pb2.py +2 -2
- meshtrade/type/v1/token.py +144 -0
- meshtrade/type/v1/token_pb2.py +2 -2
- meshtrade/wallet/account/v1/__init__.py +21 -3
- meshtrade/wallet/account/v1/account_pb2.py +28 -4
- meshtrade/wallet/account/v1/account_pb2.pyi +57 -3
- meshtrade/wallet/account/v1/service_meshpy.py +72 -1
- meshtrade/wallet/account/v1/service_pb2.py +67 -23
- meshtrade/wallet/account/v1/service_pb2.pyi +81 -21
- meshtrade/wallet/account/v1/service_pb2_grpc.py +242 -8
- {meshtrade-1.0.1.dist-info → meshtrade-1.29.0.dist-info}/METADATA +1 -1
- meshtrade-1.29.0.dist-info/RECORD +217 -0
- meshtrade/compliance/client/v1/service_options_meshpy.py +0 -65
- meshtrade/iam/api_user/v1/service.py +0 -58
- meshtrade/iam/api_user/v1/service_options_meshpy.py +0 -65
- meshtrade/iam/group/v1/service_options_meshpy.py +0 -65
- meshtrade/iam/user/v1/service_options_meshpy.py +0 -65
- meshtrade/option/v1/method_type_pb2.py +0 -38
- meshtrade/option/v1/method_type_pb2.pyi +0 -17
- meshtrade/reporting/income_report/v1/entry_pb2.py +0 -42
- meshtrade/reporting/income_report/v1/income_report_pb2.py +0 -44
- meshtrade/reporting/income_report/v1/income_report_pb2.pyi +0 -42
- meshtrade/reporting/income_report/v1/service_options_meshpy.py +0 -65
- meshtrade/reporting/income_report/v1/service_pb2.py +0 -58
- meshtrade/reporting/income_report/v1/service_pb2.pyi +0 -37
- meshtrade/reporting/income_report/v1/service_pb2_grpc.py +0 -170
- meshtrade/trading/limit_order/v1/service_options_meshpy.py +0 -65
- meshtrade/trading/market_order/v1/service_options_meshpy.py +0 -65
- meshtrade/wallet/account/v1/service_options_meshpy.py +0 -65
- meshtrade-1.0.1.dist-info/RECORD +0 -191
- /meshtrade/{option/v1/method_type_pb2_grpc.py → market_data/price/v1/price_pb2_grpc.py} +0 -0
- /meshtrade/{reporting/income_report/v1/disclaimer_pb2_grpc.py → option/method_options/v1/method_options_pb2_grpc.py} +0 -0
- /meshtrade/reporting/{income_report/v1/entry_pb2_grpc.py → account_report/v1/account_report_pb2_grpc.py} +0 -0
- /meshtrade/reporting/{income_report → account_report}/v1/disclaimer_pb2.pyi +0 -0
- /meshtrade/reporting/{income_report/v1/income_report_pb2_grpc.py → account_report/v1/disclaimer_pb2_grpc.py} +0 -0
- {meshtrade-1.0.1.dist-info → meshtrade-1.29.0.dist-info}/WHEEL +0 -0
- {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\
|
|
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.
|
|
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 .
|
|
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.
|
|
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
|
|
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.
|
|
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'\
|
|
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'\
|
|
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'\
|
|
44
|
-
_globals['_GETCLIENTREQUEST']._serialized_start=
|
|
45
|
-
_globals['_GETCLIENTREQUEST']._serialized_end=
|
|
46
|
-
_globals['_CREATECLIENTREQUEST']._serialized_start=
|
|
47
|
-
_globals['_CREATECLIENTREQUEST']._serialized_end=
|
|
48
|
-
_globals['_LISTCLIENTSREQUEST']._serialized_start=
|
|
49
|
-
_globals['_LISTCLIENTSREQUEST']._serialized_end=
|
|
50
|
-
_globals['_LISTCLIENTSRESPONSE']._serialized_start=
|
|
51
|
-
_globals['_LISTCLIENTSRESPONSE']._serialized_end=
|
|
52
|
-
_globals['_CLIENTSERVICE']._serialized_start=
|
|
53
|
-
_globals['_CLIENTSERVICE']._serialized_end=
|
|
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.
|
|
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\
|
|
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.
|
|
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\"
|
|
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.
|
|
35
|
-
_globals['_TAXRESIDENCY'].
|
|
36
|
-
_globals['_TAXRESIDENCY'].
|
|
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)
|
|
@@ -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\"\
|
|
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.
|
|
36
|
-
_globals['_TRUST'].
|
|
37
|
-
_globals['_TRUST'].
|
|
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)
|
|
@@ -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\
|
|
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.
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
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\"\
|
|
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.
|
|
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\
|
|
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\
|
|
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=
|
|
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\"\
|
|
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.
|
|
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'\
|
|
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\
|
|
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['
|
|
43
|
-
_globals['
|
|
44
|
-
_globals['
|
|
45
|
-
_globals['
|
|
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=
|
|
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", "
|
|
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] = ...,
|
|
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
|