test(tcc): opt-in integration test for the real TCC read#14
Merged
Conversation
…matrix) Verifies TCCAuditor against the actual on-disk TCC.db (the permission matrix's granted column) rather than fixtures. Gated behind PC_TCC_INTEGRATION=1 and requires Full Disk Access; skips otherwise, so normal swift test / CI is unaffected. Prints a summary of the grants read and asserts the mapping is sane. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Opt-in integration test for the real TCC read
The permission matrix's granted column reads the OS TCC databases via
TCCAuditor. The unit tests only approximate the schema with fixtures; thisadds an opt-in integration test that verifies the parser against the actual
on-disk
TCC.dbon a real machine.Reading
TCC.dbrequires the running process to hold Full Disk Access, sothe test is gated behind
PC_TCC_INTEGRATION=1(like the Ghidra integrationtest). Without FDA it fails with a clear "grant Full Disk Access" message;
without the env var it simply skips, so normal
swift test/ CI is unaffected.How to run
(System Settings › Privacy & Security › Full Disk Access).
PC_TCC_INTEGRATION=1 swift test --filter TCCAuditorIntegrationTestsIt prints a summary of the grants it read (scope, service, decision, mapped
category, client) so you can eyeball the parse, then asserts the mapping
produced sane grants — including that at least one maps to a known
PrivacyCategory, which would catch service-catalog drift on a newer macOS.🤖 Generated with Claude Code