Skip to content

✨ Return rich plugin info from installed plugins endpoint#306

Merged
Nlkomaru merged 2 commits intomasterfrom
feat/rich-plugin-info-endpoint
Mar 31, 2026
Merged

✨ Return rich plugin info from installed plugins endpoint#306
Nlkomaru merged 2 commits intomasterfrom
feat/rich-plugin-info-endpoint

Conversation

@Nlkomaru
Copy link
Copy Markdown
Member

Summary

  • /api/v1/commons/server/plugins エンドポイントのレスポンスを、プラグイン名の文字列配列から詳細情報を含むオブジェクト配列に変更
  • Bukkitへの直接アクセスを PluginInfoService に抽出し、ルーターはサービス経由でデータを取得するように変更
  • 入れ子構造のレスポンス: dependencies.required/soft, file.name, file.hash.sha1/sha256

Changes

  • Model: PluginsDataPluginInfoData + PluginDependenciesData + PluginFileData + PluginFileHashData
  • Service: PluginInfoService interface + PluginInfoServiceImpl (Koin DI)
  • Router: PluginsRouter をサービス経由に変更
  • OpenAPI: スキーマを新しい入れ子構造に更新

Test plan

  • ビルドが成功することを確認
  • /api/v1/commons/server/plugins がプラグインの詳細情報を返すことを確認
  • レスポンスに name, version, authors, dependencies, file.name, file.hash.sha1, file.hash.sha256 が含まれることを確認

Refactor the /api/v1/commons/server/plugins endpoint to return detailed
plugin information (name, version, authors, dependencies, file hash)
instead of a plain string array. Extract Bukkit logic into PluginInfoService.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b1e526dd5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

required = meta.pluginDependencies,
soft = meta.pluginSoftDependencies,
),
file = jarFile?.let { buildFileData(it) },
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard plugin file hashing errors per entry

The file = jarFile?.let { buildFileData(it) } path lets any IOException/SecurityException from hashing propagate out of getInstalledPlugins(), so one unreadable or missing plugin JAR causes the entire /api/v1/commons/server/plugins response to fail with 500. This endpoint used to be resilient to filesystem issues because it only read in-memory metadata, so the new behavior is a regression; handle hash failures per plugin (e.g., runCatching { ... }.getOrNull()) and still return the rest of the list.

Useful? React with 👍 / 👎.

Comment on lines +46 to +47
sha1 = computeHash(file, "SHA-1"),
sha256 = computeHash(file, "SHA-256"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid re-reading each JAR twice per request

This computes SHA-1 and SHA-256 in separate passes for every plugin on every request, which means synchronous disk reads proportional to total plugin size each time the endpoint is called. In practice, periodic polling can noticeably degrade API latency and server throughput; compute both digests in one stream pass and/or cache by file path+mtime so repeated requests do not rescan all plugin binaries.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Preview of MineAuth

📦 Preview JARs (Release Page)

Artifact Download
Core MineAuth-core-69ee3fa.jar
API MineAuth-api-69ee3fa.jar
Addon: Betonquest MineAuth-addon-betonquest-69ee3fa.jar
Addon: Griefprevention MineAuth-addon-griefprevention-69ee3fa.jar
Addon: Pure Tickets MineAuth-addon-pure-tickets-69ee3fa.jar
Addon: Quickshop Hikari MineAuth-addon-quickshop-hikari-69ee3fa.jar
Addon: Vault MineAuth-addon-vault-69ee3fa.jar
Addon: Voting Plugin MineAuth-addon-voting-plugin-69ee3fa.jar

📜 Attestation: gh attestation verify <jar-file> --owner morinoparty

📖 Documentation & Reports

Available for 7 days (until 2026-04-07)

Resource Link
📖 Documentation Preview
📖 Dokka API Preview
🧪 JUnit Report Report
🔍 Detekt Report Report

🧪 Test Summary

Tests Passed Skipped Failed
74 74 ✅ 0 ⏭️ 0 ❌

- Protect /plugins endpoint with service account JWT authentication
- Guard file hashing errors per plugin to prevent single failure from
  breaking the entire response (Codex P1)
- Compute SHA-1 and SHA-256 in a single stream pass to avoid reading
  each JAR twice per request (Codex P2)
- Add serviceToken security scheme to OpenAPI spec
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Preview of MineAuth

📦 Preview JARs (Release Page)

Artifact Download
Core MineAuth-core-a72191b.jar
API MineAuth-api-a72191b.jar
Addon: Betonquest MineAuth-addon-betonquest-a72191b.jar
Addon: Griefprevention MineAuth-addon-griefprevention-a72191b.jar
Addon: Pure Tickets MineAuth-addon-pure-tickets-a72191b.jar
Addon: Quickshop Hikari MineAuth-addon-quickshop-hikari-a72191b.jar
Addon: Vault MineAuth-addon-vault-a72191b.jar
Addon: Voting Plugin MineAuth-addon-voting-plugin-a72191b.jar

📜 Attestation: gh attestation verify <jar-file> --owner morinoparty

📖 Documentation & Reports

Available for 7 days (until 2026-04-07)

Resource Link
📖 Documentation Preview
📖 Dokka API Preview
🧪 JUnit Report Report
🔍 Detekt Report Report

🧪 Test Summary

Tests Passed Skipped Failed
74 74 ✅ 0 ⏭️ 0 ❌

@Nlkomaru Nlkomaru merged commit 7c98b4f into master Mar 31, 2026
9 checks passed
@Nlkomaru Nlkomaru deleted the feat/rich-plugin-info-endpoint branch March 31, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant