Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 633 admin can change email address of user #1029

Merged
merged 7 commits into from
Feb 21, 2022

Conversation

de-jcup
Copy link
Member

@de-jcup de-jcup commented Feb 18, 2022

This PR

This PR is now mentioned as an example in our wiki:
https://github.com/mercedes-benz/sechub/wiki/FAQ#is-there-a-good-example-issue-for-new-contributors

Each commit contains detailed messages about a specific work done at the commit.
The feature (#633) itself seams to be very easy to implement (at a first glance..), but implementation handled much aspects from SecHub internals:

  • introduce a complete new usecase, together with documentation parts
  • introduce a main logic for the feature (REST controller, gets a new method, we create a new Service)
  • automated REST documentation by dedicated *RestDocTest
  • new integration tests
  • new unit tests
  • domain messaging (domain administration sends an event which is handled by notification domain)
  • notification implementation
  • extending the internal used testing framework
  • adding a simple DAUI action to have the new feature inside the developer administration UI

Details about architecture aspects are described at https://mercedes-benz.github.io/sechub/latest/sechub-architecture.html
For some specific technical details please read https://mercedes-benz.github.io/sechub/latest/sechub-techdoc.html

- Introduce new Usecase
  - annotation `UseCaseAdminUpdatesUserEmailAddress`
  - usecase identifier `UC_ADMIN_UPDATES_USER_EMAIL_ADDRESS`
  - documentation via asciidoc + annotation data
- Introduce new event/domain message
  - MessageID
  - MessageDataKey
  - enhanced UserMessage, contains now former email address (optional)
- Implemented Logic
  - introducing new service `UserEmailAddressUpdateService`
  - Role allowed: only admin
  - added unit tests for service
- Add REST access
 - introduced new method inside UserAdministrationRestController
 - Role allowed: only admin

- additional (but not related)
  - introducing TestCanaryException, so easier to check
    exception handling
- Test API changes
  - added new method inside TestURLbuilder for new rest call
  - added new test call method inside class `AsUser`
    to make it callable inside integration test
- Integration test
  - wrote test which does change as an administrator an existing
    user.
  - checks if user email address has been changed
  - checks if an email was sent to new user email address
  - checks if an email was sent to old user email address

Additional (because necessary):
- TestAPI changes
  - added test user detail information to fetch old email address
    from user for testing
  - changed AssertEmail and introduced TextSearchmode
- introduced `UserEmailAddressChangedNotificationService`
- added tests to check mail content and subjects are correct
  created

- changed integration test
  - email subject text a little bit different

Additional
- same smaller changes at update service
- MockEmailAccess improved error output, contains now text search
  mode info
- applied source formatting by spotless
- fixed failing unit test
- added missing SPDX header related to #633
- added simple DAUI action to change email address for user
- added missing method in `DeveloperAdministration` class
- added new action inside `CommandUI`
@de-jcup de-jcup marked this pull request as ready for review February 18, 2022 19:56
@de-jcup de-jcup requested a review from winzj February 18, 2022 19:56
- fixed typo in emum
@de-jcup de-jcup requested a review from winzj February 21, 2022 12:05
Copy link
Member

@winzj winzj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good to me.

@de-jcup de-jcup merged commit 6274f79 into develop Feb 21, 2022
@de-jcup de-jcup deleted the feature-633-admin-can-change-email-address-of-user branch February 21, 2022 13:08
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.

Admin shall be able to change email adress of users
2 participants