About Service Accounts
Every service account has a specific purpose and the necessary permissions. The most common use cases are:
- A management account that can create, update and delete other service accounts.
- A project management account that has the ability to create projects.
- A view-only account that can read reports and issue metrics These accounts are being controlled by servers without human interaction.
A service account functions like any other user account in Coverity on Polaris. It can be assigned any role (administrator or contributor) on an organization or project and can perform role-appropriate actions in Coverity on Polaris using an API.
Using PATCH versus POST to Update
When updating the roles on a service account:
- Send a
GETrequest first, to determine whether the service account has a role in the project usingGET /api/auth/v1/role-assignments. - If the account does not have a role in the project, you can create one with a
POSTrequest. - If the account already has a role, you can change it with a
PATCHrequest.
Common errors in this process include trying to create a new role with a PATCH and trying to update a role assignment with a POST. Both of these can happen if the service account already has a role in the project and you're not aware of it.
The Process for Updating a Role Assignment