Skip to content
Back to search

developer-kit

Modular plugin marketplace for Claude Code and agentic CLIs, with validated, spec-driven skills, agents, commands, and workflows for Java, TypeScript, Python, PHP, AWS, and AI.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/giuseppe-trisciuoglio--developer-kit/badge.svg)](/listings/giuseppe-trisciuoglio--developer-kit)

HTML

<a href="/listings/giuseppe-trisciuoglio--developer-kit"><img src="/api/listings/giuseppe-trisciuoglio--developer-kit/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Quick Install (Recommended)

Claude Code

# Install from marketplace
/plugin marketplace add giuseppe-trisciuoglio/developer-kit

# Or install from local directory
/plugin install /path/to/developer-kit

Claude Desktop

[Enable Skills in Settings](https://claude.ai/settings/capabilities) → Add `giuseppe-trisciuoglio/developer-kit`

Manual Installation

# Clone the repository
git clone https://github.com/giuseppe-trisciuoglio/developer-kit.git

# Install via Makefile (auto-detects your CLI)
cd developer-kit
make install

# Or install for specific CLI
make install-claude      # Claude Code
make install-opencode    # OpenCode CLI
make install-copilot     # GitHub Copilot CLI
make install-codex       # Codex CLI

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 77 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "developer-kit",
  3. "version": "4.0.1",
  4. "description": "Modular marketplace for developer kit plugins",
  5. "owner": {
  6. "name": "Giuseppe Trisciuoglio",
  7. "email": "giuseppe.trisciuoglio@gmail.com"
  8. },
  9. "plugins": [
  10. {
  11. "name": "developer-kit",
  12. "description": "Core agents and commands required by all plugins",
  13. "source": "./plugins/developer-kit-core",
  14. "version": "4.0.1"
  15. },
  16. {
  17. "name": "developer-kit-ai",
  18. "description": "AI/ML skills including prompt engineering, RAG, and chunking strategies",
  19. "source": "./plugins/developer-kit-ai",
  20. "version": "4.0.1"
  21. },
  22. {
  23. "name": "developer-kit-java",
  24. "description": "Comprehensive Java development toolkit with Spring Boot, testing, and AWS integration",
  25. "source": "./plugins/developer-kit-java",
  26. "version": "4.0.1"
  27. },
  28. {
  29. "name": "developer-kit-aws",
  30. "description": "AWS infrastructure and CloudFormation expertise",
  31. "source": "./plugins/developer-kit-aws",
  32. "version": "4.0.1"
  33. },
  34. {
  35. "name": "developer-kit-typescript",
  36. "description": "TypeScript/JavaScript full-stack development with NestJS, React, and React Native",
  37. "source": "./plugins/developer-kit-typescript",
  38. "version": "4.0.1"
  39. },
  40. {
  41. "name": "developer-kit-php",
  42. "description": "PHP and WordPress development capabilities",
  43. "source": "./plugins/developer-kit-php",
  44. "version": "4.0.1"
  45. },
  46. {
  47. "name": "developer-kit-python",
  48. "description": "Python development capabilities",
  49. "source": "./plugins/developer-kit-python",
  50. "version": "4.0.1"
  51. },
  52. {
  53. "name": "developer-kit-devops",
  54. "description": "DevOps and containerization expertise",
  55. "source": "./plugins/developer-kit-devops",
  56. "version": "4.0.1"
  57. },
  58. {
  59. "name": "developer-kit-project-management",
  60. "description": "Project management and workflow commands",
  61. "source": "./plugins/developer-kit-project-management",
  62. "version": "4.0.1"
  63. },
  64. {
  65. "name": "github-spec-kit",
  66. "description": "GitHub specification integration and verification",
  67. "source": "./plugins/github-spec-kit",
  68. "version": "4.0.1"
  69. },
  70. {
  71. "name": "developer-kit-tools",
  72. "description": "External tools integration skills for CLI utilities, APIs, and third-party services",
  73. "source": "./plugins/developer-kit-tools",
  74. "version": "4.0.1"
  75. }
  76. ]
  77. }
