OAuth クライアント一覧のシークレット表示を confidential クライアント全般で見直す
- Dominant language
- PHP
- Stars
- 9
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
## 背景
#191 のレビュー ([#discussion_r3732470602](https://github.com/EC-CUBE/eccube-api4/pull/191#discussion_r3732470602) / [#discussion_r3732470605](https://github.com/EC-CUBE/eccube-api4/pull/191#discussion_r3732470605)) から切り出しました。
league は**クライアントシークレットを保存時にハッシュ化せず、初回のトークン取得成功時に bcrypt へ日和見アップグレード**します (`ClientRepository::validateClient()`)。そのため OAuth クライアント一覧に表示される値は、一度でも使われた後は**事業者へ渡せないハッシュ**になります。管理者がハッシュをシークレットと誤認する経路が残ります。
#191 では ACP/UCP 用クライアントについてのみ、一覧での再表示をやめ (`-` 表示)、登録直後の完了画面で 1 度だけ平文を提示する方式を導入しました。一方 **GraphQL 用の confidential クライアントは従来どおり一覧に描画され続けている**ため、同じ問題が残っています。
## 検討したいこと
`isConfidential()` な全クライアントで一覧のシークレット表示を統一するかどうか。ただし単純に隠すだけでは既存の導線を壊します。
- GraphQL クライアントは「登録後、初回利用前に一覧からコピーする」のが現在の運用
- 一覧に平文を出さないなら、汎用フォーム (`ClientType`) 側にも**発行時のワンタイム表示**が必要になる
- 「一度でも使われたか」を判定する手段が無いため、表示/非表示の動的な出し分けはできない
UX 込みで設計してから実装する必要があるため、#191 とは分けています。
## 併せて見直す
`OAuthController::index()` がビュー専用に組み立てている `agentCommerceClientIds` の持ち方も、この方針決定に従属するため同時に再検討します。
現状は Twig に `'acp:'` / `'ucp:'` を直書きしない (= `AgentCommerceClientType::PROTOCOL_SCOPES` を正本に保つ) ためにコントローラ側で判定していますが、confidential クライアント全般で統一する方針を採るなら、この分岐自体が不要になります。
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with OAuthController::index(), ClientType, and ClientRepository::validateClient() to understand the existing secret display and hashing flow; compare it with the ACP/UCP behavior introduced in #191. Define and document the UX for all confidential clients, including one-time secret display and the dependent agentCommerceClientIds handling, before deciding what implementation is complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authentication, backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100