← ClaudeAtlas

route-testerlisted

Test authenticated routes in the your project using cookie-based authentication. Use this skill when testing API endpoints, validating route functionality, or debugging authentication issues. Includes patterns for using test-auth-route.js and mock authentication.
aiskillstore/marketplace · ★ 329 · API & Backend · score 79
Install: claude install-skill aiskillstore/marketplace
# your project Route Tester Skill ## Purpose This skill provides patterns for testing authenticated routes in the your project using cookie-based JWT authentication. ## When to Use This Skill - Testing new API endpoints - Validating route functionality after changes - Debugging authentication issues - Testing POST/PUT/DELETE operations - Verifying request/response data ## your project Authentication Overview The your project uses: - **Keycloak** for SSO (realm: yourRealm) - **Cookie-based JWT** tokens (not Bearer headers) - **Cookie name**: `refresh_token` - **JWT signing**: Using secret from `config.ini` ## Testing Methods ### Method 1: test-auth-route.js (RECOMMENDED) The `test-auth-route.js` script handles all authentication complexity automatically. **Location**: `/root/git/your project_pre/scripts/test-auth-route.js` #### Basic GET Request ```bash node scripts/test-auth-route.js http://localhost:3000/blog-api/api/endpoint ``` #### POST Request with JSON Data ```bash node scripts/test-auth-route.js \ http://localhost:3000/blog-api/777/submit \ POST \ '{"responses":{"4577":"13295"},"submissionID":5,"stepInstanceId":"11"}' ``` #### What the Script Does 1. Gets a refresh token from Keycloak - Username: `testuser` - Password: `testpassword` 2. Signs the token with JWT secret from `config.ini` 3. Creates cookie header: `refresh_token=<signed-token>` 4. Makes the authenticated request 5. Shows the exact curl command to reproduce manually #### Sc