Skip to content

Jwt を 7.0.2 にアップデート#4315

Merged
ryuring merged 3 commits intobaserproject:5.2.xfrom
ryuring:feature/upgrade-php-jwt
Feb 23, 2026
Merged

Jwt を 7.0.2 にアップデート#4315
ryuring merged 3 commits intobaserproject:5.2.xfrom
ryuring:feature/upgrade-php-jwt

Conversation

@ryuring
Copy link
Collaborator

@ryuring ryuring commented Feb 19, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 19, 2026 22:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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);

@ryuring ryuring merged commit 821f6d7 into baserproject:5.2.x Feb 23, 2026
1 check passed
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.

2 participants