dead policies: VerificationFormPolicy and Identity::DocumentPolicy have zero callers

オープン 初心者向け
#375 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rails, ruby
領域
authorization

調査の方向性

app/policies/verification_form_policy.rb と app/policies/identity/document_policy.rb を読み、次にリポジトリ内で各 policy への参照を検索し、検証フローのコントローラーと BreakGlassRecordPolicy を確認してください。呼び出し元がないことを確認したら両方のファイルを削除してください。どちらの policy ファイルも残っておらず、既存の break-glass アクセス経路に変更がなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

problem

same pattern as the ExposurePolicy we already removed:

VerificationFormPolicy (`app/policies/verification_form_policy.rb`)

  • defines `new?`, `create?`, `show?`, `update?` (all just `user.present?`)
  • zero callers. no `VerificationForm` model exists. verification flow controllers don't use Pundit at all.
  • risk: misleads someone into wiring `authorize :verification_form`

Identity::DocumentPolicy (`app/policies/identity/document_policy.rb`)

  • defines `index?`, `show?`, `verify?`, `approve?`, `reject?` (all `user_is_manual_document_verifier?`)
  • zero callers. no documents controller exists. break-glass document access uses `BreakGlassRecordPolicy`.
  • risk: if a documents controller is added and someone does `authorize @document`, they'd get this policy which misses the break-glass audit trail.

fix

delete both files.

主要言語
Ruby
スター
85
フォーク
72
平均マージ
3日 12時間
マージ済み PR(30日)
22

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hackclub/auth のほかの issue

hackclub/auth の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。