fix: API キーコマンドの --scopes ヘルプを実際に使用可能なスコープに修正#74
Merged
Conversation
📝 WalkthroughWalkthroughこのプルリクエストは、APIキーコマンド( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/commands/me-api-keys.ts (1)
2-7: 同一モジュールからの重複インポートを統合してください。
../helpers.jsからのインポートが2行に分かれています。1つのインポート文に統合することを推奨します。♻️ 修正案
-import { withErrorHandler, createClient, resolveOptions, getFormat, outputResponse } from "../helpers.js"; +import { withErrorHandler, createClient, resolveOptions, getFormat, outputResponse, API_KEY_SCOPES_HELP_NOTES } from "../helpers.js"; import { loadConfig, saveConfig } from "../config.js"; import { parseJsonInput } from "../input.js"; import { printError, printWarning } from "../output.js"; import { addExamples, addNotes } from "./help.js"; -import { API_KEY_SCOPES_HELP_NOTES } from "../helpers.js";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/me-api-keys.ts` around lines 2 - 7, 同一モジュール(../helpers.js)からの重複インポートを統合してください — 現在分かれている withErrorHandler, createClient, resolveOptions, getFormat, outputResponse と API_KEY_SCOPES_HELP_NOTES を1つのimport文にまとめ、不要な重複行を削除して1行でインポートするよう修正してください。src/commands/admin/api-keys.ts (1)
2-7: 同一モジュールからのインポートを統合することを検討してください。
../../helpers.jsからのインポートが2箇所に分かれています。1つのインポート文にまとめることで、可読性とメンテナンス性が向上します。♻️ 提案する修正
-import { withErrorHandler, createClient, resolveOptions, getFormat, outputResponse } from "../../helpers.js"; +import { withErrorHandler, createClient, resolveOptions, getFormat, outputResponse, API_KEY_SCOPES_HELP_NOTES } from "../../helpers.js"; import { loadConfig, saveConfig } from "../../config.js"; import { parseJsonInput } from "../../input.js"; import { printError, printWarning } from "../../output.js"; import { addExamples, addNotes } from "../help.js"; -import { API_KEY_SCOPES_HELP_NOTES } from "../../helpers.js";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/admin/api-keys.ts` around lines 2 - 7, Summary: Two separate import statements are pulling from the same module; merge them into one to improve readability and maintainability. Fix: locate the two imports that reference the same module (the imports that include withErrorHandler, createClient, resolveOptions, getFormat, outputResponse and the separate import of API_KEY_SCOPES_HELP_NOTES) and combine them into a single import statement that lists all symbols (withErrorHandler, createClient, resolveOptions, getFormat, outputResponse, API_KEY_SCOPES_HELP_NOTES); remove the now-redundant import line and ensure there are no naming conflicts or duplicate symbols after merging.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/commands/admin/api-keys.ts`:
- Around line 2-7: Summary: Two separate import statements are pulling from the
same module; merge them into one to improve readability and maintainability.
Fix: locate the two imports that reference the same module (the imports that
include withErrorHandler, createClient, resolveOptions, getFormat,
outputResponse and the separate import of API_KEY_SCOPES_HELP_NOTES) and combine
them into a single import statement that lists all symbols (withErrorHandler,
createClient, resolveOptions, getFormat, outputResponse,
API_KEY_SCOPES_HELP_NOTES); remove the now-redundant import line and ensure
there are no naming conflicts or duplicate symbols after merging.
In `@src/commands/me-api-keys.ts`:
- Around line 2-7: 同一モジュール(../helpers.js)からの重複インポートを統合してください — 現在分かれている
withErrorHandler, createClient, resolveOptions, getFormat, outputResponse と
API_KEY_SCOPES_HELP_NOTES を1つのimport文にまとめ、不要な重複行を削除して1行でインポートするよう修正してください。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 623eb732-7267-45fa-86f2-6f39a617b0a1
📒 Files selected for processing (18)
CHANGELOG.mdsrc/commands/admin/api-keys.tssrc/commands/me-api-keys.tssrc/helpers.tstests/admin-api-keys.test.tstests/admin-oauth-clients.test.tstests/admin-policies.test.tstests/admin-tenants.test.tstests/admin-users.test.tstests/auth.test.tstests/entities.test.tstests/health.test.tstests/me-api-keys.test.tstests/me-oauth-clients.test.tstests/setup-command-mocks.tstests/snapshots.test.tstests/temporal.test.tstests/types.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
me api-keys create,admin api-keys create/update) のヘルプに表示されるスコープ一覧が、OAuth クライアント用の全スコープ(18種)を表示していたApiKeyScopeSchema) で受け付けるのは6スコープのみのため、API キー専用のAPI_KEY_SCOPES_HELP_NOTESを新設して正しいスコープのみ表示するよう修正SCOPES_HELP_NOTESを使用Valid API key scopes
read:entities,write:entities,read:subscriptions,write:subscriptions,read:registrations,write:registrationsTest plan
npm run lintパスnpm run typecheckパスnpm test全624テストパスSummary by CodeRabbit
バグ修正
me api-keys、admin api-keys) のヘルプ出力を修正し、API キーで実際に使用可能な6つのスコープのみを正確に表示するようにしました。これにより、ユーザーは API キーに適用される権限範囲をより明確に理解できるようになります。