Skip to main content

Thư viện Admin SDK dành cho các module.

Cài đặt:

 $ pip3 install mobio-admin-sdk

Chức năng:

  • Verify token

Sử dụng:

1. Verify token:
 from mobio.sdks.admin import MobioAdminSDK

 MobioAdminSDK().config(
     admin_host="",	# admin host
     redis_uri="",	# redis uri
     module_use="",	# liên hệ admin để khai báo tên của module
     module_encrypt="",	# liên hệ admin để lấy mã
     api_admin_version="api/v2.1",   # danh sách api có thể sử dụng ["v1.0", "api/v2.0", "api/v2.1"]
 )
 auth = MobioAdminSDK().create_mobio_verify_token()
 
 @service_mod.route(url_path, methods=["get"])
 @auth.verify_token
 @try_catch_error
 def get_config(merchant_id):
     return build_response_message(Config(merchant_id).get_data())
2. Merchant config:
 from mobio.sdks.admin import MobioAdminSDK

 MobioAdminSDK().request_get_merchant_config_host(
         merchant_id,
         key=None,       # key muốn lấy giá trị
         admin_version=None, # api version admin muốn gọi trong trường hợp chỉ có version đó hỗ trợ
     )
 MobioAdminSDK().request_get_merchant_config_other(
         merchant_id,
         list_key=None,       # danh sách key muốn lấy giá trị
         admin_version=None, # api version admin muốn gọi trong trường hợp chỉ có version đó hỗ trợ
     )
 
 MobioAdminSDK().request_get_partner_info(
         partner_key=None,
         decrypt_data=False,
 )   # result: { "code": 200, "data": ""}, {"code": 400, "message": "key not found"}, {"code": 412, "message": "key not active"}, {"code": 413, "message": "key expire"}
     
 MobioAdminSDK().request_get_config_time_and_currency(merchant_id="")   
 # result: { 
 #      "config_time": {
 #             "timezone": 7,
 #             "text": "(UTC+07:00) Bangkok, Hanoi, Jakarta",
 #             "location": "Asia/Saigon",
 #         },
 #         "currency_code": "vnd"
 # }
 
 MobioAdminSDK().convert_datetime_to_format(merchant_id: str, from_date: datetime.datetime,
                                format_type: int, tz=None, lang=None)
 """
 :param merchant_id: 
 :param from_date: datetime
 :param format_type: FORMAT_ddmm = 1 FORMAT_ddmmYYYY = 2 FORMAT_ddmmYYYYHHMM = 3
 :param tz: number hour
 :param lang: vi en
 :return: string format date 
 """
 
 MobioAdminSDK().gen_jwt_anonymous_user(merchant_id: str, data_jwt: dict, session_time=None)
 """
 :param merchant_id: 
 :param data_jwt: dict, là dữ liệu sẽ được đóng gói vào trong jwt, sau này từ request của client có thể đọc thông tin này.
 :param session_time: int, giây, thời gian hợp lệ của jwt 
 :return: string jwt 
 """
 

Log - 1.0.1

- release sdk

Log - 1.0.2

- Kiểm tra license server còn hạn sử dụng hay không 

Log - 1.0.3

- Fix lỗi đọc file license 

Log - 1.0.4

- Authen app key data out 

Log - 1.0.5

- update lib kafka v2

Log - 1.0.6

- encrypt, decrypt field by config

Log - 1.0.7

- kiểm tra thông tin field trước khi encrypt, decrypt 

Log - 1.0.8

- sdk tự lấy thông tin REDIS_URI  

Log - 1.0.9

- bỏ encoding trong json.loads  

Log - 1.0.10

- thêm hàm lấy cấu hình múi giờ và tiền tệ
- cập nhật kết nối redis theo loại

Log - 1.0.11

- thêm hàm định dạng thời gian từ date thành string theo chuẩn

Log - 1.0.12

- thêm hàm gen token jwt anonymous   

Log - 1.0.18

- cập nhật logic mã hóa field   

Log - 1.0.19

- thêm mã hóa kiểu dữ liệu bất kỳ

Metadata

Release files for mobio-admin-sdk-test 1.0.31

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mobio-admin-sdk-test 1.0.31
File Size Uploaded Provenance
mobio_admin_sdk_test-1.0.31.tar.gz 23.8 kB Without provenance Details

Release files / mobio_admin_sdk_test-1.0.31.tar.gz

Download URL mobio_admin_sdk_test-1.0.31.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4b42386059f1e93e7dd84c96d734db0192d09d0d25d5f3111366bb7aa9943268
BLAKE2b-256 checksum
How to use checksums
1ee641c4a851f7bd3a762536c24108df8d0fe0284437a699b995153d6594621f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.7

Security for mobio-admin-sdk-test 1.0.31

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page