mwsdk
maxwin 团队常用的服务,包括 kong,rightmanage等,直接从 consul 中读取服务信息
Kong 的使用
from mwsdk import Kong
# 创建kong 服务
k = Kong()
# 向kong注册服务,需jwt认证
k.reg_service('monitor-srv/api/v1.0','192.168.101.88:8999',auth='jwt',kong_uris='monitor-srv/api')
# 向kong注册upstream和target,增加负载平衡
k.add_upstream_target('monitor-srv','192.168.101.88:8999',50)
k.add_upstream_target('monitor-srv','192.168.101.99:8888',50)
# 把upstream注册到kong,不需要认证
k.reg_service('monitor-srv/api/doc','monitor-srv',auth='',kong_uris='monitor-srv/doc')
Rightmanage的使用
from mwsdk import Rightmanage_inner
# Rightmanage为内网的权限服务,不需要认证
rm = Rightmanage_inner()
# 获取权限资料
status_code, rm_json = rm.permissions('maxwin_web','admin.id')
AIORightmanage_inner 的使用
支持async,方法同 Rightmanage
安装方法
pip install mwsdk
构建包命令
python -m build
pip install -e . # 本地安装包
python -m twine upload dist/*
Changes
0.3.2 (2025-01-10)
增加unhealthyd的配置
0.3.1 (2025-01-10)
支持kong 3.9.x的注册
0.2.13 (2020-05-20)
删除consul_agent_conf变量
0.2.11 (2019-06-26)
fix 访问 refresh-permissions错误
0.2.11 (2019-06-26)
fix 访问 refresh-permissions错误
0.2.10 (2019-06-25)
增加 refresh-permissions的功能
0.2.9 (2018-12-17)
取 Rightmanage_inner的配置时,near=True
0.2.8 (2018-12-17)
增加创建公司管理者用户的api
0.2.7 (2018-11-13)
增加 api auth-key 认证
0.2.4 (2018-10-25)
fix gbk error
0.2.3 (2018-10-25)
增加 kong.add_upstream_target,支持kong的upstream
0.2.0 (2018-09-29)
增加 AIORightmanage_inner和Rightmanage_inner 类
Metadata
Release files for mwsdk 0.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mwsdk-0.3.5.tar.gz | 11.8 kB | Without provenance | Details |
Release files / mwsdk-0.3.5.tar.gz
| Download URL | mwsdk-0.3.5.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89c29824bbff545114c925d0aa3fbc057188c2894e4f1a4c2b9cecb3a320f7d3
|
|
BLAKE2b-256 checksum How to use checksums |
de264a3908930a5685032790024937854fba6a16e991e700b11b6ed646d989d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for mwsdk 0.3.5
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.