Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add optional CooperativelyManagedOAuth2 functionality to always check for new tokens

オープン
#180 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

CooperativelyManagedOAuth2Mixinから始め、特に _get_tokens()、_get_and_update_current_tokens()、および BoxSessionで使用される access_tokenプロパティを確認します。refresh()、revoke()、APIリクエストがどのようにトークンを取得するかを追跡し、その後、サブクラスと初期化パラメーターによるオプションを比較します。選択したオプションの動作が仕様化され、実装され、キャッシュ済みトークンと新たに取得したトークンの両方についてカバーされていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement

CooperativelyManagedOAuth2Mixin overrides _get_tokens(). When refresh() or revoke() are called, this protected method is called to get the latest tokens. However, the access_token property (used by BoxSession for all API requests) still uses the cached _access_token attribute.

During normal usage, this means that, after another instance has done a refresh, the BoxSession will usually make one API call with expired tokens before grabbing the updated tokens.

This makes sense as a default behavior. If the cooperative auth is happening over a network, then the cost of one extra API call per hour is much less than checking for new tokens for every single API call.

But if the cooperation is happening within a process and the mechanism is low-cost, it may be more economical to override the access_token property to always call _get_and_update_current_tokens() before returning the _access_token attribute.

This can be done with a CooperativelyManagedOAuth2Mixin subclass, or an __init__ parameter to toggle the behavior.

There's also the question of whether this is useful functionality to add to the SDK.

主要言語
Python
スター
460
フォーク
224
平均マージ
11時間 29分
マージ済み PR(30日)
20

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

box/box-python-sdk のほかの issue

box/box-python-sdk の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。