{"id":23404788,"url":"https://github.com/spacecodee/springboot-security-open-template","last_synced_at":"2025-07-23T09:34:23.806Z","repository":{"id":259581262,"uuid":"878264781","full_name":"spacecodee/springboot-security-open-template","owner":"spacecodee","description":"This repository is a Spring Boot template for implementing JWT-based authentication and role-based access control. It includes secure user management, developer and admin protections, token security features, and integrated API documentation using Swagger and OpenAPI.","archived":false,"fork":false,"pushed_at":"2025-03-11T17:45:07.000Z","size":911,"stargazers_count":37,"open_issues_count":0,"forks_count":13,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T21:28:48.877Z","etag":null,"topics":["devcontainer","docker","docs","gradle","java","postgresql","springboot","swagger"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spacecodee.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-25T04:21:17.000Z","updated_at":"2025-04-09T21:25:40.000Z","dependencies_parsed_at":"2024-10-26T17:57:16.616Z","dependency_job_id":"3eb614ec-7030-4705-b038-25f2183fea6b","html_url":"https://github.com/spacecodee/springboot-security-open-template","commit_stats":null,"previous_names":["spacecodee/springboot-security-open-template"],"tags_count":2,"template":true,"template_full_name":null,"purl":"pkg:github/spacecodee/springboot-security-open-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacecodee%2Fspringboot-security-open-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacecodee%2Fspringboot-security-open-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacecodee%2Fspringboot-security-open-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacecodee%2Fspringboot-security-open-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spacecodee","download_url":"https://codeload.github.com/spacecodee/springboot-security-open-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacecodee%2Fspringboot-security-open-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266655356,"owners_count":23963553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devcontainer","docker","docs","gradle","java","postgresql","springboot","swagger"],"created_at":"2024-12-22T13:15:45.204Z","updated_at":"2025-07-23T09:34:23.543Z","avatar_url":"https://github.com/spacecodee.png","language":"Java","readme":"# 🔐 Spring Security JWT Template — Spring Boot 3.3.5\n\n## 📋 Prerequisites\n\n- ☕ Java 23\n- 🐘 PostgreSQL\n- 💻 IDE: IntelliJ IDEA, Eclipse, etc.\n\n## ⚙️ Configuration\n\nCopy and update the `application-local.properties.example` in resources folder, it should be named `application-local.properties`\n\nCopy and update the `.env.example` file in the .devcontainer folder of the application, it should be named `.env`\n\n📚 Documentation\n----------------\n\n- 📖 Swagger UI available at:`/api/v1/swagger-ui/index.html`\n- 🔍 OpenAPI docs at:`/api/v1/v3/api-docs`\n\n🛡️ Security Features\n---------------------\n\n**Authentication \u0026 Authorization**\n\n- ✅ JWT-based authentication\n- ✅ Role-based access control (RBAC)\n- ✅ Permission-based access control\n- ✅ Secure password handling\n- ✅ Token invalidation on user updates\n- ✅ Locale-based responses (en/es)\n- ✅ Cache-based permission management\n- ✅ Dynamic path pattern matching\n\n**Developer Protection**\n\n- ✅ Cannot delete last remaining developer\n- ✅ Automatic token invalidation before deletion\n- ✅ Username uniqueness validation\n- ✅ Safe update operations\n- ✅ Path-based permission control\n- ✅ Status change validation\n\n**Admin Protection**\n\n- ✅ Cannot delete last remaining admin\n- ✅ Automatic token invalidation before deletion\n- ✅ Username uniqueness validation\n- ✅ Safe update operations\n- ✅ Enhanced path security\n\n**Customer Management**\n\n- ✅ Full CRUD operations\n- ✅ Role-based access control\n- ✅ Username uniqueness validation\n- ✅ Safe update operations\n- ✅ Status management\n\n**Business Rules**\n\n*User Management:*\n\n- System maintains at least one active user per role\n- Validates unique usernames across all user types\n- Auto-logout (token invalidation) on profile updates\n- Internationalization support (i18n)\n- Permission caching with Guava\n- Dynamic path pattern matching for endpoints\n\n*Token Security:*\n\n- Automatic invalidation on sensitive data changes\n- Proper cleanup during user deletion\n- Expiration handling\n- Refresh token support\n- JWT validation and cleanup\n- Role-only JWT payload\n- Cached permissions management\n\n*Path Security:*\n\n- Dynamic path pattern matching\n- Support for numeric IDs in paths\n- Boolean status handling\n- Nested resource protection\n- Base path standardization\n- API version prefix handling\n\n*API Documentation:*\n\n- Swagger UI integration\n- OpenAPI 3.0 specification\n- Interactive API testing\n- Endpoint authorization information\n- Permission requirements documentation\n\n*Performance Improvements:*\n\n- Guava cache implementation\n- Optimized path matching\n- Efficient permission checking\n- Pattern-based URL matching\n\n*Useful links:*\n\n- To convert any text into Markdown format: [Markdown Converter](https://euangoddard.github.io/clipboard2markdown/)\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\nThis project is licensed under the Apache License 2.0—see the [LICENSE](LICENSE) file for details.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacecodee%2Fspringboot-security-open-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspacecodee%2Fspringboot-security-open-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacecodee%2Fspringboot-security-open-template/lists"}