feat(EM-40): Implement JWT-Based Authentication with Token Management#52
Open
devin-ai-integration[bot] wants to merge 2 commits intofeat/microservices-migration-v2from
Open
Conversation
- Create libs/ftgo-jwt/ module for JWT token utilities - Implement JwtTokenProvider with token generation, validation, and parsing - Implement JwtTokenRefreshService with configurable refresh threshold - Add JwtAuthenticationFilter for Spring Security filter chain integration - Add JwtAutoConfiguration with Spring Boot auto-configuration - Add JwtProperties with configurable secret, expiration, issuer, header, prefix - Add JJWT dependencies (0.12.5) to gradle/libs.versions.toml version catalog - Add comprehensive unit tests for all JWT operations Co-Authored-By: Alex Baker <alexandercommander453@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…in JJWT 0.12.x Co-Authored-By: Alex Baker <alexandercommander453@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(EM-40): Add libs/ftgo-jwt module with JWT token management
Summary
Adds a new
libs/ftgo-jwt/shared library module providing JWT token generation, validation, parsing, refresh, and a Spring Security authentication filter. Builds on theftgo-securityfoundation from EM-39.Key components:
JwtTokenProvider— token generation with custom claims, validation (expired/malformed/invalid-signature), parsingJwtTokenRefreshService— refresh tokens within a configurable threshold window, preserving custom claimsJwtAuthenticationFilter—OncePerRequestFilterthat extracts Bearer tokens and setsSecurityContextauthenticationJwtAutoConfiguration— Spring Boot auto-config gated onftgo.jwt.secretpropertyJwtProperties— configurable secret, expiration, refresh threshold, issuer, header, prefixgradle/libs.versions.toml(version, libraries, bundle)Updates since last revision
.claims(claims)to be called before.subject()/.issuer()/.issuedAt()/.expiration()inJwtTokenProvider.generateToken(). This ensures registered claims always take precedence and are never silently overwritten by a custom claims map in JJWT 0.12.x.Review & Testing Checklist for Human
settings.gradle(per task constraints), so CI will skip the build with a warning. You must manually verify compilation and all tests pass by either addingftgo-jwttosettings.gradletemporarily or building standalone with Gradle 7+.JwtAuthenticationFilteris created as a bean but never added to theSecurityFilterChainviahttp.addFilterBefore(...). Consumers must manually wire it. Confirm this is the intended integration pattern or if auto-registration should be added.getBytes(UTF_8)without Base64 decoding. Clarify expected format or add Base64 decoding.getRoles():@SuppressWarnings("unchecked")cast fromObjecttoList<String>. If JSON deserialization produces non-String elements, this could throwClassCastExceptionat runtime.Test Plan
ftgo-jwtto rootsettings.gradle(or build standalone with Gradle 7+)./gradlew :libs:ftgo-jwt:test— verify all 5 test classes passftgo-jwtdependency, configureftgo.jwt.secret, generate/validate tokensJwtAuthenticationFiltercorrectly setsSecurityContextwhen valid Bearer token is presentNotes
ftgo-security(build.gradle, auto-config, properties)ci-libs.ymlnot updated withftgo-jwtjob (out of scope per task constraints)compileJava) passes — version catalog changes do not break the existing buildLink to Devin run: https://app.devin.ai/sessions/0e3e6b3db2db423d89cf2902f736f9e7
Requested by: @abj453demo