Add Spring Boot user-security service modernizing the CardDemo USRSEC programs - #231
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
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:
|
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.
Summary
New self-contained Spring Boot 3 / Java 17 service in
java/user-security-service/that replaces the CICS user-security module (COSGN00C,COUSR00C–COUSR03C) operating on theUSRSECVSAM file. H2 in-memory DB, seeded on startup from the in-stream records ofapp/jcl/ESDSRRDS.jcl.COSGN00CPOST /api/signon(alias/api/auth/login)admin+nextProgram(COADM01C/COMEN01C), 401 wrong password, 404 unknown IDCOUSR00CGET /api/users?page&sizesize=10, ordered by user IDCOUSR02ClookupGET /api/users/{userId}COUSR01CPOST /api/usersCOUSR02CPUT /api/users/{userId}COUSR03CDELETE /api/users/{userId}Error bodies carry the original BMS message text (
"User ID NOT found...","Wrong Password. Try again ...","User ID already exist...","First Name can NOT be empty..."), so a UI can render the same strings the 3270 screens did. Passwords are never present in any response DTO.Seed layout correction. The record is
SEC-USER-DATAfromCSUSR01Y, soSEC-USR-PWDisPIC X(08)at columns 49-56 and column 57 isSEC-USR-TYPE:Reading columns 49-57 as the password would yield a 9-character value that violates
PIC X(08)(and the repo rootREADME.mddocuments the credential asADMIN001/PASSWORD). The seeder therefore parses type from column 57, falling back to theADMINID prefix if that column is blank.Because the BMS maps handed the COBOL programs uppercase, space-padded fields,
UserServicenormalizes (trim().toUpperCase()) user IDs, passwords and user types on the way in — so{"userId":"user0001","password":"password"}signs on exactly as the terminal did.src/main/resources/static/index.htmlserves a small terminal-styled operator screen (signon / paginated list / add-update-delete) mirroring the legacy maps, used for end-to-end verification.Testing
24 tests, all green (
mvn test):UsrsecSeederTest(fixed-width parsing),UserServiceTest(signon success/failure, pagination, CRUD, not-found/duplicate),UserSecurityApiTest(MockMvc over every endpoint incl. status codes and validation messages). Also verified against a running jar with curl for all endpoints and error paths, plus a browser walkthrough of the operator screen.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/716a33e2c9d04bad86527f18bdebe8f3
Requested by: @VedantKh