Include user first and last names and correct email responses - #1930
Open
krowvin wants to merge 2 commits into
Open
Include user first and last names and correct email responses#1930krowvin wants to merge 2 commits into
krowvin wants to merge 2 commits into
Conversation
Signed-off-by: Charles Graham, SWT <charles.r.graham@usace.army.mil>
krowvin
marked this pull request as ready for review
September 8, 2026 17:08
Signed-off-by: Charles Graham, SWT <charles.r.graham@usace.army.mil>
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.
User responses now include
first-nameandlast-namewhen available. The/userslist also returns the user's email address instead of incorrectly copying the principal ID intoemail.This applies to
GET /users,GET /users/{user-name}, andGET /user/profile. Existing identifiers and roles are preserved. Missing contact values are omitted, and older JSON without names remains readable.JSON comparison
One user entry from
GET /users, with the paging wrapper omitted. All identity and contact values below are synthetic.Before:
{ "user-name": "TEST_USER", "principal": "test-contact-principal", "email": "test-contact-principal", "roles": { "HQ": ["CWMS Users"] } }After:
{ "user-name": "TEST_USER", "principal": "test-contact-principal", "first-name": "Alex", "last-name": "Example", "email": "alex.example@example.com", "roles": { "HQ": ["CWMS Users"] } }Individual-user and profile responses already returned the stored email correctly; they gain the two name fields. The new names come from the existing user profile, without interpreting the username or principal as a person's name.
Validation
gradlew buildon Java 11 passed, including the Java tests, live OpenAPI export, documentation, and generated TypeScript client build. The CDA unit suite reported 774 tests, zero failures, and 40 skipped.JSON tests cover contact-field round trips, omitted missing values, and reading the old response format.
gradlew :cwms-data-api:integrationTests --tests '*UserManagementTestIT'on Java 11 passed all 15 tests against a locally started CDA instance. Coverage includes populated and missing contact fields in the list, individual-user, and profile responses, lookup by username and principal, existing pagination, and authorization checks.AI tools used