feat!: capabilities replace API token scopes; every admin endpoint declares one, with a picker UI [CI]
This commit is contained in:
1 parent
55b80f0a97
commit
ddb6608e32
38 files changed
+1148
-218
No files matched your search
+254
-59
@@ -1255,7 +1255,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "release.publish"
|
||||
},
|
||||
"get": {
|
||||
"tags": [
|
||||
@@ -1294,7 +1295,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "update.read"
|
||||
}
|
||||
},
|
||||
"/api/admin/auth/logout": {
|
||||
@@ -1323,7 +1325,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "authenticated"
|
||||
}
|
||||
},
|
||||
"/api/admin/auth/me": {
|
||||
@@ -1354,7 +1357,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "authenticated"
|
||||
}
|
||||
},
|
||||
"/api/admin/agents": {
|
||||
@@ -1395,7 +1399,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.read"
|
||||
}
|
||||
},
|
||||
"/api/admin/agents/{id}": {
|
||||
@@ -1456,7 +1461,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.read"
|
||||
},
|
||||
"patch": {
|
||||
"tags": [
|
||||
@@ -1560,7 +1566,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.write"
|
||||
},
|
||||
"delete": {
|
||||
"tags": [
|
||||
@@ -1607,7 +1614,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.revoke"
|
||||
}
|
||||
},
|
||||
"/api/admin/agents/{id}/approve": {
|
||||
@@ -1678,7 +1686,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.enroll"
|
||||
}
|
||||
},
|
||||
"/api/admin/agents/{id}/disable": {
|
||||
@@ -1749,7 +1758,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.write"
|
||||
}
|
||||
},
|
||||
"/api/admin/agents/{id}/enable": {
|
||||
@@ -1820,7 +1830,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.write"
|
||||
}
|
||||
},
|
||||
"/api/admin/agents/{id}/takeover": {
|
||||
@@ -1881,7 +1892,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.enroll"
|
||||
}
|
||||
},
|
||||
"/api/admin/join-tokens": {
|
||||
@@ -1922,7 +1934,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.read"
|
||||
},
|
||||
"post": {
|
||||
"tags": [
|
||||
@@ -1981,7 +1994,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.enroll"
|
||||
}
|
||||
},
|
||||
"/api/admin/join-tokens/{id}": {
|
||||
@@ -2037,7 +2051,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.enroll"
|
||||
}
|
||||
},
|
||||
"/api/admin/probes": {
|
||||
@@ -2078,7 +2093,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.read"
|
||||
}
|
||||
},
|
||||
"/api/admin/probes/{id}": {
|
||||
@@ -2139,7 +2155,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.read"
|
||||
},
|
||||
"patch": {
|
||||
"tags": [
|
||||
@@ -2228,7 +2245,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.write"
|
||||
},
|
||||
"delete": {
|
||||
"tags": [
|
||||
@@ -2275,7 +2293,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.revoke"
|
||||
}
|
||||
},
|
||||
"/api/admin/probes/{id}/revoke": {
|
||||
@@ -2336,7 +2355,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.revoke"
|
||||
}
|
||||
},
|
||||
"/api/admin/agents/{id}/probes/{probe_id}/disconnect": {
|
||||
@@ -2413,7 +2433,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.write"
|
||||
}
|
||||
},
|
||||
"/api/admin/tasks": {
|
||||
@@ -2470,7 +2491,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "tasks.read"
|
||||
},
|
||||
"post": {
|
||||
"tags": [
|
||||
@@ -2539,7 +2561,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "tasks.write"
|
||||
}
|
||||
},
|
||||
"/api/admin/tasks/{id}": {
|
||||
@@ -2600,7 +2623,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "tasks.read"
|
||||
},
|
||||
"patch": {
|
||||
"tags": [
|
||||
@@ -2694,7 +2718,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "tasks.write"
|
||||
},
|
||||
"delete": {
|
||||
"tags": [
|
||||
@@ -2741,7 +2766,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "tasks.write"
|
||||
}
|
||||
},
|
||||
"/api/admin/lines/{line_id}/tests": {
|
||||
@@ -2832,7 +2858,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "tasks.write"
|
||||
},
|
||||
"get": {
|
||||
"tags": [
|
||||
@@ -2893,7 +2920,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "tasks.read"
|
||||
}
|
||||
},
|
||||
"/api/admin/tests/{id}/cancel": {
|
||||
@@ -2954,7 +2982,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "tasks.write"
|
||||
}
|
||||
},
|
||||
"/api/admin/raw/chunks": {
|
||||
@@ -3061,7 +3090,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "data.read"
|
||||
}
|
||||
},
|
||||
"/api/admin/raw/chunks/{chunk_id}": {
|
||||
@@ -3125,7 +3155,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "data.read"
|
||||
}
|
||||
},
|
||||
"/api/admin/events": {
|
||||
@@ -3225,7 +3256,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "events.read"
|
||||
}
|
||||
},
|
||||
"/api/admin/analysis/recompute": {
|
||||
@@ -3266,7 +3298,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "data.write"
|
||||
}
|
||||
},
|
||||
"/api/admin/api-tokens": {
|
||||
@@ -3307,13 +3340,14 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "keys.read"
|
||||
},
|
||||
"post": {
|
||||
"tags": [
|
||||
"admin-api-tokens"
|
||||
],
|
||||
"summary": "Create an API token (scope read or admin); the plaintext is returned only once",
|
||||
"summary": "Create an API token with the chosen capabilities (a subset of your own); the plaintext is returned only once",
|
||||
"operationId": "api_tokens_create",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
@@ -3366,7 +3400,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "keys.manage"
|
||||
}
|
||||
},
|
||||
"/api/admin/api-tokens/{id}": {
|
||||
@@ -3415,7 +3450,50 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "keys.manage"
|
||||
}
|
||||
},
|
||||
"/api/admin/capabilities": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"admin-api-tokens"
|
||||
],
|
||||
"summary": "The capability catalog: groups, which ones change trust, which are reserved, and the presets",
|
||||
"operationId": "capabilities_list",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/CapabilityCatalogDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"content": {
|
||||
"application/problem+json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Forbidden",
|
||||
"content": {
|
||||
"application/problem+json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "keys.read"
|
||||
}
|
||||
},
|
||||
"/api/admin/settings": {
|
||||
@@ -3456,7 +3534,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "settings.read"
|
||||
},
|
||||
"patch": {
|
||||
"tags": [
|
||||
@@ -3520,7 +3599,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "settings.write"
|
||||
}
|
||||
},
|
||||
"/api/admin/users": {
|
||||
@@ -3561,7 +3641,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "accounts.manage"
|
||||
},
|
||||
"post": {
|
||||
"tags": [
|
||||
@@ -3630,7 +3711,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "accounts.manage"
|
||||
}
|
||||
},
|
||||
"/api/admin/users/{id}": {
|
||||
@@ -3699,7 +3781,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "accounts.manage"
|
||||
}
|
||||
},
|
||||
"/api/admin/build-info": {
|
||||
@@ -3740,7 +3823,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "update.read"
|
||||
}
|
||||
},
|
||||
"/api/admin/nodes/{id}/update": {
|
||||
@@ -3799,7 +3883,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "update.confirm"
|
||||
}
|
||||
},
|
||||
"/api/admin/backend/update": {
|
||||
@@ -3840,7 +3925,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "update.read"
|
||||
},
|
||||
"post": {
|
||||
"tags": [
|
||||
@@ -3907,7 +3993,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "update.confirm"
|
||||
}
|
||||
},
|
||||
"/api/admin/backend/update/live": {
|
||||
@@ -3941,7 +4028,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "update.read"
|
||||
}
|
||||
},
|
||||
"/api/admin/links": {
|
||||
@@ -3982,7 +4070,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.read"
|
||||
}
|
||||
},
|
||||
"/api/admin/links/{probe_id}/{agent_id}": {
|
||||
@@ -4071,7 +4160,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-moshiro-capability": "fleet.write"
|
||||
}
|
||||
},
|
||||
"/healthz": {
|
||||
@@ -4110,7 +4200,7 @@
|
||||
"tags": [
|
||||
"ops"
|
||||
],
|
||||
"summary": "Prometheus metrics (admin token)",
|
||||
"summary": "Prometheus metrics (requires ops.metrics)",
|
||||
"operationId": "metrics_get",
|
||||
"responses": {
|
||||
"200": {
|
||||
@@ -4512,9 +4602,10 @@
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"scope",
|
||||
"capabilities",
|
||||
"created_at",
|
||||
"last_used_at",
|
||||
"expires_at",
|
||||
"revoked_at"
|
||||
],
|
||||
"type": "object",
|
||||
@@ -4525,8 +4616,11 @@
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"scope": {
|
||||
"type": "string"
|
||||
"capabilities": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"format": "date-time"
|
||||
@@ -4534,6 +4628,9 @@
|
||||
"last_used_at": {
|
||||
"format": "date-time"
|
||||
},
|
||||
"expires_at": {
|
||||
"format": "date-time"
|
||||
},
|
||||
"revoked_at": {
|
||||
"format": "date-time"
|
||||
}
|
||||
@@ -4680,6 +4777,89 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"CapabilityCatalogDto": {
|
||||
"required": [
|
||||
"groups",
|
||||
"presets"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"groups": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/CapabilityGroupDto"
|
||||
}
|
||||
},
|
||||
"presets": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/CapabilityPresetDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"CapabilityDto": {
|
||||
"required": [
|
||||
"id",
|
||||
"trust",
|
||||
"reserved",
|
||||
"implies"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"trust": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"reserved": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"implies": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"CapabilityGroupDto": {
|
||||
"required": [
|
||||
"id",
|
||||
"capabilities"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"capabilities": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/CapabilityDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"CapabilityPresetDto": {
|
||||
"required": [
|
||||
"id",
|
||||
"capabilities"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"capabilities": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ChangePasswordRequest": {
|
||||
"required": [
|
||||
"password"
|
||||
@@ -4845,15 +5025,27 @@
|
||||
"CreateApiTokenRequest": {
|
||||
"required": [
|
||||
"name",
|
||||
"scope"
|
||||
"capabilities"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"scope": {
|
||||
"type": "string"
|
||||
"capabilities": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"expires_in_days": {
|
||||
"pattern": "^-?(?:0|[1-9]\\d*)$",
|
||||
"type": [
|
||||
"null",
|
||||
"integer",
|
||||
"string"
|
||||
],
|
||||
"format": "int32"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -5988,7 +6180,7 @@
|
||||
"MeDto": {
|
||||
"required": [
|
||||
"kind",
|
||||
"scope",
|
||||
"capabilities",
|
||||
"user_id",
|
||||
"username",
|
||||
"csrf_token"
|
||||
@@ -5998,8 +6190,11 @@
|
||||
"kind": {
|
||||
"type": "string"
|
||||
},
|
||||
"scope": {
|
||||
"type": "string"
|
||||
"capabilities": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"user_id": {
|
||||
"type": [
|
||||
|
||||
Reference in new issue
Block a user