Class: Reeve::Testing::Checks::RedactionHolds
- Defined in:
- lib/reeve/testing/checks/redaction_holds.rb
Overview
FR-011: a value declared sensitive appears in no ledger entry.
Proved rather than inspected. The check calls the tool with a unique sentinel in each declared-sensitive argument and then looks for that sentinel in every column of the row that was written — including nested structures, since the redactor recurses and so must the check.
It also catches the quieter bug: redact :ssn on a tool whose argument is
actually named customer_ssn. That declaration compiles, registers, and redacts
nothing at all, and no amount of looking at written rows would reveal it.
Reeve::Checks::RedactionHolds.new(tool: InvoiceSearchTool, principal: alice).call
Constant Summary collapse
- FILLER =
"reeve-check"
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(tool:, principal:, arguments: {}, invoke: nil, ledger: nil) ⇒ RedactionHolds
constructor
A new instance of RedactionHolds.
Methods inherited from Base
Constructor Details
#initialize(tool:, principal:, arguments: {}, invoke: nil, ledger: nil) ⇒ RedactionHolds
Returns a new instance of RedactionHolds.
23 24 25 26 |
# File 'lib/reeve/testing/checks/redaction_holds.rb', line 23 def initialize(tool:, principal:, arguments: {}, invoke: nil, ledger: nil) super(tool: tool, arguments: arguments, invoke: invoke, ledger: ledger) @principal = principal end |
Instance Method Details
#call ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/reeve/testing/checks/redaction_holds.rb', line 28 def call return ledger_unavailable("redaction") unless ledger.available? inert = declared_names - accepted_names return inert_declaration(inert.first) unless inert.empty? || accepts_anything? names = names_to_probe return nothing_declared if names.empty? probe(names) end |