宜都UCenter软件开发包。

ucenter-sdk的Python项目详细描述


Info:该组件是提供给应用方使用的,用来访问用户中心功能的SDK
Author:shiwei.ma (shiwei.ma@yiducloud.cn)
Maintainer:qibin.jin(qibin.jin@yiducloud.cn), shiwei.ma(shiwei.ma@yiducloud.cn)

About

ucenter-sdk 是架构组新用户中心系统提供的SDK。 用于辅助内部应用开发者快速接入新用户中心,对接并完成如: 登录用户信息管理应用信息管理权限管理单点登录功能应用间授权管理等功能 。 部分文档已经更新和发布,包括一个简明教程,用户指南和 API参考手册

Supported Ucenter Versions

ucenter-sdk 现支持Ucenter v2.0.0

Installation

我们推荐使用 pip 。你可以使用 pip install -ihttp://devpi.intra.yiducloud.cn/root/yiducloud/+simple/--trusted-host devpi.intra.yiducloud.cn -Uucenter-sdk 来安装它。

Dependencies

ucenter-sdk 所依赖的可以通过 pip 安装。 使用ucenter-sdk 你需要满足:

  • requests>=2.1.0

Examples

Some simple examples of what MongoEngine code looks like:

# -*- coding:utf-8 -*-fromucenter_sdkimportuc_call# 应用名,应用必须在统一用户中心中有注册# 如果是新应用,可以找管理员添加app_name='dep-platform'# 应用间授权(OAUTH2)凭证# 在统一用户中心中申请(由管理员添加)oauth2_req_args={'client_id':'open-platform',# type: str'client_secret':'open-platform-secret','grant_type':'client_credentials','scope':'cluster:all org:all app:all',}# 应用所在的集群# 默认不需要用户指定,会在运行时,由平台的环境变量自动赋值。#cluster_name = '用户中心cluster'# 用户中心服务地址# 默认不需要用户指定,会在运行时,由平台的环境变量自动赋值。uc_uri='http://localhost:5102'ucenter=uc_call(client_credential=oauth2_req_args,app_name=app_name,uc_uri=uc_uri)login_name='super_admin'password='123456'ucenter_user=ucenter.login_check(login_name=login_name,password=password)print(ucenter_user)>>>{"username":"super_admin","app":"{'status': 0, 'by_uid': u'用户中心', 'createAt': '2018-11-13 21:12:52', 'name': u'用户中心app', 'updateAt': '2018-11-13 21:12:52', 'removed': False, 'type': u'inner', 'id': '5bc87f1059179433b79d8aa1', 'desc': u'用户中心'}","phone":null,"updateAt":"2018-11-13T21:12:53.200000","id":"5beacdd5bda7532ebbbd3592","auth_phone":false,"userid":"super_admin","auth_email":false,"ext":{"title":null,"createAt":null,"attrs":null,"department":null,"updateAt":null,"id":null},"createAt":"2018-11-13T21:12:53.201000","fullname":"super_admin","email":null}

Tests

运行测试用例

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何将JButton合并到图形中?   java在每个循环中使用基类类型或派生类类型   JavaSwingGUI应用程序完全是空白的,没有任何内容,而按钮被添加到面板中   java Android获取getDefaultSensor括号时出错   java Spring引导和安全性与AngularJS登录页面   java注销appengine应用程序而不从google注销。通用域名格式   java仅在发生错误或异常时创建日志文件,而不使用log4j   java get json数组和Retrift 2   swing中的java响应映像   为什么java的inputstream。close()块?   java驱动管理器。getConnection()非常冗长   java如何使用joml将标准化向量旋转到一个点   ubuntu将Java程序的输出结果保存到一个文件中   java动态可拖动、可编辑和自动调整大小的文本字段