basercms
basercms copied to clipboard
【システム】JWT認証ファイルをコマンドで生成できるようにする
baserCMS version : 5
- 構築済みの環境を再現する際に使用できると便利なため
- InstallationsService->createJwtをコマンドで呼び出すようにしたらいい?
- https://github.com/baserproject/basercms/blob/5.1.x/plugins/bc-installer/src/Service/InstallationsService.php#L514
InstallationsService->createJwtをコマンドで呼び出すようにしたらいい?
BcInstaller は、インストールが完了すると無効化されるので、ちょっと考えないといけないですね。
@ryuring
bin/cake create jwt
ありがとうございます。確かに先に bin/cake setup install を実行しないと使えないですね。
InstallationsService->createJwtを https://github.com/baserproject/basercms/blob/5.1.x/plugins/bc-installer/src/Service/InstallationsService.php#L517 BcApiUtilに移動して、baser-coreのコマンドにするのはどうでしょう。 https://github.com/baserproject/basercms/blob/5.1.x/plugins/baser-core/src/Utility/BcApiUtil.php
一応以下のコマンドで作成できるはできるので、そこまで強い要望ではないです。
openssl genrsa -out config/jwt.key 1024
openssl rsa -in config/jwt.key -outform PEM -pubout -out config/jwt.pem
BcApiUtilに移動して、baser-coreのコマンドにするのはどうでしょう。
こちらが良さそうですね。 @seto1