meshtrade 1.21.0__tar.gz → 1.23.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of meshtrade might be problematic. Click here for more details.
- {meshtrade-1.21.0 → meshtrade-1.23.0}/PKG-INFO +1 -1
- {meshtrade-1.21.0 → meshtrade-1.23.0}/pyproject.toml +1 -1
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/common/grpc_client.py +93 -0
- meshtrade-1.23.0/python/src/meshtrade/common/service_options.py +46 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/__init__.py +0 -2
- meshtrade-1.23.0/python/src/meshtrade/compliance/client/v1/client_roles.py +123 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/service_meshpy.py +1 -1
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/__init__.py +0 -2
- meshtrade-1.23.0/python/src/meshtrade/iam/api_user/v1/api_user_state_machine.py +104 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/service_meshpy.py +1 -1
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/group/v1/__init__.py +0 -2
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/group/v1/service_meshpy.py +1 -1
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/role/v1/__init__.py +2 -2
- meshtrade-1.23.0/python/src/meshtrade/iam/role/v1/role.py +174 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/user/v1/__init__.py +0 -2
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/user/v1/service_meshpy.py +1 -1
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/transaction/v1/__init__.py +0 -2
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/transaction/v1/service_meshpy.py +1 -1
- meshtrade-1.23.0/python/src/meshtrade/ledger/transaction/v1/transaction_state_machine.py +75 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/__init__.py +0 -2
- meshtrade-1.23.0/python/src/meshtrade/reporting/account_report/v1/income_entry.py +35 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/service_meshpy.py +1 -1
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/limit_order/v1/__init__.py +0 -2
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/limit_order/v1/service_meshpy.py +1 -1
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/market_order/v1/__init__.py +0 -2
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/market_order/v1/service_meshpy.py +1 -1
- meshtrade-1.23.0/python/src/meshtrade/type/v1/amount.py +502 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/decimal_built_in_conversions.py +8 -3
- meshtrade-1.23.0/python/src/meshtrade/type/v1/decimal_operations.py +354 -0
- meshtrade-1.23.0/python/src/meshtrade/type/v1/ledger.py +100 -0
- meshtrade-1.23.0/python/src/meshtrade/type/v1/token.py +144 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/wallet/account/v1/__init__.py +0 -2
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/wallet/account/v1/service_meshpy.py +1 -1
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade.egg-info/PKG-INFO +1 -1
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade.egg-info/SOURCES.txt +7 -9
- meshtrade-1.21.0/python/src/meshtrade/compliance/client/v1/service_options_meshpy.py +0 -65
- meshtrade-1.21.0/python/src/meshtrade/iam/api_user/v1/service_options_meshpy.py +0 -65
- meshtrade-1.21.0/python/src/meshtrade/iam/group/v1/service_options_meshpy.py +0 -65
- meshtrade-1.21.0/python/src/meshtrade/iam/role/v1/role.py +0 -23
- meshtrade-1.21.0/python/src/meshtrade/iam/user/v1/service_options_meshpy.py +0 -65
- meshtrade-1.21.0/python/src/meshtrade/ledger/transaction/v1/service_options_meshpy.py +0 -65
- meshtrade-1.21.0/python/src/meshtrade/reporting/account_report/v1/service_options_meshpy.py +0 -65
- meshtrade-1.21.0/python/src/meshtrade/trading/limit_order/v1/service_options_meshpy.py +0 -65
- meshtrade-1.21.0/python/src/meshtrade/trading/market_order/v1/service_options_meshpy.py +0 -65
- meshtrade-1.21.0/python/src/meshtrade/type/v1/amount.py +0 -78
- meshtrade-1.21.0/python/src/meshtrade/type/v1/ledger.py +0 -25
- meshtrade-1.21.0/python/src/meshtrade/wallet/account/v1/service_options_meshpy.py +0 -65
- {meshtrade-1.21.0 → meshtrade-1.23.0}/README.md +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/buf/validate/validate_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/buf/validate/validate_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/common/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/common/config.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/client_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/client_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/client_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/company_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/company_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/company_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/company_representative_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/company_representative_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/company_representative_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/company_representative_role_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/company_representative_role_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/company_representative_role_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/fund_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/fund_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/fund_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/identification_document_type_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/identification_document_type_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/identification_document_type_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/industry_classification_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/industry_classification_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/industry_classification_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/natural_person_connection_type_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/natural_person_connection_type_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/natural_person_connection_type_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/natural_person_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/natural_person_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/natural_person_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/pep_status_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/pep_status_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/pep_status_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/service_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/service_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/service_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/source_of_income_and_wealth_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/source_of_income_and_wealth_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/source_of_income_and_wealth_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/tax_residency_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/tax_residency_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/tax_residency_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/trust_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/trust_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/trust_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/verification_status_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/verification_status_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/verification_status_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/api_credentials.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/api_credentials_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/api_credentials_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/api_credentials_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/api_user_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/api_user_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/api_user_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/service.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/service_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/service_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/service_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/group/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/group/v1/group_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/group/v1/group_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/group/v1/group_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/group/v1/service_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/group/v1/service_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/group/v1/service_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/role/v1/role_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/role/v1/role_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/role/v1/role_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/user/v1/service_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/user/v1/service_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/user/v1/service_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/user/v1/user_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/user/v1/user_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/user/v1/user_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/transaction/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/transaction/v1/service_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/transaction/v1/service_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/transaction/v1/service_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/transaction/v1/transaction_action_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/transaction/v1/transaction_action_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/transaction/v1/transaction_action_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/transaction/v1/transaction_state_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/transaction/v1/transaction_state_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/ledger/transaction/v1/transaction_state_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/option/v1/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/option/v1/method_type_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/option/v1/method_type_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/option/v1/method_type_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/account_report_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/account_report_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/account_report_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/disclaimer_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/disclaimer_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/disclaimer_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/fee_entry_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/fee_entry_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/fee_entry_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/income_entry_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/income_entry_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/income_entry_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/service_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/service_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/service_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/trading_statement_entry_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/trading_statement_entry_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/reporting/account_report/v1/trading_statement_entry_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/studio/instrument/v1/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/studio/instrument/v1/instrument_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/studio/instrument/v1/instrument_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/studio/instrument/v1/instrument_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/studio/instrument/v1/instrument_type_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/studio/instrument/v1/instrument_type_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/studio/instrument/v1/instrument_type_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/studio/instrument/v1/unit_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/studio/instrument/v1/unit_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/studio/instrument/v1/unit_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/limit_order/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/limit_order/v1/limit_order_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/limit_order/v1/limit_order_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/limit_order/v1/limit_order_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/limit_order/v1/service_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/limit_order/v1/service_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/limit_order/v1/service_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/market_order/v1/market_order_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/market_order/v1/market_order_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/market_order/v1/market_order_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/market_order/v1/service_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/market_order/v1/service_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/trading/market_order/v1/service_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/address_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/address_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/address_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/amount_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/amount_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/amount_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/contact_details_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/contact_details_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/contact_details_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/date.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/date_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/date_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/date_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/decimal_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/decimal_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/decimal_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/ledger_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/ledger_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/ledger_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/sorting_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/sorting_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/sorting_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/time_of_day.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/time_of_day_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/time_of_day_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/time_of_day_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/token_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/token_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/type/v1/token_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/wallet/__init__.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/wallet/account/v1/account_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/wallet/account/v1/account_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/wallet/account/v1/account_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/wallet/account/v1/service_pb2.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/wallet/account/v1/service_pb2.pyi +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/wallet/account/v1/service_pb2_grpc.py +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade.egg-info/dependency_links.txt +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade.egg-info/requires.txt +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade.egg-info/top_level.txt +0 -0
- {meshtrade-1.21.0 → meshtrade-1.23.0}/setup.cfg +0 -0
|
@@ -146,6 +146,99 @@ class BaseGRPCClient(GRPCClient):
|
|
|
146
146
|
raise ValueError("Group not configured. Provide via constructor or set MESH_API_CREDENTIALS environment variable.")
|
|
147
147
|
return self._group
|
|
148
148
|
|
|
149
|
+
@property
|
|
150
|
+
def url(self) -> str:
|
|
151
|
+
"""Get the gRPC server URL.
|
|
152
|
+
|
|
153
|
+
Returns:
|
|
154
|
+
The gRPC server URL
|
|
155
|
+
"""
|
|
156
|
+
return self._url
|
|
157
|
+
|
|
158
|
+
@property
|
|
159
|
+
def port(self) -> int:
|
|
160
|
+
"""Get the gRPC server port.
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
The gRPC server port
|
|
164
|
+
"""
|
|
165
|
+
return self._port
|
|
166
|
+
|
|
167
|
+
@property
|
|
168
|
+
def api_key(self) -> str | None:
|
|
169
|
+
"""Get the API key used for authentication.
|
|
170
|
+
|
|
171
|
+
Returns:
|
|
172
|
+
The API key, or None if not configured
|
|
173
|
+
"""
|
|
174
|
+
return self._api_key
|
|
175
|
+
|
|
176
|
+
@property
|
|
177
|
+
def timeout(self) -> timedelta:
|
|
178
|
+
"""Get the request timeout.
|
|
179
|
+
|
|
180
|
+
Returns:
|
|
181
|
+
The request timeout
|
|
182
|
+
"""
|
|
183
|
+
return self._timeout
|
|
184
|
+
|
|
185
|
+
@property
|
|
186
|
+
def tls(self) -> bool:
|
|
187
|
+
"""Get the TLS setting.
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
True if TLS is enabled, False otherwise
|
|
191
|
+
"""
|
|
192
|
+
return self._tls
|
|
193
|
+
|
|
194
|
+
def with_group(self, group: str):
|
|
195
|
+
"""Return a new client instance configured with a different group context.
|
|
196
|
+
|
|
197
|
+
This enables convenient group context switching without reconstructing the entire client.
|
|
198
|
+
All other configuration (URL, port, timeout, API key, TLS) is preserved.
|
|
199
|
+
|
|
200
|
+
The group parameter must be in the format 'groups/{group_id}' where group_id is a valid
|
|
201
|
+
group identifier (typically a ULID). The new client instance shares no state with the
|
|
202
|
+
original client, allowing safe concurrent usage.
|
|
203
|
+
|
|
204
|
+
Args:
|
|
205
|
+
group: The group resource name in format 'groups/{group_id}'
|
|
206
|
+
|
|
207
|
+
Returns:
|
|
208
|
+
A new client instance of the same service type with updated group context.
|
|
209
|
+
|
|
210
|
+
Raises:
|
|
211
|
+
ValueError: If group is empty or not in correct format
|
|
212
|
+
|
|
213
|
+
Example:
|
|
214
|
+
>>> service = GroupService()
|
|
215
|
+
>>> alt_service = service.with_group("groups/01ARZ3NDEKTSV4RRFFQ69G5FAV")
|
|
216
|
+
>>> resp1 = service.some_method(request) # Uses original group
|
|
217
|
+
>>> resp2 = alt_service.some_method(request) # Uses alternative group
|
|
218
|
+
"""
|
|
219
|
+
# Validation
|
|
220
|
+
if not group:
|
|
221
|
+
raise ValueError("Group parameter cannot be empty")
|
|
222
|
+
if not group.startswith("groups/"):
|
|
223
|
+
raise ValueError("Group must be in format 'groups/{group_id}'")
|
|
224
|
+
|
|
225
|
+
# Import ServiceOptions from common module
|
|
226
|
+
from meshtrade.common.service_options import ServiceOptions
|
|
227
|
+
|
|
228
|
+
# Create new options with all config preserved except group
|
|
229
|
+
options = ServiceOptions(
|
|
230
|
+
url=self._url,
|
|
231
|
+
port=self._port,
|
|
232
|
+
api_key=self._api_key,
|
|
233
|
+
group=group,
|
|
234
|
+
timeout=self._timeout,
|
|
235
|
+
tls=self._tls,
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
# Create new instance of actual runtime class (GroupService, AccountService, etc.)
|
|
239
|
+
# type(self) returns the actual class, and all services accept ServiceOptions
|
|
240
|
+
return type(self)(options)
|
|
241
|
+
|
|
149
242
|
def validator(self) -> Validator:
|
|
150
243
|
"""Get the protovalidate validator for request validation.
|
|
151
244
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Shared configuration options for all gRPC services.
|
|
3
|
+
|
|
4
|
+
This module provides a clean, extensible way to configure services with optional
|
|
5
|
+
parameters while maintaining backward compatibility and readability.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from datetime import timedelta
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ServiceOptions:
|
|
12
|
+
"""Configuration options for gRPC services.
|
|
13
|
+
|
|
14
|
+
This class provides a clean, extensible way to configure services with optional
|
|
15
|
+
parameters while maintaining backward compatibility and readability.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
def __init__(
|
|
19
|
+
self,
|
|
20
|
+
tls: bool = True,
|
|
21
|
+
url: str | None = None,
|
|
22
|
+
port: int | None = None,
|
|
23
|
+
api_key: str | None = None,
|
|
24
|
+
group: str | None = None,
|
|
25
|
+
timeout: timedelta = timedelta(seconds=30),
|
|
26
|
+
):
|
|
27
|
+
"""Initialize service options.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
tls: Whether to use TLS encryption for the gRPC connection.
|
|
31
|
+
url: The server hostname or IP address.
|
|
32
|
+
port: The server port number.
|
|
33
|
+
api_key: The API key for authentication.
|
|
34
|
+
group: The group resource name in format groups/{group_id}.
|
|
35
|
+
timeout: The default timeout for all gRPC method calls.
|
|
36
|
+
"""
|
|
37
|
+
self.tls = tls
|
|
38
|
+
self.url = url
|
|
39
|
+
self.port = port
|
|
40
|
+
self.api_key = api_key
|
|
41
|
+
self.group = group
|
|
42
|
+
self.timeout = timeout
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# Create alias to match expected exports
|
|
46
|
+
ClientOptions = ServiceOptions
|
|
@@ -40,7 +40,6 @@ from .service_meshpy import (
|
|
|
40
40
|
ClientServiceGRPCClient,
|
|
41
41
|
ClientServiceGRPCClientInterface,
|
|
42
42
|
)
|
|
43
|
-
from .service_options_meshpy import ClientOptions
|
|
44
43
|
|
|
45
44
|
# ===================================================================
|
|
46
45
|
# END OF AUTO-GENERATED SECTION
|
|
@@ -63,7 +62,6 @@ from .service_options_meshpy import ClientOptions
|
|
|
63
62
|
__all__ = [
|
|
64
63
|
# Generated exports
|
|
65
64
|
"Client",
|
|
66
|
-
"ClientOptions",
|
|
67
65
|
"ClientService",
|
|
68
66
|
"ClientServiceGRPCClient",
|
|
69
67
|
"ClientServiceGRPCClientInterface",
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""Client roles utility functions."""
|
|
2
|
+
|
|
3
|
+
from meshtrade.compliance.client.v1.client_pb2 import Client
|
|
4
|
+
from meshtrade.iam.role.v1 import role_pb2
|
|
5
|
+
from meshtrade.iam.role.v1.role_pb2 import Role
|
|
6
|
+
|
|
7
|
+
# Cache for client default roles extracted from protobuf
|
|
8
|
+
_client_default_roles: list[Role] | None = None
|
|
9
|
+
_client_default_roles_error: str | None = None
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _initialize_client_default_roles() -> None:
|
|
13
|
+
"""Initialize client default roles from protobuf extensions.
|
|
14
|
+
|
|
15
|
+
This function is called once to extract roles from the Client message's
|
|
16
|
+
message_roles extension. Results are cached for subsequent calls.
|
|
17
|
+
"""
|
|
18
|
+
global _client_default_roles, _client_default_roles_error
|
|
19
|
+
|
|
20
|
+
if _client_default_roles is not None or _client_default_roles_error is not None:
|
|
21
|
+
return
|
|
22
|
+
|
|
23
|
+
try:
|
|
24
|
+
# Get the Client message descriptor
|
|
25
|
+
client_descriptor = Client.DESCRIPTOR
|
|
26
|
+
|
|
27
|
+
# Get message options
|
|
28
|
+
options = client_descriptor.GetOptions()
|
|
29
|
+
|
|
30
|
+
# Get the message_roles extension descriptor
|
|
31
|
+
message_roles_ext = role_pb2.message_roles
|
|
32
|
+
|
|
33
|
+
# Check if extension is present
|
|
34
|
+
# Type ignore: protobuf extension API has overly strict type stubs
|
|
35
|
+
if not options.HasExtension(message_roles_ext): # type: ignore[arg-type]
|
|
36
|
+
_client_default_roles_error = f"proto message {client_descriptor.full_name} does not define extension {message_roles_ext.full_name}"
|
|
37
|
+
return
|
|
38
|
+
|
|
39
|
+
# Get the RoleList from the extension
|
|
40
|
+
# Type ignore: protobuf extension API has overly strict type stubs
|
|
41
|
+
role_list = options.Extensions[message_roles_ext] # type: ignore[arg-type]
|
|
42
|
+
|
|
43
|
+
# Extract roles and make a copy
|
|
44
|
+
_client_default_roles = list(role_list.roles)
|
|
45
|
+
|
|
46
|
+
except Exception as e:
|
|
47
|
+
_client_default_roles_error = f"failed to extract roles from Client message: {e}"
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def get_client_default_roles() -> list[Role]:
|
|
51
|
+
"""Get default roles for a client.
|
|
52
|
+
|
|
53
|
+
Returns the roles declared on the meshtrade.compliance.client.v1.Client
|
|
54
|
+
message via the meshtrade.iam.role.v1.message_roles option. The returned
|
|
55
|
+
list is a copy so callers can safely mutate it without affecting subsequent reads.
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
List of default Role values for clients
|
|
59
|
+
Empty list if retrieval fails
|
|
60
|
+
"""
|
|
61
|
+
try:
|
|
62
|
+
return must_get_client_default_roles()
|
|
63
|
+
except ValueError:
|
|
64
|
+
return []
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def must_get_client_default_roles() -> list[Role]:
|
|
68
|
+
"""Get default roles for a client, raising error on failure.
|
|
69
|
+
|
|
70
|
+
Returns the roles declared on the meshtrade.compliance.client.v1.Client
|
|
71
|
+
message via the meshtrade.iam.role.v1.message_roles option. The returned
|
|
72
|
+
list is a copy so callers can safely mutate it without affecting subsequent reads.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
List of default Role values for clients
|
|
76
|
+
|
|
77
|
+
Raises:
|
|
78
|
+
ValueError: If default roles cannot be determined
|
|
79
|
+
"""
|
|
80
|
+
_initialize_client_default_roles()
|
|
81
|
+
|
|
82
|
+
if _client_default_roles_error is not None:
|
|
83
|
+
raise ValueError(_client_default_roles_error)
|
|
84
|
+
|
|
85
|
+
if _client_default_roles is None:
|
|
86
|
+
raise ValueError("client default roles not initialized")
|
|
87
|
+
|
|
88
|
+
# Return a copy to prevent mutation
|
|
89
|
+
return list(_client_default_roles)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def get_client_default_role_index() -> dict[Role, bool]:
|
|
93
|
+
"""Get default roles as a lookup index.
|
|
94
|
+
|
|
95
|
+
Builds a set-like map keyed by roles declared on the
|
|
96
|
+
meshtrade.compliance.client.v1.Client message. The map's values are always
|
|
97
|
+
True; the structure is intended for efficient membership checks.
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
Dictionary mapping Role to True for default roles
|
|
101
|
+
Empty dict if retrieval fails
|
|
102
|
+
"""
|
|
103
|
+
try:
|
|
104
|
+
return must_get_client_default_role_index()
|
|
105
|
+
except ValueError:
|
|
106
|
+
return {}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def must_get_client_default_role_index() -> dict[Role, bool]:
|
|
110
|
+
"""Get default roles as lookup index, raising error on failure.
|
|
111
|
+
|
|
112
|
+
Builds a set-like map keyed by roles declared on the
|
|
113
|
+
meshtrade.compliance.client.v1.Client message. The map's values are always
|
|
114
|
+
True; the structure is intended for efficient membership checks.
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
Dictionary mapping Role to True for default roles
|
|
118
|
+
|
|
119
|
+
Raises:
|
|
120
|
+
ValueError: If default roles cannot be determined
|
|
121
|
+
"""
|
|
122
|
+
roles = must_get_client_default_roles()
|
|
123
|
+
return dict.fromkeys(roles, True)
|
{meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/compliance/client/v1/service_meshpy.py
RENAMED
|
@@ -16,7 +16,7 @@ from meshtrade.common import BaseGRPCClient
|
|
|
16
16
|
from meshtrade.iam.api_user.v1.api_credentials import find_credentials
|
|
17
17
|
|
|
18
18
|
from .client_pb2 import Client
|
|
19
|
-
from .
|
|
19
|
+
from meshtrade.common.service_options import ServiceOptions
|
|
20
20
|
from .service_pb2 import (
|
|
21
21
|
CreateClientRequest,
|
|
22
22
|
GetClientRequest,
|
|
@@ -35,7 +35,6 @@ from .service_meshpy import (
|
|
|
35
35
|
ApiUserServiceGRPCClient,
|
|
36
36
|
ApiUserServiceGRPCClientInterface,
|
|
37
37
|
)
|
|
38
|
-
from .service_options_meshpy import ClientOptions
|
|
39
38
|
|
|
40
39
|
# ===================================================================
|
|
41
40
|
# END OF AUTO-GENERATED SECTION
|
|
@@ -81,7 +80,6 @@ __all__ = [
|
|
|
81
80
|
"ApiUserServiceGRPCClient",
|
|
82
81
|
"ApiUserServiceGRPCClientInterface",
|
|
83
82
|
"AssignRoleToAPIUserRequest",
|
|
84
|
-
"ClientOptions",
|
|
85
83
|
"CreateApiUserRequest",
|
|
86
84
|
"DeactivateApiUserRequest",
|
|
87
85
|
"GetApiUserByKeyHashRequest",
|
|
@@ -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
|
{meshtrade-1.21.0 → meshtrade-1.23.0}/python/src/meshtrade/iam/api_user/v1/service_meshpy.py
RENAMED
|
@@ -16,7 +16,7 @@ from meshtrade.common import BaseGRPCClient
|
|
|
16
16
|
from .api_credentials import find_credentials
|
|
17
17
|
|
|
18
18
|
from .api_user_pb2 import APIUser
|
|
19
|
-
from .
|
|
19
|
+
from meshtrade.common.service_options import ServiceOptions
|
|
20
20
|
from .service_pb2 import (
|
|
21
21
|
ActivateApiUserRequest,
|
|
22
22
|
AssignRoleToAPIUserRequest,
|
|
@@ -30,7 +30,6 @@ from .service_meshpy import (
|
|
|
30
30
|
GroupServiceGRPCClient,
|
|
31
31
|
GroupServiceGRPCClientInterface,
|
|
32
32
|
)
|
|
33
|
-
from .service_options_meshpy import ClientOptions
|
|
34
33
|
|
|
35
34
|
# ===================================================================
|
|
36
35
|
# END OF AUTO-GENERATED SECTION
|
|
@@ -52,7 +51,6 @@ from .service_options_meshpy import ClientOptions
|
|
|
52
51
|
# Combined auto-generated and manual exports
|
|
53
52
|
__all__ = [
|
|
54
53
|
# Generated exports
|
|
55
|
-
"ClientOptions",
|
|
56
54
|
"CreateGroupRequest",
|
|
57
55
|
"GetGroupRequest",
|
|
58
56
|
"Group",
|
|
@@ -16,7 +16,7 @@ from meshtrade.common import BaseGRPCClient
|
|
|
16
16
|
from meshtrade.iam.api_user.v1.api_credentials import find_credentials
|
|
17
17
|
|
|
18
18
|
from .group_pb2 import Group
|
|
19
|
-
from .
|
|
19
|
+
from meshtrade.common.service_options import ServiceOptions
|
|
20
20
|
from .service_pb2 import (
|
|
21
21
|
CreateGroupRequest,
|
|
22
22
|
GetGroupRequest,
|
|
@@ -29,7 +29,7 @@ from .role_pb2 import Role, RoleList
|
|
|
29
29
|
#
|
|
30
30
|
# ===================================================================
|
|
31
31
|
|
|
32
|
-
from .role import
|
|
32
|
+
from .role import role_full_resource_name_from_group
|
|
33
33
|
|
|
34
34
|
# ===================================================================
|
|
35
35
|
# MODULE EXPORTS
|
|
@@ -40,5 +40,5 @@ __all__ = [
|
|
|
40
40
|
"Role",
|
|
41
41
|
"RoleList",
|
|
42
42
|
# Manual exports
|
|
43
|
-
"
|
|
43
|
+
"role_full_resource_name_from_group",
|
|
44
44
|
]
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"""Role utility functions for Mesh API.
|
|
2
|
+
|
|
3
|
+
This module provides helper functions for working with Role enums and their resource names.
|
|
4
|
+
All functions use the 3-part integer format: groups/{groupID}/{roleNumber}
|
|
5
|
+
for cross-language compatibility.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from meshtrade.iam.role.v1.role_pb2 import Role
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def role_is_valid(role: Role) -> bool:
|
|
12
|
+
"""Check if role value is valid (within enum range).
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
role: Role enum value (integer)
|
|
16
|
+
|
|
17
|
+
Returns:
|
|
18
|
+
True if role is a valid enum value
|
|
19
|
+
|
|
20
|
+
Example:
|
|
21
|
+
>>> role_is_valid(Role.ROLE_IAM_ADMIN)
|
|
22
|
+
True
|
|
23
|
+
>>> role_is_valid(99999999)
|
|
24
|
+
False
|
|
25
|
+
"""
|
|
26
|
+
return role in Role.values()
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def role_is_valid_and_specified(role: Role) -> bool:
|
|
30
|
+
"""Check if role is valid and not UNSPECIFIED.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
role: Role enum value (integer)
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
True if role is valid and not ROLE_UNSPECIFIED
|
|
37
|
+
|
|
38
|
+
Example:
|
|
39
|
+
>>> role_is_valid_and_specified(Role.ROLE_IAM_ADMIN)
|
|
40
|
+
True
|
|
41
|
+
>>> role_is_valid_and_specified(Role.ROLE_UNSPECIFIED)
|
|
42
|
+
False
|
|
43
|
+
"""
|
|
44
|
+
return role_is_valid(role) and role != Role.ROLE_UNSPECIFIED
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def role_full_resource_name_from_group_id(role: Role, group_id: str) -> str:
|
|
48
|
+
"""Generate full resource name from role and group ID.
|
|
49
|
+
|
|
50
|
+
Format: groups/{group_id}/{role_int}
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
role: Role enum value (integer)
|
|
54
|
+
group_id: Group ID (UUID)
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
Full resource name string using integer format
|
|
58
|
+
|
|
59
|
+
Example:
|
|
60
|
+
>>> role_full_resource_name_from_group_id(Role.ROLE_IAM_ADMIN, "01DD32GZ7R0000000000000001")
|
|
61
|
+
'groups/01DD32GZ7R0000000000000001/3000000'
|
|
62
|
+
"""
|
|
63
|
+
return f"groups/{group_id}/{int(role)}"
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def role_full_resource_name_from_group(role: Role, group: str) -> str:
|
|
67
|
+
"""Generate full resource name from role and group resource name.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
role: Role enum value (integer)
|
|
71
|
+
group: Group resource name (e.g., "groups/{id}")
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
Full resource name string using integer format
|
|
75
|
+
|
|
76
|
+
Raises:
|
|
77
|
+
ValueError: If group format is invalid
|
|
78
|
+
|
|
79
|
+
Example:
|
|
80
|
+
>>> role_full_resource_name_from_group(Role.ROLE_IAM_ADMIN, "groups/01DD32GZ7R0000000000000001")
|
|
81
|
+
'groups/01DD32GZ7R0000000000000001/3000000'
|
|
82
|
+
"""
|
|
83
|
+
if not group.startswith("groups/"):
|
|
84
|
+
raise ValueError(f"invalid group format, expected groups/{{groupID}}, got: {group}")
|
|
85
|
+
|
|
86
|
+
group_id = group[len("groups/") :]
|
|
87
|
+
if not group_id:
|
|
88
|
+
raise ValueError(f"group ID cannot be empty in group resource name: {group}")
|
|
89
|
+
|
|
90
|
+
return role_full_resource_name_from_group_id(role, group_id)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def role_from_full_resource_name(full_resource_name: str) -> Role:
|
|
94
|
+
"""Extract Role from full resource name.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
full_resource_name: Full resource name (e.g., "groups/{id}/{role_int}")
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
Role enum value (integer), or ROLE_UNSPECIFIED if parsing fails
|
|
101
|
+
|
|
102
|
+
Example:
|
|
103
|
+
>>> role_from_full_resource_name("groups/01DD32GZ7R0000000000000001/3000000")
|
|
104
|
+
3000000
|
|
105
|
+
>>> role_from_full_resource_name("invalid/format")
|
|
106
|
+
0
|
|
107
|
+
"""
|
|
108
|
+
from typing import cast
|
|
109
|
+
|
|
110
|
+
try:
|
|
111
|
+
_, role_int = parse_role_parts(full_resource_name)
|
|
112
|
+
# Python protobuf enums are integers, safe to cast
|
|
113
|
+
return cast(Role, role_int)
|
|
114
|
+
except ValueError:
|
|
115
|
+
return Role.ROLE_UNSPECIFIED
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def parse_role_parts(role_full_resource_name: str) -> tuple[str, int]:
|
|
119
|
+
"""Parse full resource name into group ID and Role.
|
|
120
|
+
|
|
121
|
+
Expected format: groups/{group_id}/{role_int}
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
role_full_resource_name: Full resource name
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
Tuple of (group_id, role_int)
|
|
128
|
+
|
|
129
|
+
Raises:
|
|
130
|
+
ValueError: If format is invalid or role number cannot be parsed
|
|
131
|
+
|
|
132
|
+
Example:
|
|
133
|
+
>>> parse_role_parts("groups/01DD32GZ7R0000000000000001/3000000")
|
|
134
|
+
('01DD32GZ7R0000000000000001', 3000000)
|
|
135
|
+
"""
|
|
136
|
+
parts = role_full_resource_name.split("/")
|
|
137
|
+
if len(parts) != 3 or parts[0] != "groups":
|
|
138
|
+
raise ValueError(f"invalid role format, expected groups/{{groupID}}/{{role}}, got {role_full_resource_name}")
|
|
139
|
+
|
|
140
|
+
group_id = parts[1]
|
|
141
|
+
if not group_id:
|
|
142
|
+
raise ValueError("group ID cannot be empty")
|
|
143
|
+
|
|
144
|
+
try:
|
|
145
|
+
role_int = int(parts[2])
|
|
146
|
+
except ValueError as e:
|
|
147
|
+
raise ValueError(f"error parsing role enum value '{parts[2]}'") from e
|
|
148
|
+
|
|
149
|
+
if role_int < 0:
|
|
150
|
+
raise ValueError(f"invalid role number in full resource name: {role_full_resource_name}")
|
|
151
|
+
|
|
152
|
+
return group_id, role_int
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def must_parse_role_parts(role_full_resource_name: str) -> tuple[str, int]:
|
|
156
|
+
"""Parse role parts, raising error on failure.
|
|
157
|
+
|
|
158
|
+
This is an alias for parse_role_parts.
|
|
159
|
+
Both functions raise ValueError on parsing errors.
|
|
160
|
+
|
|
161
|
+
Args:
|
|
162
|
+
role_full_resource_name: Full resource name
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
Tuple of (group_id, role_int)
|
|
166
|
+
|
|
167
|
+
Raises:
|
|
168
|
+
ValueError: If format is invalid
|
|
169
|
+
|
|
170
|
+
Example:
|
|
171
|
+
>>> must_parse_role_parts("groups/01DD32GZ7R0000000000000001/3000000")
|
|
172
|
+
('01DD32GZ7R0000000000000001', 3000000)
|
|
173
|
+
"""
|
|
174
|
+
return parse_role_parts(role_full_resource_name)
|
|
@@ -31,7 +31,6 @@ from .service_meshpy import (
|
|
|
31
31
|
UserServiceGRPCClient,
|
|
32
32
|
UserServiceGRPCClientInterface,
|
|
33
33
|
)
|
|
34
|
-
from .service_options_meshpy import ClientOptions
|
|
35
34
|
|
|
36
35
|
# ===================================================================
|
|
37
36
|
# END OF AUTO-GENERATED SECTION
|
|
@@ -54,7 +53,6 @@ from .service_options_meshpy import ClientOptions
|
|
|
54
53
|
__all__ = [
|
|
55
54
|
# Generated exports
|
|
56
55
|
"AssignRoleToUserRequest",
|
|
57
|
-
"ClientOptions",
|
|
58
56
|
"CreateUserRequest",
|
|
59
57
|
"GetUserRequest",
|
|
60
58
|
"ListUsersRequest",
|
|
@@ -16,7 +16,7 @@ from meshtrade.common import BaseGRPCClient
|
|
|
16
16
|
from meshtrade.iam.api_user.v1.api_credentials import find_credentials
|
|
17
17
|
|
|
18
18
|
from .user_pb2 import User
|
|
19
|
-
from .
|
|
19
|
+
from meshtrade.common.service_options import ServiceOptions
|
|
20
20
|
from .service_pb2 import (
|
|
21
21
|
AssignRoleToUserRequest,
|
|
22
22
|
CreateUserRequest,
|