Add API endpoints to get one service account

What does this MR do and why?

Add API endpoints to get one service account

The service accounts API can create, update, and delete a service account. It can also give a list of service accounts. But it cannot get one service account by its ID.

The route GET /users/:id can get one service account, because a service account is a user. Service Accounts have an email that can be administered. To see the email on /users you need an administer token, which isn't available.

The two new endpoints use the read_service_account permission. A list operation and a get operation use the same read permission. Each endpoint uses the helper in its file to find the service account. Therefore the error responses agree with the responses of the PATCH route and the DELETE route.

Changelog: added

References

Issue: #616437 (closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

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.

Edited by Jimmy Spagnola

Merge request reports

Loading
Loading