将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第三方库


热门话题
如何使用SeleniumWebDriver捕获特定元素的屏幕截图而不是整个页面?   WAS 8.5中的java JAXWS异步IO异常   java Android Studio无法解析数组适配器中的符号项   swing Java在运行时添加和删除按钮   java Spring Boot 2.0。x禁用特定配置文件的安全性   java这是我的最后一个代码,我在“if(Users[B].substring(0,1)==“1”){//Find String Cut Char Function”上遇到错误   单击菜单选项后打开“活动”时发生java错误   java Tic Tac Toe NullPointerException   java如何做数学题。随机进入for循环   java Http状态404错误处理spring mvc   java循环依赖双向@OneToMany JPA关系   java我可以在不重新启动项目的情况下添加servlet吗   java在蓝色/绿色部署中如何管理共享数据库?   这是一个系统。currentTimeMillis()是Java中时间性能的最佳度量?