claude-sdk-rs: Command for Claude Code

.claude/commands/test_auth_gate.md

test_auth_gate is a command for Claude Code from bredmond1019/claude-sdk-rs. It costs 0 tokens per session (914 once invoked), scanned A, original, Apache-2.0.

An end-to-end test template for checking access to protected web pages and API endpoints. It tests requests without credentials, with invalid credentials, and with valid credentials.

In plain words
What is it for?
Use it to test login-protected routes, API resources, invalid or expired tokens, and optional administrator-only resources.
Why use it?
It helps verify that private data is blocked from unauthenticated users while legitimate users can access it. It can also reveal whether authentication errors expose sensitive token or signing information.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is bredmond1019/claude-sdk-rs's own configuration. It tells Claude Code how to work on claude-sdk-rs itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-sdk-rs configures →

Reuse

Borrowing it

Nothing to install: this file belongs to bredmond1019/claude-sdk-rs. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/bredmond1019/claude-sdk-rs/main/.claude/commands/test_auth_gate.md
Clone the repo
git clone --depth 1 https://github.com/bredmond1019/claude-sdk-rs

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for test_auth_gate

README.md
[![agentmods](https://agentmods.dev/badge/commands/bredmond1019/claude-sdk-rs/test_auth_gate/github.svg)](https://agentmods.dev/commands/bredmond1019/claude-sdk-rs/test_auth_gate)
Your own site
<a href="https://agentmods.dev/commands/bredmond1019/claude-sdk-rs/test_auth_gate"><img src="https://agentmods.dev/badge/commands/bredmond1019/claude-sdk-rs/test_auth_gate/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test_auth_gate

Your own site · 80×15
<a href="https://agentmods.dev/commands/bredmond1019/claude-sdk-rs/test_auth_gate"><img src="https://agentmods.dev/badge/commands/bredmond1019/claude-sdk-rs/test_auth_gate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 914 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00914
Opus 5.5 $0.00000 $0.00366
Sonnet 5.5 $0.00000 $0.00183
Haiku 4.5 $0.00000 $0.00091

Measured 11d ago against content hash 4c38bfdfd617, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test_auth_gate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/test_auth_gate.md · 144 lines

How it starts

The opening of the file, as written. The whole thing — 144 lines — stays where its author put it; the contents beside it link to each section on GitHub.

E2E Template — Auth Gate

Test that protected routes and endpoints correctly reject unauthenticated/unauthorized requests and pass through with valid credentials. Replace all {{PLACEHOLDER}} tokens before running.


Setup

  • Login URL / endpoint: {{LOGIN_URL}} (e.g. http://localhost:8000/auth/login)
  • Protected resource: {{PROTECTED_URL}} (e.g. http://localhost:8000/api/me)
  • Valid credentials: {{TEST_USERNAME}} / {{TEST_PASSWORD}}
  • Admin-only resource (if applicable): {{ADMIN_URL}}

API Auth Gate Tests

1. Unauthenticated request — 401

GET {{PROTECTED_URL}}

(No Authorization header)

Assert:

  • Status: 401 Unauthorized.
  • Body does NOT contain protected data.

2. Invalid / expired token — 401

GET {{PROTECTED_URL}}
Authorization: Bearer invalid-token-xyz

Assert:

  • Status: 401 Unauthorized.
  • Body does NOT contain protected data.
  • Body does NOT expose token internals or signing key info.

3. Valid token — 200

POST {{LOGIN_URL}}
Content-Type: application/json

{"username": "{{TEST_USERNAME}}", "password": "{{TEST_PASSWORD}}"}

Store the returned token as VALID_TOKEN.

GET {{PROTECTED_URL}}
Authorization: Bearer {{VALID_TOKEN}}

Assert:

  • Status: 200 OK.
  • Body contains the expected protected data.

4. Insufficient role / permissions — 403

(Skip if the project has no role-based access control)

Use a token for a low-privilege user ({{LOW_PRIV_TOKEN}}):

GET {{ADMIN_URL}}
Authorization: Bearer {{LOW_PRIV_TOKEN}}

Assert:

  • Status: 403 Forbidden.
  • Body does NOT contain admin data.

UI Auth Gate Tests

5. Redirect unauthenticated browser user

  1. Clear cookies / local storage (start fresh, not logged in).
  2. Navigate directly to {{PROTECTED_URL}}.
  3. Assert:
    • Browser is redirected to {{LOGIN_URL}} (or a login page).
    • The protected content is NOT visible before redirect.

6. Access after login

Read the full file on GitHub · 144 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 144 lines · 0 tokens per session scan A 4c38bfdfd617

Subscribe to this mod's changes

test_auth_gate is a command published in the GitHub repository bredmond1019/claude-sdk-rs (23 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 914 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-26.

Related

test_auth_gate compared with commands from other repositories

test_auth_gate next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
test_auth_gatebredmond1019/claude-sdk-rsCommand231mo agoApache-2.0A0Claude Code
playwright-test-healmicrosoft/playwrightCommand99kyesterdayApache-2.0A2GitHub Copilot
webapp-testinghamr0/agentic-toolkitCommand236d agoApache-2.0A35Claude Code
verify-prdesplega-ai/qa-useCommand291mo agoMITA0Claude Code
ui-snapshot.templateevan043/claude-cli-advanced-starter-packCommand613mo agoMITA0Claude Code
test-rundesplega-ai/qa-useCommand291mo agoMITA0Claude Code
laravel-playwrightjpcaparas/superpowers-laravelCommand1574mo agoMITA20Claude Code