README.md · README · 316 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. [![License](https://img.shields.io/github/license/giuseppe-trisciuoglio/developer-kit.svg)](./LICENSE)
  3. [![Security Scan](https://github.com/giuseppe-trisciuoglio/developer-kit/actions/workflows/security-scan.yml/badge.svg)](https://github.com/giuseppe-trisciuoglio/developer-kit/actions/workflows/security-scan.yml)
  4. [![Plugin Validation](https://github.com/giuseppe-trisciuoglio/developer-kit/actions/workflows/plugin-validation.yml/badge.svg)](https://github.com/giuseppe-trisciuoglio/developer-kit/actions/workflows/plugin-validation.yml)
  5. [![Skills](https://img.shields.io/badge/skills-150%2B-blue.svg)](./plugins)
  6. [![Agents](https://img.shields.io/badge/agents-45%2B-purple.svg)](./plugins)
  7. **🌐 Languages:** [English](README.md) | [Italiano](./README_IT.md) | [中文](./README_CN.md) | [Español](./README_ES.md)
  8. ![](https://repository-images.githubusercontent.com/1080332870/5124e0d2-98f8-4486-9659-dde59a5ad251)
  9. **A modular AI plugin system that supercharges your development workflow across languages and frameworks.**
  10. [Installation](#installation) • [Quick Start](#quick-start) • [Plugins](#available-plugins) • [Documentation](https://github.com/giuseppe-trisciuoglio/developer-kit/blob/main/README.md) • [Changelog](./CHANGELOG.md)
  11. </div>
  12. ---
  13. ## Why Developer Kit?
  14. Developer Kit is a **modular plugin marketplace** for Claude Code that teaches Claude how to perform development tasks in a repeatable, high-quality way. Instead of generic AI responses, you get domain-specific expertise for your exact tech stack.
  15. - **🧩 Modular by Design** — Install only what you need. Java developer? Grab `developer-kit-java`. Full-stack TypeScript? Add `developer-kit-typescript`.
  16. - **🎯 Domain Experts** — 45+ specialized agents for code review, refactoring, security audits, architecture design, and testing across 7+ languages.
  17. - **📚 150+ Skills** — Reusable capabilities from Spring Boot CRUD generation to CloudFormation templates, all with best practices built-in.
  18. - **🔄 Multi-CLI Support** — Works with Claude Code, GitHub Copilot CLI, OpenCode CLI, and Codex CLI.
  19. - **⚡ Auto-Activation** — Path-scoped rules automatically activate when you open relevant files. No configuration needed.
  20. ---
  21. ## Installation
  22. ### Quick Install (Recommended)
  23. #### Claude Code
  24. ```bash
  25. # Install from marketplace
  26. /plugin marketplace add giuseppe-trisciuoglio/developer-kit
  27. # Or install from local directory
  28. /plugin install /path/to/developer-kit
  29. ```
  30. #### Claude Desktop
  31. [Enable Skills in Settings](https://claude.ai/settings/capabilities) → Add `giuseppe-trisciuoglio/developer-kit`
  32. #### Manual Installation
  33. ```bash
  34. # Clone the repository
  35. git clone https://github.com/giuseppe-trisciuoglio/developer-kit.git
  36. # Install via Makefile (auto-detects your CLI)
  37. cd developer-kit
  38. make install
  39. # Or install for specific CLI
  40. make install-claude # Claude Code
  41. make install-opencode # OpenCode CLI
  42. make install-copilot # GitHub Copilot CLI
  43. make install-codex # Codex CLI
  44. ```
  45. ---
  46. ## Quick Start
  47. ```bash
  48. # After installation, start your CLI
  49. claude
  50. # Check available commands
  51. /help
  52. # Use a Developer Kit command
  53. /devkit.refactor
  54. ```
  55. ### Example Prompts
  56. ```
  57. Generate a complete CRUD module for User entity with NestJS and Drizzle ORM
  58. Review this Java Spring Boot service for security issues
  59. Create a CloudFormation template for ECS with auto-scaling
  60. Help me refactor this monolithic class into clean architecture
  61. Generate unit tests for this TypeScript service with 100% coverage
  62. ```
  63. ---
  64. ## Usage
  65. Developer Kit provides **four layers** of capabilities:
  66. ### 1. Skills
  67. Reusable capabilities loaded on-demand. Example:
  68. ```
  69. [Skill: spring-boot-crud-patterns activated]
  70. ```
  71. Skills automatically provide patterns, templates, and best practices for specific tasks.
  72. ### 2. Agents
  73. Specialized sub-agents for complex workflows:
  74. ```bash
  75. # Invoke via natural language
  76. "Review this code as a Spring Boot expert"
  77. # Or use commands
  78. /devkit.java.code-review
  79. /devkit.typescript.code-review
  80. ```
  81. ### 3. Rules
  82. Path-scoped rules auto-activate based on file patterns:
  83. ```yaml
  84. # Auto-activates for *.java files
  85. globs: ["**/*.java"]
  86. ---
  87. Always use constructor injection. Never use field injection with @Autowired.
  88. ```
  89. > **📋 Note on Rules Installation**
  90. >
  91. > Plugins do not automatically install rules into your project. To use the rules, you can copy them manually
  92. > or use the Makefile command:
  93. >
  94. > ```bash
  95. > # Copy rules from a specific plugin
  96. > make copy-rules PLUGIN=developer-kit-java
  97. >
  98. > # Or manually copy .md files from the plugin's rules/ folder
  99. > mkdir -p .claude/rules
  100. > cp plugins/developer-kit-[language]/rules/*.md .claude/rules/
  101. > ```
  102. >
  103. > The rules will be automatically activated based on the `globs:` patterns defined in the header of each file.
  104. ---
  105. ## Available Plugins
  106. | Plugin | Language/Domain | Components | Description |
  107. |--------|-----------------|------------|-------------|
  108. | `developer-kit-core` | Core | 6 Agents, 8 Commands, 4 Skills | Required base plugin with general-purpose capabilities |
  109. | `developer-kit-java` | Java | 9 Agents, 11 Commands, 51 Skills, 4 Rules | Spring Boot, LangChain4J, AWS SDK, GraalVM |
  110. | `developer-kit-typescript` | TypeScript | 13 Agents, 3 Commands, 25 Skills, 17 Rules | NestJS, React, Next.js, Drizzle ORM, Monorepo |
  111. | `developer-kit-python` | Python | 4 Agents, 4 Rules | Django, Flask, FastAPI, AWS Lambda |
  112. | `developer-kit-php` | PHP | 5 Agents, 3 Skills, 4 Rules | WordPress, Sage, AWS Lambda |
  113. | `developer-kit-aws` | AWS | 3 Agents, 19 Skills | CloudFormation, SAM, CLI, Architecture |
  114. | `developer-kit-ai` | AI/ML | 1 Agent, 3 Skills, 1 Command | Prompt Engineering, RAG, Chunking |
  115. | `developer-kit-devops` | DevOps | 2 Agents | Docker, GitHub Actions |
  116. | `developer-kit-tools` | Tools | 4 Skills | NotebookLM, Copilot CLI, Gemini, Codex |
  117. | `github-spec-kit` | GitHub | 3 Commands | GitHub spec integration |
  118. **Total: 150+ Skills | 45+ Agents | 20+ Commands | 45+ Rules**
  119. ---
  120. ## Plugin Architecture
  121. ```
  122. developer-kit/
  123. ├── plugins/
  124. │ ├── developer-kit-core/ # Required base
  125. │ │ ├── agents/ # Agent definitions (.md)
  126. │ │ ├── commands/ # Slash commands (.md)
  127. │ │ ├── skills/ # Reusable skills (SKILL.md)
  128. │ │ ├── rules/ # Auto-activated rules
  129. │ │ └── .claude-plugin/
  130. │ │ └── plugin.json # Plugin manifest
  131. │ ├── developer-kit-java/ # Java ecosystem
  132. │ ├── developer-kit-typescript/ # TypeScript ecosystem
  133. │ └── ...
  134. ├── .skills-validator-check/ # Validation system
  135. └── Makefile # Installation commands
  136. ```
  137. Each plugin is self-contained with its own manifest, components, and dependencies.
  138. ---
  139. ## Configuration
  140. ### Plugin Selection
  141. Install only the plugins you need:
  142. ```bash
  143. # Core + Java + AWS
  144. make install-claude
  145. # Then enable: developer-kit-core, developer-kit-java, developer-kit-aws
  146. # Full-stack TypeScript
  147. # Enable: developer-kit-core, developer-kit-typescript, developer-kit-aws
  148. ```
  149. ### Rules Auto-Activation
  150. Rules automatically activate based on file patterns:
  151. ```yaml
  152. ---
  153. globs: ["**/*.java"]
  154. ---
  155. # This rule activates for all Java files
  156. - Use constructor injection
  157. - Follow naming conventions
  158. ```
  159. ### LSP Integration
  160. Language plugins include LSP server configurations (`.lsp.json`):
  161. | Language | Server |
  162. |----------|--------|
  163. | Java | jdtls |
  164. | TypeScript | typescript-language-server |
  165. | Python | pyright-langserver |
  166. | PHP | intelephense |
  167. ---
  168. ## Language Support Matrix
  169. | Language | Skills | Agents | Commands | Rules | LSP |
  170. |----------|--------|--------|----------|-------|-----|
  171. | Java/Spring Boot | 51 | 9 | 11 | 4 | ✅ |
  172. | TypeScript/Node.js | 25 | 13 | 3 | 17 | ✅ |
  173. | Python | 2 | 4 | 0 | 4 | ✅ |
  174. | PHP/WordPress | 3 | 5 | 0 | 4 | ✅ |
  175. | AWS/CloudFormation | 19 | 3 | 0 | 0 | ❌ |
  176. | AI/ML | 3 | 1 | 1 | 0 | ❌ |
  177. ---
  178. ## Validation & Quality
  179. Developer Kit includes a comprehensive validation system:
  180. ```bash
  181. # Validate all components
  182. python .skills-validator-check/validators/cli.py --all
  183. # Security scan (MCP compliance)
  184. make security-scan
  185. # Pre-commit hooks
  186. .skills-validator-check/install-hooks.sh
  187. ```
  188. ---
  189. ## Ecosystem
  190. **Listed on:**
  191. - [context7](https://context7.com/giuseppe-trisciuoglio/developer-kit?tab=skills) — Skills marketplace
  192. - [skills.sh](https://skills.sh/giuseppe-trisciuoglio/developer-kit) — AI skills directory
  193. **Related Projects:**
  194. - [Claude Code](https://claude.ai/code) — AI-powered terminal from Anthropic
  195. - [OpenCode](https://github.com/opencode-ai/opencode) — Open-source AI coding assistant
  196. - [GitHub Copilot CLI](https://github.com/github/copilot.vim) — AI pair programming
  197. - [Codex CLI](https://github.com/openai/codex) — OpenAI's coding agent
  198. ---
  199. ## Contributing
  200. We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for:
  201. - Adding new skills, agents, and commands
  202. - Plugin development guidelines
  203. - Validation requirements
  204. - Branch strategy and versioning
  205. ## Security
  206. Skills can execute code. Review all custom skills before deploying:
  207. - ✅ Only install from trusted sources
  208. - ✅ Review SKILL.md before enabling
  209. - ✅ Test in non-production environments first
  210. - ✅ Run `make security-scan` before releases
  211. Security scans run automatically via GitHub Actions on every PR.
  212. ---
  213. ## License
  214. [MIT License](./LICENSE) — Open source and free to use.
  215. ---
  216. ## Acknowledgments
  217. - **Claude Code** by Anthropic — The foundation this plugin system extends
  218. - **Qwen Code** — README design inspiration
  219. - **Contributors** — Thank you to everyone who has contributed skills and plugins
  220. ---
  221. <div align="center">
  222. **Made with ❤️ for Developers using Claude Code**
  223. Also compatible with OpenCode, GitHub Copilot CLI, and Codex
  224. </div>
plugins/developer-kit-java/skills/spring-boot-security-jwt/scripts/test-jwt-setup.sh · Bundled script · 289 lines · 1 finding marked
  1. #!/bin/bash
  2. # Spring Security JWT Testing Script
  3. # This script sets up a test environment and validates JWT implementation
  4. set -e
  5. # Colors for output
  6. RED='\033[0;31m'
  7. GREEN='\033[0;32m'
  8. YELLOW='\033[1;33m'
  9. NC='\033[0m' # No Color
  10. # Configuration
  11. BASE_URL=${BASE_URL:-http://localhost:8080}
  12. TEST_EMAIL=${TEST_EMAIL:-test@example.com}
  13. TEST_PASSWORD=${TEST_PASSWORD:-TestPassword123!}
  14. echo -e "${GREEN}=== Spring Security JWT Test Suite ===${NC}"
  15. echo
  16. # Function to print colored output
  17. print_status() {
  18. if [ $1 -eq 0 ]; then
  19. echo -e "${GREEN}✅ $2${NC}"
  20. else
  21. echo -e "${RED}❌ $2${NC}"
  22. fi
  23. }
  24. print_warning() {
  25. echo -e "${YELLOW}⚠️ $1${NC}"
  26. }
  27. print_info() {
  28. echo -e "${GREEN}ℹ️ $1${NC}"
  29. }
  30. # Function to check if service is running
  31. check_service() {
  32. curl -s -f "$BASE_URL/actuator/health" > /dev/null 2>&1
  33. }
  34. # Function to create test user
  35. create_test_user() {
  36. echo "Creating test user..."
  37. response=$(curl -s -w "%{http_code}" -o /tmp/user_response.json \
  38. -X POST "$BASE_URL/api/register" \
  39. -H "Content-Type: application/json" \
  40. -d "{
  41. \"email\": \"$TEST_EMAIL\",
  42. \"password\": \"$TEST_PASSWORD\",
  43. \"firstName\": \"Test\",
  44. \"lastName\": \"User\"
  45. }")
  46. http_code=${response: -3}
  47. if [ "$http_code" = "201" ]; then
  48. print_status 0 "Test user created successfully"
  49. return 0
  50. elif [ "$http_code" = "409" ]; then
  51. print_status 0 "Test user already exists"
  52. return 0
  53. else
  54. print_status 1 "Failed to create test user (HTTP $http_code)"
  55. cat /tmp/user_response.json
  56. return 1
  57. fi
  58. }
  59. # Function to authenticate and get JWT
  60. authenticate() {
  61. echo "Authenticating user..."
  62. response=$(curl -s -w "%{http_code}" -o /tmp/auth_response.json \
  63. -X POST "$BASE_URL/api/auth/login" \
  64. -H "Content-Type: application/json" \
  65. -d "{
  66. \"email\": \"$TEST_EMAIL\",
  67. \"password\": \"$TEST_PASSWORD\"
  68. }")
  69. http_code=${response: -3}
  70. if [ "$http_code" = "200" ]; then
  71. ACCESS_TOKEN=$(jq -r '.accessToken' /tmp/auth_response.json)
  72. REFRESH_TOKEN=$(jq -r '.refreshToken' /tmp/auth_response.json)
  73. print_status 0 "Authentication successful"
  74. print_info "Access token: ${ACCESS_TOKEN:0:20}..."
  75. return 0
  76. else
  77. print_status 1 "Authentication failed (HTTP $http_code)"
  78. cat /tmp/auth_response.json
  79. return 1
  80. fi
  81. }
  82. # Function to test protected endpoint
  83. test_protected_endpoint() {
  84. local endpoint=$1
  85. local expected_status=$2
  86. local description=$3
  87. if [ -z "$ACCESS_TOKEN" ]; then
  88. print_status 1 "No access token available"
  89. return 1
  90. fi
  91. response=$(curl -s -w "%{http_code}" -o /tmp/endpoint_response.json \
  92. -H "Authorization: Bearer $ACCESS_TOKEN" \
  93. "$BASE_URL$endpoint")
  94. http_code=${response: -3}
  95. if [ "$http_code" = "$expected_status" ]; then
  96. print_status 0 "$description"
  97. return 0
  98. else
  99. print_status 1 "$description (Expected $expected_status, got $http_code)"
  100. cat /tmp/endpoint_response.json
  101. return 1
  102. fi
  103. }
  104. # Function to test JWT validation
  105. test_jwt_validation() {
  106. echo "Testing JWT validation..."
  107. # Test valid token
  108. test_protected_endpoint "/api/users/me" 200 "Valid JWT access"
  109. # Test expired token
  110. expired_token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiZXhwIjoxNjE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
    • Dismissed after review: Contains a long base64-looking blob — not necessarily malicious, but worth inspecting what it decodes to
    • Line 133 on GitHub
  111. response=$(curl -s -w "%{http_code}" -o /tmp/expired_response.json \
  112. -H "Authorization: Bearer $expired_token" \
  113. "$BASE_URL/api/users/me")
  114. if [ "${response: -3}" = "401" ]; then
  115. print_status 0 "Expired token rejected"
  116. else
  117. print_status 1 "Expired token accepted"
  118. fi
  119. # Test invalid token
  120. invalid_token="invalid.token.format"
  121. response=$(curl -s -w "%{http_code}" -o /tmp/invalid_response.json \
  122. -H "Authorization: Bearer $invalid_token" \
  123. "$BASE_URL/api/users/me")
  124. if [ "${response: -3}" = "401" ]; then
  125. print_status 0 "Invalid token rejected"
  126. else
  127. print_status 1 "Invalid token accepted"
  128. fi
  129. # Test no token
  130. response=$(curl -s -w "%{http_code}" -o /tmp/no_token_response.json \
  131. "$BASE_URL/api/users/me")
  132. if [ "${response: -3}" = "401" ]; then
  133. print_status 0 "No token rejected"
  134. else
  135. print_status 1 "No token accepted"
  136. fi
  137. }
  138. # Function to test refresh token
  139. test_refresh_token() {
  140. echo "Testing refresh token..."
  141. if [ -z "$REFRESH_TOKEN" ]; then
  142. print_status 1 "No refresh token available"
  143. return 1
  144. fi
  145. # Use refresh token to get new access token
  146. response=$(curl -s -w "%{http_code}" -o /tmp/refresh_response.json \
  147. -X POST "$BASE_URL/api/auth/refresh" \
  148. -H "Content-Type: application/json" \
  149. -d "{\"refreshToken\": \"$REFRESH_TOKEN\"}")
  150. http_code=${response: -3}
  151. if [ "$http_code" = "200" ]; then
  152. NEW_ACCESS_TOKEN=$(jq -r '.accessToken' /tmp/refresh_response.json)
  153. print_status 0 "Refresh token successful"
  154. print_info "New access token: ${NEW_ACCESS_TOKEN:0:20}..."
  155. # Test new token
  156. response=$(curl -s -w "%{http_code}" -o /tmp/new_token_test.json \
  157. -H "Authorization: Bearer $NEW_ACCESS_TOKEN" \
  158. "$BASE_URL/api/users/me")
  159. if [ "${response: -3}" = "200" ]; then
  160. print_status 0 "New access token works"
  161. else
  162. print_status 1 "New access token failed"
  163. fi
  164. else
  165. print_status 1 "Refresh token failed (HTTP $http_code)"
  166. cat /tmp/refresh_response.json
  167. fi
  168. }
  169. # Function to test logout
  170. test_logout() {
  171. echo "Testing logout..."
  172. if [ -z "$ACCESS_TOKEN" ]; then
  173. print_status 1 "No access token available"
  174. return 1
  175. fi
  176. # Logout
  177. response=$(curl -s -w "%{http_code}" -o /tmp/logout_response.json \
  178. -X POST "$BASE_URL/api/auth/logout" \
  179. -H "Authorization: Bearer $ACCESS_TOKEN")
  180. http_code=${response: -3}
  181. if [ "$http_code" = "200" ]; then
  182. print_status 0 "Logout successful"
  183. # Test token is no longer valid
  184. response=$(curl -s -w "%{http_code}" -o /tmp/post_logout.json \
  185. -H "Authorization: Bearer $ACCESS_TOKEN" \
  186. "$BASE_URL/api/users/me")
  187. if [ "${response: -3}" = "401" ]; then
  188. print_status 0 "Token invalidated after logout"
  189. else
  190. print_status 1 "Token still valid after logout"
  191. fi
  192. else
  193. print_status 1 "Logout failed (HTTP $http_code)"
  194. cat /tmp/logout_response.json
  195. fi
  196. }
  197. # Main test execution
  198. main() {
  199. echo "Starting JWT security tests..."
  200. echo "Base URL: $BASE_URL"
  201. echo "Test Email: $TEST_EMAIL"
  202. echo
  203. # Check if service is running
  204. if ! check_service; then
  205. print_status 1 "Service is not running at $BASE_URL"
  206. print_info "Please start the application before running tests"
  207. exit 1
  208. fi
  209. print_status 0 "Service is running"
  210. # Run tests
  211. echo
  212. echo "=== Setup Phase ==="
  213. create_test_user
  214. authenticate
  215. echo
  216. echo "=== Authentication Tests ==="
  217. test_jwt_validation
  218. test_refresh_token
  219. test_logout
  220. echo
  221. echo "=== Test Summary ==="
  222. echo "All tests completed. Review the output above for any issues."
  223. echo
  224. echo "For detailed debugging:"
  225. echo "1. Check application logs: tail -f logs/application.log"
  226. echo "2. Use debug endpoint: curl -H \"X-Auth-Debug: true\" $BASE_URL/api/users/me"
  227. echo "3. Verify JWT content at: https://jwt.io/"
  228. }
  229. # Cleanup function
  230. cleanup() {
  231. rm -f /tmp/*.json
  232. }
  233. # Set up cleanup
  234. trap cleanup EXIT
  235. # Run main function
  236. main "$@"

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.