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

Admin shall be able to change email adress of users #633

Closed
de-jcup opened this issue May 20, 2021 · 1 comment · Fixed by #1029
Closed

Admin shall be able to change email adress of users #633

de-jcup opened this issue May 20, 2021 · 1 comment · Fixed by #1029
Assignees
Milestone

Comments

@de-jcup
Copy link
Member

de-jcup commented May 20, 2021

Situation

Currently it is not possible to change the email address of an user - neither as administrator nor as user itself.

In this issue the admin shall get the possiblity to change an email address of an user

Usecase

As an administrator I want to change the email address of an user (even for himself)

Details

  • The change is done directly (no interaction with user necessary)
  • The user will be informed:
    • old email adress:
    A SecHub administrator has changed your email address and it will not be used any longer for SecHub.
    
    In case you do not receive a follow up notification to the new email address, please inform your SecHub administrator !
    
    • new email adress:
    A SecHub administrator has changed your email address from $oldlAddress to $newAddress. 
    Your old email address is not used in SecHub any longer.
    

TODO

  • audit logging
  • introduce REST API
  • introduce new event USER_EMAIL_ADDRESS_CHANGED with property initiatedBy and value admin
    ( so we can reuse the event later, for follow up use cases - e.g. users shall be able to change email address by themselves )
  • document usecase
  • provide action in DAUI
  • implement notification handling for USER_EMAIL_ADDRESS_CHANGED event as described in details before
@de-jcup de-jcup added this to the Server 0.29.0 milestone Jan 20, 2022
@de-jcup de-jcup self-assigned this Feb 18, 2022
de-jcup added a commit that referenced this issue Feb 18, 2022
- 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
de-jcup added a commit that referenced this issue Feb 18, 2022
- 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
de-jcup added a commit that referenced this issue Feb 18, 2022
- 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
de-jcup added a commit that referenced this issue Feb 18, 2022
de-jcup added a commit that referenced this issue Feb 18, 2022
- applied source formatting by spotless
- fixed failing unit test
- added missing SPDX header related to #633
de-jcup added a commit that referenced this issue Feb 18, 2022
- added simple DAUI action to change email address for user
- added missing method in `DeveloperAdministration` class
- added new action inside `CommandUI`
@de-jcup
Copy link
Member Author

de-jcup commented Feb 18, 2022

This issue and its PR #1029 are 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

de-jcup added a commit that referenced this issue Feb 21, 2022
- fixed typo in emum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant