mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(coderd): add retention policy configuration (#21021)
Add `RetentionConfig` with server flags for configuring data retention: - `--audit-logs-retention`: retention for audit log entries - `--connection-logs-retention`: retention for connection logs - `--api-keys-retention`: retention for expired API keys (default 7d) Updates #20743
This commit is contained in:
Generated
+5
@@ -463,6 +463,11 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
|
||||
"disable_all": true
|
||||
},
|
||||
"redirect_to_access_url": true,
|
||||
"retention": {
|
||||
"api_keys": 0,
|
||||
"audit_logs": 0,
|
||||
"connection_logs": 0
|
||||
},
|
||||
"scim_api_key": "string",
|
||||
"session_lifetime": {
|
||||
"default_duration": 0,
|
||||
|
||||
Generated
+29
@@ -3147,6 +3147,11 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
|
||||
"disable_all": true
|
||||
},
|
||||
"redirect_to_access_url": true,
|
||||
"retention": {
|
||||
"api_keys": 0,
|
||||
"audit_logs": 0,
|
||||
"connection_logs": 0
|
||||
},
|
||||
"scim_api_key": "string",
|
||||
"session_lifetime": {
|
||||
"default_duration": 0,
|
||||
@@ -3663,6 +3668,11 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
|
||||
"disable_all": true
|
||||
},
|
||||
"redirect_to_access_url": true,
|
||||
"retention": {
|
||||
"api_keys": 0,
|
||||
"audit_logs": 0,
|
||||
"connection_logs": 0
|
||||
},
|
||||
"scim_api_key": "string",
|
||||
"session_lifetime": {
|
||||
"default_duration": 0,
|
||||
@@ -3808,6 +3818,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
|
||||
| `proxy_trusted_origins` | array of string | false | | |
|
||||
| `rate_limit` | [codersdk.RateLimitConfig](#codersdkratelimitconfig) | false | | |
|
||||
| `redirect_to_access_url` | boolean | false | | |
|
||||
| `retention` | [codersdk.RetentionConfig](#codersdkretentionconfig) | false | | |
|
||||
| `scim_api_key` | string | false | | |
|
||||
| `session_lifetime` | [codersdk.SessionLifetime](#codersdksessionlifetime) | false | | |
|
||||
| `ssh_keygen_algorithm` | string | false | | |
|
||||
@@ -7506,6 +7517,24 @@ Only certain features set these fields: - FeatureManagedAgentLimit|
|
||||
| `message` | string | false | | Message is an actionable message that depicts actions the request took. These messages should be fully formed sentences with proper punctuation. Examples: - "A user has been created." - "Failed to create a user." |
|
||||
| `validations` | array of [codersdk.ValidationError](#codersdkvalidationerror) | false | | Validations are form field-specific friendly error messages. They will be shown on a form field in the UI. These can also be used to add additional context if there is a set of errors in the primary 'Message'. |
|
||||
|
||||
## codersdk.RetentionConfig
|
||||
|
||||
```json
|
||||
{
|
||||
"api_keys": 0,
|
||||
"audit_logs": 0,
|
||||
"connection_logs": 0
|
||||
}
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|-------------------|---------|----------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `api_keys` | integer | false | | Api keys controls how long expired API keys are retained before being deleted. Keys are only deleted if they have been expired for at least this duration. Defaults to 7 days to preserve existing behavior. |
|
||||
| `audit_logs` | integer | false | | Audit logs controls how long audit log entries are retained. Set to 0 to disable (keep indefinitely). |
|
||||
| `connection_logs` | integer | false | | Connection logs controls how long connection log entries are retained. Set to 0 to disable (keep indefinitely). |
|
||||
|
||||
## codersdk.Role
|
||||
|
||||
```json
|
||||
|
||||
Reference in New Issue
Block a user