Add only allowlist for connectors and requests - #15
Merged
Conversation
Adds an `only` config block mirroring the existing `ignore` structure. When either list is non-empty, a request is recorded only if its connector class or request class is listed. The ignore list is applied afterwards and always takes precedence, so a whole connector can be allowed while individual requests on it are still ignored. Empty lists keep the current record-everything behaviour. Also tidies shouldRecord() by extracting the checks into named private methods (resolveClasses, passesOnlyList, passesIgnoreList). Closes #8
This was referenced Jul 17, 2026
craigpotter
added a commit
that referenced
this pull request
Jul 17, 2026
# Overview of change Documentation follow-up from #13/#15: the README previously documented queue support and the newer features but almost none of the config options. This PR: - Groups all configuration docs under a single **Configuration** section with subsections: enabling & disabling, choosing what gets recorded (`only`/`ignore`), keeping only failed responses, redacting sensitive request headers, excluding response bodies, response body limits, database connection, pruning, and queue support - Adds a short **Requirements** section (PHP 8.3+, Laravel 12+, Saloon v4) - Documents the placeholder values users see in the `barstools` table (`REDACTED`, `<Streamed Body>`, `<Multipart Body>`, `<Unsupported Barstool Response Content>`) and when each appears - Links the pruning setup from Installation instead of duplicating it there - Minor copy fixes, keeping the existing tone One non-README change: the `enabled` config comment mentioned a UI that doesn't exist, so that mention is removed. # Testing Docs only (plus a config comment) — full suite still green locally (31 passed, 154 assertions), Pint clean.
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.
Overview of change
Adds an allowlist so users with many connectors/requests can record just a subset instead of maintaining an ever-growing ignore list:
Semantics
onlylists are empty (the default), everything is recorded — fully backward compatible, no config or migration changes needed for existing installs.ignore).ignorelist is applied afterwards and always takes precedence, so you can allow a whole connector and still ignore individual noisy requests on it.All three recording hooks (request, response, fatal) flow through
shouldRecord(), so filtering behaves consistently everywhere.Tidy-up
shouldRecord()was getting busy, so the checks are now extracted into named private methods —resolveClasses(),passesOnlyList(),passesIgnoreList()— keeping the method a short, readable conjunction. No public API changes.Related
Closes #8
Testing
Six new Pest tests: only-connectors filtering, only-requests filtering, OR semantics across the two lists, ignore-beats-only (including the allow-connector/ignore-one-request case), conflict resolution when a class is in both lists, and the empty-lists backward-compatibility guard.
composer test(31 passed, 154 assertions),composer analyse(PHPStan level 8, clean),composer format(clean).