Modernize CICS user-security programs as a Spring Boot REST service - #230
Open
devin-ai-integration[bot] wants to merge 5 commits into
Open
devin-ai-integration[bot] wants to merge 5 commits into
devin-ai-integration[bot] wants to merge 5 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 module
java/user-security-service/— a Spring Boot 3.4.5 / Java 17 REST service replacing the interactive CICS user-security programs (COSGN00C,COUSR00C,COUSR01C,COUSR02C,COUSR03C) that read/write theUSRSECVSAM file. H2 in-memory persistence, seeded fromapp/jcl/ESDSRRDS.jcl, with Swagger UI at/swagger-ui.html.Mapping from COBOL to REST:
COSGN00CPOST /api/auth/signonUser ID NOT found..., bad password → 401Invalid password..., success → 200 +userTypeso the caller branches admin vs regularCOUSR00CGET /api/usersGET /api/users/{id}COUSR01CPOST /api/usersCOUSR02CPUT /api/users/{id}COUSR03CDELETE /api/users/{id}UsermirrorsSEC-USER-DATAfromapp/cpy/CSUSR01Y.cpy(id 8, firstName 20, lastName 20, password, userType).UserTypematchesCDEMO-USRTYP-ADMIN/CDEMO-USRTYP-USERinapp/cpy/COCOM01Y.cpyand is persisted as the single char via anAttributeConverter:Two deliberate deviations worth knowing:
CSUSR01YisSEC-USR-PWD PIC X(08)+SEC-USR-TYPE PIC X(01), so the JCL's trailingPASSWORDAis really passwordPASSWORD+ typeA. The requested demo credentials arePASSWORDA/PASSWORDU, so those are seeded verbatim and the column widened; the nuance is documented in the module README.15 MockMvc tests cover signon success / not-found / wrong-password, full CRUD, validation failures, duplicate IDs, and the enum serialization.
@ApiResponsesdeclare the real status codes (201/204/400/401/404/409) plus theApiErrorResponseshape so Swagger doesn't show them as "Undocumented".Demo
mvn clean package→ 15 tests green; service boots on 8080 with the 10 seeded users and Swagger UI reachable. A screen recording of the end-to-end Swagger UI flow is committed atjava/user-security-service/docs/demo.mp4and linked from the module README: admin signon (200,userType: ADMIN) → list 10 seeded users → createDEMO0001(201) → update it and flip type to ADMIN (200) → delete (204) → follow-up GET (404User ID NOT found...).Note:
mvn spring-boot:runneedsJAVA_HOMEon JDK 17 — the box's default resolution launched the Boot plugin under Java 8 (class file version 61 vs 52). Documented in the README.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/e0c9250f47fa4ce6bae1b6b060bccd23
Requested by: @VedantKh