将jira基本身份验证会话缓存到磁盘以用于控制台应用程序。

jira-context的Python项目详细描述


您有与jira服务器交互的命令行应用程序吗? 你的用户每次运行 应用?您不能使用oauth吗,因为您的命令行 应用程序是开源的,或者您无法保护消费者 秘密?

嗨,Robbol86这里是Jira的背景。提示的简单方法 客户端工作站上的凭据和缓存会话cookie。

jira-context在python 2.6、2.7、3.3和3.4上受支持。

Build StatusCoverage StatusLatest VersionDownloadsDownload formatLicense

快速启动

安装:

pip install jira-context

用法

# example.pyfrom__future__importprint_functionimportsysfromjira_contextimportJIRAserver='https://jira.company.local'query='assignee = currentUser() AND resolution = Unresolved'iflen(sys.argv)==2:JIRA.FORCE_USER=sys.argv[1]print('Connecting to: '+server)withJIRA(server=server)asj:ifj.ABORTED_BY_USER:print('Aborted by user.',file=sys.stderr)sys.exit(1)issues=j.search_issues(query,maxResults=5)forissueinissues:print(issue.key,issue.fields.summary)
$ python example.py
Connecting to: https://jira.company.local
JIRA username: does_not_exist
JIRA password:
Authentication failed or bad password, try again.
JIRA username:
Aborted by user.
$ python example.py $USER
Connecting to: https://jira.company.local
JIRA password:
FAKE-659 service solahart hp 082113812149
FAKE-620 Need new version to be compatible in Jira 6.3.1
FAKE-525 Half page become blank when Activity Stream gadget view as Wallboard
FAKE-468 create page and with custom fields
FAKE-022 As a burndown gadget I should support GH 6.0+
$ python example.py
Connecting to: https://jira.company.local
FAKE-659 service solahart hp 082113812149
FAKE-620 Need new version to be compatible in Jira 6.3.1
FAKE-525 Half page become blank when Activity Stream gadget view as Wallboard
FAKE-468 create page and with custom fields
FAKE-022 As a burndown gadget I should support GH 6.0+

类属性

持续

这些属性/变量在 当前正在运行的进程。如果你有两个 with块和ABORTED_BY_USER在第一个块中变为真, 第二个块将跳过身份验证。

NameDescription/Notes
^{tt3}$False by default. Becomes True if ^{tt5}$ is True and the user enters a blank username or password.
^{tt6}$File path to the cache file used to store the base64 encoded session cookie.
^{tt7}$If set to a string, user won’t be prompted for their username.
^{tt5}$Set to False if you don’t want the user to continue without a JIRA session if they enter a blank user/pass.

实例

这些属性仅在当前jira()实例中持久化。

NameDescription/Notes
^{tt9}$Instantiate with False if you don’t want the user prompted for credentials (useful in threads).
^{tt10}$Becomes True if ^{tt9}$ is False and cached cookies were invalid/missing.

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

推荐PyPI第三方库


热门话题
Java算法:如何对实体进行分组   C语言中的Java X509EncodedKeySpec#   如何修复java lambda筛选器(缺少返回语句)与future   java有没有办法在Swing中以亚像素精度绘制线条?   HV000030:找不到约束“javax”的验证器。验证。限制。大小为“验证类型”的java。util。可选<java。lang.String>'   CQL中语句的java分页状态   在开发时使用applet查看器的java对象相关applet   java如何从Oracle获取时区ID而不是时区偏移量   java递增变量   java JavaFX InvalizationListener或ChangeListener   java使用多个数据包将大量XMP数据插入jpg?   java允许删除请求   java为什么与类同名的方法不需要返回类型?   java数据转换错误转换   java一旦布尔值为真,如何关闭JFrame?   如何将数据写入两个java。木卫一。一次输出流对象?   mysql如何使用java在SQL中划分两列?   java使用Saxon/XQuery设置URI或目录解析器   mysql java。sql。SQLException:无法将值“20200816 17:33:21.690”从第18列转换为时间戳