Skip to content

Allows email to be updated for service accounts

What does this MR do and why?

This MR updates the PATCH /groups/:group_id/service_accounts/:id API to allow editing the email address and return the unconfirmed_email attribute when email confirmation is required. When email confirmation can be skipped, it directly updates the email attribute and returns it.

It also adds a new PATCH /service_accounts/:id to allow instance-level service accounts to be updated. This endpoint also allows the service account user's name, username and email to be updated. Editing the email address updates the unconfirmed_email attribute when email confirmation is required and returns it. When email confirmation can be skipped, it directly updates the email attribute and returns it.

References

NA

Screenshots or screen recordings

NA

How to set up and validate locally

  1. Invoke the PATCH http://gdk.test:3000/api/v4/groups/:group_id/service_accounts/:user_id endpoint from Postman or curl and pass the email attribute in the body.
  2. Verify that the response contains the unconfirmed_email attribute with the email that you passed in the request.
  3. Invoke the GET http://gdk.test:3000/api/v4/groups/:group_id/service_accounts endpoint and confirm that the unconfirmed_email attribute is returned.
  4. Navigate to http://gdk.test:3000/rails/letter_opener/ and click on the Confirm your account link in the confirmation email.
  5. Invoke the GET http://gdk.test:3000/api/v4/groups/:group_id/service_accounts endpoint again and confirm that the email attribute is set to the value you provided in the request and the unconfirmed_email attribute is not returned.
  6. Repeat the steps above with the PATCH http://gdk.test:3000/api/v4/service_accounts/:user_id and GET http://gdk.test:3000/api/v4/service_accounts endpoints.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #550983 (closed)

Edited by Shilpa Kundapur

Merge request reports

Loading