Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Disable certain functionalities in RemoteOAuth2Mixin

未关闭
#176 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
停滞
技术栈
python

调研方向

先阅读 RemoteOAuth2Mixin 和 DeveloperTokenAuth,然后审查 issue #173 中的通用基类提案。确定是否应禁用或移除 revoke() 和列出的构造函数选项,并定义 2.0.0 版本发布时预期的破坏性变更行为。

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

描述

breaking enhancement

When using RemoteOAuth2Mixin, all /token calls are delegated to another process or server. Thus:

  • The client_id and client_secret shouldn't be required. In fact, they perhaps shouldn't even be allowed to be passed. Clients that need to do remote auth should be discouraged from having any of their credentials hard-coded, especially since they aren't even needed.
  • store_tokens should perhaps be disallowed. Since the tokens are owned by the remote process, it should be in control of where its tokens go. If a client needs to restart, it should get its tokens from the remote process/server, not from its own token store.
  • box_device_id and box_device_name are useless if we're not making /token calls.
  • refresh_token should never be available to the client, so it shouldn't be possible to pass this.

Also, since the remote process/server owns the tokens, we should possibly disable revoke(). If we do that, then:

  • We definitely don't need client_id and client_secret anymore, since they would never be used.
  • For the same reason, we also don't need network_layer anymore.
  • We might not need refresh_lock anymore. Presumably, the remote server can handle its own locking, without the clients needing to coordinate.

revoke could be made to pass (DeveloperTokenAuth does this) or raise, and the unneeded constructor arguments can be passed as None to the super-class, so that TypeError is raised if a user tries passing any of them.

Alternatively, factor this into #173, and create a common base-class that doesn't have any of these functionalities.

This would be a breaking change, so consider this for 2.0.0.

主要语言
Python
星标
460
派生
224
平均合并
11 小时 29 分钟
30 天内合并 PR
20

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

box/box-python-sdk 的其他 Issue

查看 box/box-python-sdk 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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