mastodontech.de ist einer von vielen unabhängigen Mastodon-Servern, mit dem du dich im Fediverse beteiligen kannst.
Offen für alle (über 16) und bereitgestellt von Markus'Blog

Serverstatistik:

1,4 Tsd.
aktive Profile

#jwt_auth

0 Beiträge0 Beteiligte0 Beiträge heute
Mariusz<p>Day 7<br>✅ 24 test suites, 153 tests passing.</p><p>Solid coverage across service and controller layers in my modular monorepo. Strict typing (TypeScript), full DTO validation, and realistic mocks across complex relations (TypeORM).</p><p>Next: fine-tuning error handling &amp; exploring e2e strategies.</p><p><a href="https://write.as/bmariusz/24-test-suites-153-tests-passing-scaling-confidence-with-every-assertion" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">write.as/bmariusz/24-test-suit</span><span class="invisible">es-153-tests-passing-scaling-confidence-with-every-assertion</span></a></p><p><a href="https://techhub.social/tags/TypeScript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TypeScript</span></a> <a href="https://techhub.social/tags/NestJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>NestJS</span></a> <a href="https://techhub.social/tags/Nextjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Nextjs</span></a> <a href="https://techhub.social/tags/InsuranceTech" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>InsuranceTech</span></a> <a href="https://techhub.social/tags/Microservices" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Microservices</span></a> <a href="https://techhub.social/tags/monorepo" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>monorepo</span></a> <a href="https://techhub.social/tags/rbac" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rbac</span></a> <a href="https://techhub.social/tags/codingdays" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>codingdays</span></a> <a href="https://techhub.social/tags/swagger" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swagger</span></a> <a href="https://techhub.social/tags/jwt" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>jwt</span></a> <a href="https://techhub.social/tags/jwt_auth" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>jwt_auth</span></a> <a href="https://techhub.social/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a></p>
Mariusz<p>Day 6<br>TL;DR: Groups, memberships, hierarchy — all dynamic now.</p><p>Released backend v0.3.0 🎉</p><p>✅ Users can belong to multiple groups with typed roles <br>✅ Groups can form hierarchical or overlapping structures <br>✅ Roles are normalized via reference types</p><p>Built with NestJS + TypeORM. Documented via Swagger.</p><p><a href="https://write.as/bmariusz/building-a-flexible-group-structure-with-nestjs-and-typeorm" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">write.as/bmariusz/building-a-f</span><span class="invisible">lexible-group-structure-with-nestjs-and-typeorm</span></a></p><p><a href="https://techhub.social/tags/TypeScript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TypeScript</span></a> <a href="https://techhub.social/tags/NestJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>NestJS</span></a> <a href="https://techhub.social/tags/Nextjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Nextjs</span></a> <a href="https://techhub.social/tags/InsuranceTech" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>InsuranceTech</span></a> <a href="https://techhub.social/tags/Microservices" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Microservices</span></a> <a href="https://techhub.social/tags/monorepo" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>monorepo</span></a> <a href="https://techhub.social/tags/rbac" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rbac</span></a> <a href="https://techhub.social/tags/codingdays" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>codingdays</span></a> <a href="https://techhub.social/tags/swagger" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swagger</span></a> <a href="https://techhub.social/tags/jwt" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>jwt</span></a> <a href="https://techhub.social/tags/jwt_auth" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>jwt_auth</span></a> <a href="https://techhub.social/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a></p>
Mariusz<p>Day 5<br>TL;DR: Continued work on backend security — role-based access is now fully wired up.</p><p>✅ Got fine-grained role-based access control fully working today.</p><p>• Roles loaded from PostgreSQL <br>• Injected into JWT during login <br>• Validated via custom `@Roles()` + `RolesGuard` <br>• Authenticated via `@UseGuards(JwtAuthGuard)` globally <br>• Introduced `@Public()` decorator to bypass guards for public endpoints <br>• Swagger supports Bearer token for testing </p><p>Took a while to get the role propagation into the token right — the key was enriching the `validateUser()` result, not just fetching data from DB.</p><p>Modular, clean, and no magic. Feels good. 👌</p><p>more on: <a href="https://write.as/bmariusz/continuation-securing-routes-with-jwt-and-role-based-access-control" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">write.as/bmariusz/continuation</span><span class="invisible">-securing-routes-with-jwt-and-role-based-access-control</span></a><br><a href="https://techhub.social/tags/CloudNative" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CloudNative</span></a> <a href="https://techhub.social/tags/TypeScript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TypeScript</span></a> <a href="https://techhub.social/tags/NestJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>NestJS</span></a> <a href="https://techhub.social/tags/Nextjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Nextjs</span></a> <a href="https://techhub.social/tags/InsuranceTech" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>InsuranceTech</span></a> <a href="https://techhub.social/tags/Microservices" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Microservices</span></a> <a href="https://techhub.social/tags/monorepo" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>monorepo</span></a> <br><a href="https://techhub.social/tags/codingdays" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>codingdays</span></a> <a href="https://techhub.social/tags/swagger" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swagger</span></a> <a href="https://techhub.social/tags/jwt" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>jwt</span></a> <a href="https://techhub.social/tags/jwt_auth" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>jwt_auth</span></a> <a href="https://techhub.social/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a></p>
Mariusz<p>Day 4</p><p>TL;DR: Full Swagger docs + JWT auth with registration and login are live.</p><p>Today’s work focused on two key improvements.</p><p>1. Swagger documentation was extended across all API layers. DTOs, entities, and controllers were enriched with `@ApiTags`, `@ApiOperation`, `@ApiResponse`, and detailed `@ApiBody` annotations — including real-life examples for request bodies.</p><p>2. JWT-based authentication was implemented. A secure registration flow was added, with password hashing via bcrypt. A login endpoint now issues access tokens containing user ID, email, and roles. All logic is encapsulated using Passport strategies (local and JWT). The next step will be protecting routes with guards and role-based access.</p><p><a href="https://techhub.social/tags/CloudNative" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CloudNative</span></a> <a href="https://techhub.social/tags/TypeScript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TypeScript</span></a> <a href="https://techhub.social/tags/NestJS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>NestJS</span></a> <a href="https://techhub.social/tags/Nextjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Nextjs</span></a> <a href="https://techhub.social/tags/InsuranceTech" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>InsuranceTech</span></a> <a href="https://techhub.social/tags/Microservices" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Microservices</span></a> <a href="https://techhub.social/tags/monorepo" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>monorepo</span></a> <br><a href="https://techhub.social/tags/codingdays" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>codingdays</span></a> <a href="https://techhub.social/tags/swagger" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swagger</span></a> <a href="https://techhub.social/tags/jwt" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>jwt</span></a> <a href="https://techhub.social/tags/jwt_auth" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>jwt_auth</span></a> <a href="https://techhub.social/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a></p>