Type 2: include data about PAT expiry

未关闭
#1,197 9 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python

调研方向

Start at the sign_in method in server/endpoint/auth_endpoint.py and compare its authentication response handling with the linked Tableau REST API documentation. Trace the returned token-expiry value and determine how the optional threshold, warning, default, and callback should behave; done means near-expiry tokens produce the requested warning or callback with the API’s days:hours:seconds string.

由索引模型根据 Issue 内容生成。

描述

enhancement Server-Side Enhancement

Summary

When authenticating with a personal access token (PAT) a duration until the expiry of the token is returned by the login request.
This information is dropped by the python client, yet would be useful to have it logged as a warning when the expiration date is near.

Description

As users of the python client, we have automated some data-engineering tasks, and authenticate with PATs.
Since the PATs may be configured to expire after a given period of time, it is necessary to keep track of when tokens need to be renewed.

The time until expiry is available in the following REST Request:
https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_auth.htm#make-a-sign-in-request-with-a-personal-access-token

Since this request is already made as a part of the authentication process in the python client, I would like to extend the client to pass two optional parameters to the sign_in method:

  • token_expiry_warning_threshold: Optional[int] = 60
  • token_expiry_warning_callback: Optional[Callable[[str], None]]

The provided threshold should be an integer which represents days. If the token is set to expire in less days than in the threshold, a warning should be logged. I think 60 days is a sane default given the default expiration period is after 1 year.
A callable may also be provided which will be called with the string containing the time until expiry as received from the API. Its format is "days:hours:seconds".

主要语言
Python
星标
716
派生
446
平均合并
8 天 8 小时
30 天内合并 PR
2

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tableau/server-client-python 的其他 Issue

查看 tableau/server-client-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。