Web API for all admin settings with per-tab API key permissions
Description
The Web API covers everything an administrator can manage today. Each admin configuration tab gets its own set of key permissions:
|
Admin tab |
Key permissions |
|---|---|
|
Summary |
GET |
|
View Links (shares) |
GET, LIST, CREATE, UPDATE, DELETE, BULK UPDATE |
|
Activity |
LIST |
|
Space Configuration (project configs) |
GET, LIST, CREATE, UPDATE, DELETE |
|
Board Card Settings |
GET, LIST, CREATE, UPDATE, DELETE |
|
Work Item Layout Settings |
GET, LIST, CREATE, UPDATE, DELETE, plus work item type mapping |
|
Global Settings |
GET, UPDATE |
|
API Keys |
GET, LIST, CREATE, UPDATE, DELETE |
|
Outbound Webhooks |
GET, LIST, CREATE, UPDATE, DELETE |
|
SSO Configuration |
GET, LIST, CREATE, UPDATE, DELETE |
|
Work Item Creation Forms |
GET, LIST, CREATE, UPDATE, DELETE, plus failure list (LIST) |
|
Local / QA |
none, dev only |
-
Replace the toggles in
Privilege(GET, LIST, CREATE, UPDATE, DELETE, which only apply to shares) with tab and operation permissions from the table. Needs a Liquibase changeset. A migration moves existing keys over: their current toggles become the matching View Links permissions. Creating a key offers an "all permissions" option. -
The API key form shows admin tabs as rows and operations as columns, with a checkbox in each cell and a "select all" button. A tab only shows the operations it supports.
-
Every call made with a key writes the tab and operation it used to the key usage log, in a separate column. Today the log only stores a JSON dump of the request.
-
Manual narrowing is the default. The key view lists the permissions used in the 7 days after the key was created, and a "Narrow to used" button removes the rest.
-
If the key was not used at all in that week, it is not narrowed and the view shows a warning.
-
The view warns that a permission used less often than once a week, for example by a monthly job, will be removed.
-
-
A scheduled job checks keys 7 days after they were created. For a key that was not narrowed, the job sends a notification suggesting it. If auto-narrowing is turned on for the key, the job narrows it with the rules from point 4. Recipient and channel of the notification are still open.
-
Endpoints for each tab:
-
View Links: move the existing
/webapi/shareendpoints to the new permissions and add bulk update. -
Summary and Activity: read only.
-
Space Configuration: full CRUD for project configs (
GlobalConfig) and the default config. -
Global Settings: GET and UPDATE for every section of the tab.
-
SSO Configuration: SAML configurations and domains.
-
Board Card Settings and Work Item Layout Settings, including the work item type mapping.
-
Outbound Webhooks.
-
Work Item Creation Forms, including the failure list.
-
API Keys: a key can only create or edit keys with permissions it has itself.
-
Every endpoint follows these rules:
-
The host is taken from the key, never from the request.
-
Secrets such as the SMTP password and SAML keys are write-only. GET responses do not return them.
-
Activity shows changes made with a key as "API key: <name>".
The endpoints are thin controllers under /webapi/v1/... that call the same services as the existing /api/** controllers. Key authentication is not added to /api/**, because its DTOs change together with the admin UI.