Skip to main content

auth-claim-audit

Offline static auditing of documentation promises about credentials and accounts. Version 0.1.0; Python 3.9 or later; no runtime dependencies. Audited code is never executed, no network is accessed, and .env files are never opened.

Install and run:

python3 -m pip install .
auth-claim-audit ./project
auth-claim-audit ./project --json
auth-claim-audit ./project --fail-on HIGH --verbose
auth-claim-audit ./project --ignore documented-no-key-claim-false
python3 -m auth_claim_audit --version

The path defaults to the current directory. Exit status is 0 for PASS, 2 for findings meeting the threshold, and 1 for usage/input errors. --fail-on accepts HIGH or MEDIUM (default MEDIUM). --ignore takes comma-separated rule names; ignored findings are dropped. --verbose adds verified claims to human output. --json emits findings, verified_claims, and summary, including status and counts. --version prints 0.1.0. Human findings show severity, rule, relative file and line, quoted claim, and a single matched source line of evidence.

Root README.md and docs/**/*.md are checked case-insensitively. Backtick and tilde fenced blocks are excluded; inline code counts as prose. No-key claims cover “no API key”, required/needed variants, “works without an API key”, credentials/credential, authentication and auth variants. Lines saying “not enough”, “not sufficient”, or “insufficient” are excluded. No-account claims cover account/login/sign-up/signup required/needed and works-without variants. Key-required claims cover “requires [an] API key”, “API key is required”, “you need an API key”, “you'll need an API key”, and “an API key is needed”.

Rule Severity Evidence
documented-no-key-claim-false HIGH Required credential or Authorization/Bearer use
documented-no-account-claim-false HIGH Login import or getpass call
documented-key-required-unused MEDIUM No production credential evidence
documented-no-key-claim-test-only MEDIUM Required credential evidence only in tests/fixtures
documented-no-account-claim-test-only MEDIUM Login evidence only in tests/fixtures

Python ASTs provide evidence. Environment reads through os.getenv, os.environ.get and os.environ subscripts recognize credential names containing API_KEY, APIKEY, TOKEN, SECRET, PASSWORD, PASSWD, ACCESS_KEY, AUTH_TOKEN, or CLIENT_SECRET, case-insensitively. A following letter prevents a token match: MYTOKEN counts; TOKENIZER_URL does not. Subscript access is strong evidence. An assigned read with an assertion or a falsy/None guard that raises, exits or returns a nonzero error code is also strong evidence. Python has no or raise syntax; an or sys.exit(...) guard is recognized. Authorization dictionary keys and Bearer literals in dictionaries/request calls also count as strong evidence.

Login evidence Recognized forms
Imports oauthlib, authlib, requests_oauthlib, google_auth_oauthlib, google.auth, msal, oauth and submodules
Prompt getpass.getpass calls, including imported aliases

Required API keys alone never falsify account claims. Any credential read, Authorization/Bearer evidence or login evidence satisfies the reverse rule. Production excludes tests/, fixtures/, docs/, test_*.py and *_test.py. Test and fixture evidence is reported separately; docs Python is excluded. Symlink files/directories are skipped, as are invalid Python files. No claims pass; with no Python source each claim receives its corresponding finding. Ignored findings are not described as verified claims.

Limitations

This is static pattern matching, not semantic judgement. Bare optional reads, including reads with defaults, do not falsify a no-key claim. Authorization literals may belong to optional features and cause false positives; use --ignore when appropriate. The login evidence table is deliberately small. Dynamic credential names, constructed strings and config-file keys are missed. Import alias tracking is per-file; data flow between files is not followed. Evidence contains one matching code line, so audit human output with the same care as source code. The scanner never opens .env files.

Neighbours

privacy-claim-audit checks network/telemetry presence rather than credential requirements. config-claim-audit checks default values rather than whether a credential is required. readme-claim-audit checks install instructions, flags, links and versions rather than authentication. Bandit and Ruff check code issues rather than documentation promises. dotenv-linter checks .env syntax rather than documentation versus code requirement truth.

Development

PYTHONPATH=src python3 -m unittest discover -s tests -v
python3 -m build

The good fixture passes with optional credential use. The bad root has exactly two HIGH findings. Audit bad/unused separately for the MEDIUM reverse finding:

auth-claim-audit tests/fixtures/good
auth-claim-audit tests/fixtures/bad
auth-claim-audit tests/fixtures/bad/unused

Together those bad projects produce the three specified rule findings. A single project cannot simultaneously have strong production credential evidence and zero production credential evidence, so the reverse case has its own root. The marker-only bad/.env fixture is protected by a test that rejects attempts to open any .env, in addition to checking output for the marker.

MIT licensed.

Metadata

Release files for auth-claim-audit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for auth-claim-audit 0.1.0
File Size Uploaded Provenance Actions
auth_claim_audit-0.1.0.tar.gz 13.7 kB Without provenance Details for auth_claim_audit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for auth-claim-audit 0.1.0
File Interpreter ABI Platform Actions
auth_claim_audit-0.1.0-py3-none-any.whl Python 3 none any Details for auth_claim_audit-0.1.0-py3-none-any.whl

Total release size: 22.7 kB

Release files / auth_claim_audit-0.1.0.tar.gz

Download URL auth_claim_audit-0.1.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7afad2e81bd7399e31bef7c3856d2e68862d248ab9de888c3782fe8441c4f345
BLAKE2b-256 checksum
How to use checksums
b6143efed9d2804aae1ef83a79c5998bb1fc57fc7ede9ccadab6fb4c3440781d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / auth_claim_audit-0.1.0-py3-none-any.whl

Download URL auth_claim_audit-0.1.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ba32d7a1b36d2cb5e123f2a4bdb4257b7ce6d272804ba8f26a05fc58c04de05
BLAKE2b-256 checksum
How to use checksums
dd40bb19c86f82cef3f029ac5e7b2642f08de9e37ce80d7cbbf8ec1b47462f5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for auth-claim-audit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page