Class: Leakferret::Client
- Inherits:
-
Object
- Object
- Leakferret::Client
- Defined in:
- lib/leakferret/client.rb
Overview
Instance Method Summary collapse
-
#rewrite(path, apply: false, backend: 'env', **opts) ⇒ Array<Hash>
Run scan + classify + rewrite proposal.
-
#scan(path, exclude: [], only: nil, show_fixtures: false) ⇒ Array<Hash>
Run a scan-only pass (regex pre-filter, offline).
-
#verify(path, mode: 'best-effort', timeout: 10, **opts) ⇒ Array<Hash>
Run scan + classify + provider verification.
Instance Method Details
#rewrite(path, apply: false, backend: 'env', **opts) ⇒ Array<Hash>
Run scan + classify + rewrite proposal.
48 49 50 51 52 |
# File 'lib/leakferret/client.rb', line 48 def rewrite(path, apply: false, backend: 'env', **opts) args = ['rewrite', path, '--format', 'json', '--backend', backend] args << '--apply' if apply run(args + format_flags(**opts)) end |
#scan(path, exclude: [], only: nil, show_fixtures: false) ⇒ Array<Hash>
Run a scan-only pass (regex pre-filter, offline).
20 21 22 |
# File 'lib/leakferret/client.rb', line 20 def scan(path, exclude: [], only: nil, show_fixtures: false) run(['scan', path, '--format', 'json'] + format_flags(exclude:, only:, show_fixtures:)) end |
#verify(path, mode: 'best-effort', timeout: 10, **opts) ⇒ Array<Hash>
Run scan + classify + provider verification.
34 35 36 37 |
# File 'lib/leakferret/client.rb', line 34 def verify(path, mode: 'best-effort', timeout: 10, **opts) run(['verify', path, '--format', 'json', '--verify-mode', mode, '--verifier-timeout-secs', timeout.to_s] + format_flags(**opts)) end |