Merged
Conversation
There was a problem hiding this comment.
Pull request overview
JWT 周りの依存関係更新(firebase/php-jwt v7.0.2)に合わせて、JWT 鍵の強度向上と既存環境向けの鍵再生成アップデータを追加する変更です。
Changes:
firebase/php-jwtを 6.1.0 → 7.0.2 に更新(root / baser-core 両方)- JWT 秘密鍵生成のビット長を 1024 → 2048 に変更
- 5.2.3 アップデータで JWT 鍵の再生成を実行する処理を追加
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| plugins/baser-core/src/Utility/BcApiUtil.php | JWT 鍵生成時の RSA ビット長を 2048 に引き上げ |
| plugins/baser-core/config/update/5.2.3/updater.php | 5.2.3 更新時に JWT 鍵を再生成し、結果をアップデートログへ記録 |
| plugins/baser-core/config/update/5.2.3/config.php | 5.2.3 更新メッセージ(JWT 鍵再生成の告知)を追加 |
| plugins/baser-core/composer.json | baser-core 側の firebase/php-jwt を 7.0.2 へ更新 |
| composer.json | ルートの firebase/php-jwt を 7.0.2 へ更新 |
| composer.lock | firebase/php-jwt 更新に伴うロックファイル更新 |
Comments suppressed due to low confidence (1)
plugins/baser-core/src/Utility/BcApiUtil.php:76
- BcApiUtil::createJwt() は最初の openssl コマンドで jwt.key を上書きした後、公開鍵生成(jwt.pem)が失敗すると「秘密鍵だけ新しく、公開鍵は古い/欠損」という不整合状態が残ります(JWT 署名/検証が壊れる可能性)。一時ファイルに両方生成して成功時に rename で差し替える、もしくは 2段目失敗時に生成した秘密鍵をロールバック/削除するなど、原子的に更新できるようにしてください。
$command = "openssl genrsa -out " . CONFIG . "jwt.key 2048 2>&1";
exec($command, $out, $code);
if($code === 0) {
$command = "openssl rsa -in " . CONFIG . "jwt.key -outform PEM -pubout -out " . CONFIG . "jwt.pem 2>&1";
exec($command, $out, $code);
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.
No description provided.