Skip to content

Include user first and last names and correct email responses - #1930

Open
krowvin wants to merge 2 commits into
USACE:developfrom
krowvin:feature/user-contact-fields
Open

Include user first and last names and correct email responses#1930
krowvin wants to merge 2 commits into
USACE:developfrom
krowvin:feature/user-contact-fields

Conversation

@krowvin

@krowvin krowvin commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

User responses now include first-name and last-name when available. The /users list also returns the user's email address instead of incorrectly copying the principal ID into email.

This applies to GET /users, GET /users/{user-name}, and GET /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 build on 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

Signed-off-by: Charles Graham, SWT <charles.r.graham@usace.army.mil>
@krowvin
krowvin requested a review from MikeNeilson September 8, 2026 15:54
@krowvin
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant