エージェントコマース: クライアント登録完了画面にトークン取得例 (scope の指定方法) を追記する
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- php
- Domain
- documentation
Research direction
Start with templates/agent_commerce_client_issued.twig, the registration completion view named in the issue, and review the POST /token request details. Add a copyable curl example showing client_credentials, available client scopes, and the behavior when scope is omitted; the page should explain how the issued credentials are used to obtain a token.
Written by the indexing model from the issue text.
Description
背景
#191 のレビュー (#discussion_r3732470588) から切り出しました。
ACP/UCP クライアント (client_credentials) でトークンを取得する際、エージェント事業者から見て scope の指定方法が分かる導線がありません。現状の挙動は次のとおりです。
| 送信内容 | 結果 |
|---|---|
scope 省略 |
200 / クライアントが保有する scope がすべて付与される (ScopeRepository::setupScopes() の empty($requestedScopes) 分岐でクライアント scope をそのまま返すため) |
scope=acp:checkout のようにクライアント保有 scope を明示 |
200 / 明示した scope のみ付与 |
クライアントが保有しない scope を明示 (例: scope=read) |
invalid_scope |
動作としては問題ありませんが、登録完了画面 (agent_commerce_client_issued.twig) にはクライアント ID とシークレットしか表示されないため、事業者へ渡す際に「このシークレットでどうトークンを取るのか」が伝わりません。
やりたいこと
登録完了画面に POST /token の要求例を追記する。
grant_type=client_credentialsであることscopeに何を指定できるか (そのクライアントに付与した scope)scopeを省略した場合は付与済み scope が全付与されること
curl 例をそのまま貼れる形にしておくと、事業者への連携がそのまま行えて親切だと思います。
補足
scopes.default: ['read'] はトークン発行経路とは無関係で、AddClientDefaultScopesListener (クライアント保存時に scope 未指定なら既定を入れる) にのみ効きます。レビュー中に私が誤解した点なので、あわせて記録しておきます。
- Dominant language
- PHP
- Stars
- 9
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EC-CUBE/eccube-api4
-
enhancement security
Difficulty 5/5 Over a week Newbie friendliness 35/100
EC-CUBE/eccube-api4#195 ·
-
READMEの修正とdocsの削除 Open
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
EC-CUBE/eccube-api4#193 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
EC-CUBE/eccube-api4#192 · 1 comment ·
-
authorization enhancement
Difficulty 5/5 Over a week Newbie friendliness 42/100
EC-CUBE/eccube-api4#189 · 2 comments ·
-
authorization enhancement
Difficulty 4/5 3-5 days Newbie friendliness 58/100
EC-CUBE/eccube-api4#188 · 2 comments ·
All issues in EC-CUBE/eccube-api4
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·