リリース: 2026/07/25 stg → main - #322
Merged
Merged
Conversation
クライアント側のバリデーションが空白のみの文字列を許容してしまう ケースがあり、presenceバリデーションの前提を満たすようサーバー側でも trimするよう防御的に修正。
Team#nameと同様の理由。空白のみの文字列がpresence/uniquenessの バリデーションをすり抜けないようサーバー側でtrimする。
同一game_result_idで2件目のmatch_resultを作成できないことを 明示的に検証するテストが無かったため追加。
CustomConfirmationsControllerに実装されていたオープンリダイレクト対策 (ホスト検証・クエリパラメータ付与)を、パスワードリセット機能でも 同じロジックが必要になるためRedirectUrlWhitelistableとして切り出した。 挙動は変更していない(既存specは無修正のまま通過)。
devise_token_auth標準のPasswordsControllerには以下の問題があった: - redirect_urlのホスト検証が無くオープンリダイレクトが可能 - Rails 7のクロスホストリダイレクト制限でfrontへのリダイレクトが失敗しうる - ResourceFinder#providerが'email'固定のため、Google/Appleアカウントの メールアドレスへのリセット要求が「存在しないメール」と同じ404になり、 メール/パスワードアカウントとの応答差からアカウント存在・認証方式が 外部から推測できてしまう CustomPasswordsControllerでredirect_urlのホワイトリスト検証・ allow_other_host許可・404を握りつぶし一律成功レスポンスを返す対応を行い、 routes.rbでpasswordsコントローラーを差し替えた。
gemデフォルトの英語テンプレートのままで、confirmation_instructions.html.erb と異なりredirect_urlをリンクに引き回していなかった。confirmation版と 同じパターンでmessage['redirect-url']をedit_password_urlに渡すよう修正。 日本語文言は既存のconfig/locales/devise.views.ja.ymlに定義済みのものを使用。
Google/Appleアカウント検証用にuserファクトリへtraitを追加し、 passwords_specに以下のケースを追加: - 存在しないメール/Google/Appleアカウントが同一の成功レスポンスを返す - redirect_url省略時にエラーではなくデフォルトURLへフォールバックする - 許可されていないredirect_urlホストがメール本文に含まれない - GET /password/edit(メールリンク)のリダイレクト先検証
This reverts commit 9c9b182.
This reverts commit 4d36269.
Test: MatchResultのgame_result_id一意制約に対するテストを追加
PRレビュー指摘対応。実害は無いが将来の保守性のためparamsをquery_paramsに改名。
PRレビュー指摘対応。not_to have_http_status(:redirect)という緩い検証 だったのを、実際のステータス(500、gem標準のrender_edit_errorが RoutingErrorをrescueせず送出する挙動)を明示的に断言するよう変更。 将来意図せず200やredirectに変化した場合に検知できるようにする。
…-back Add: パスワードリセット機能のホスト検証・アカウント列挙対策付きバックエンド実装
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.
リリース内容
stg ブランチの変更を main ブランチにマージするためのPRです。
含まれる変更 (11件)
このPRは GitHub Actions によって自動生成されました。