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

pushed_authorization_request sends list authorization_details as a Python repr

オープン 初心者向け
#903 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

@RaphaelFakhri がすでに取り組んでいます。

2026年10月19日 から。

  • #904 @RaphaelFakhri による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
api

調査の方向性

PushedAuthorizationRequests.pushed_authorization_request()と、issueで言及されている既存のテストtest_with_authorization_detailsから始めてください。RestClient._request()がリスト値をどのようにエンコードするかを、#695のBackChannelLogin.back_channel_login()の修正と比較してください。リストが渡されたとき、フォーム本文にauthorization_detailsが二重引用符を使ったJSON配列として含まれていれば完了です。

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

説明

Checklist
  • I have looked into the README and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
Description

PushedAuthorizationRequests.pushed_authorization_request() posts a form-encoded body (Content-Type: application/x-www-form-urlencoded). RestClient._request() converts the payload with urllib.parse.urlencode(), which turns a list value into its Python repr.

When you pass authorization_details as a list, which the existing test test_with_authorization_details does, the request body contains:

authorization_details=%5B%7B%27type%27%3A+%27money_transfer%27%2C+...

That decodes to [{'type': 'money_transfer', ...}], with single quotes, which is not JSON. RFC 9396 requires authorization_details to be a JSON array, so RAR through PAR does not work with a list.

BackChannelLogin.back_channel_login() had the same problem and was fixed in #695 by calling json.dumps() on list values.

Reproduction
from unittest import mock
from urllib.parse import parse_qs
from auth0.authentication.pushed_authorization_requests import PushedAuthorizationRequests

with mock.patch("requests.request") as req:
    req.return_value.status_code = 201
    req.return_value.text = '{"request_uri": "urn:x", "expires_in": 30}'
    PushedAuthorizationRequests("my.domain.com", "cid", client_secret="s").pushed_authorization_request(
        response_type="code",
        redirect_uri="https://example.com/cb",
        authorization_details=[{"type": "money_transfer"}],
    )
    print(parse_qs(req.call_args.kwargs["data"])["authorization_details"])
# ["[{'type': 'money_transfer'}]"]

Expected: ['[{"type": "money_transfer"}]'].

Additional context

Workaround: pass authorization_details=json.dumps([...]).

auth0-python version

6.8.0 (main at 9aae3e5)

Python version

3.12

主要言語
Python
スター
578
フォーク
190
平均マージ
9時間 39分
マージ済み PR(30日)
7

環境構築

はじめの一歩

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

auth0/auth0-python のほかの issue

auth0/auth0-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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