From aa1bdc257c1318127fa900022b4dfc0d4e8f1a2f Mon Sep 17 00:00:00 2001 From: Tor Colvin Date: Thu, 5 Sep 2024 09:20:25 -0400 Subject: [PATCH] [3.2.1 backport] CBG-4230 correct docs for /db/_config/audit --- docs/api/components/schemas.yaml | 135 +++++++++++---------- docs/api/paths/admin/db-_config-audit.yaml | 6 +- 2 files changed, 75 insertions(+), 66 deletions(-) diff --git a/docs/api/components/schemas.yaml b/docs/api/components/schemas.yaml index 888bc963fc..a7328c1215 100644 --- a/docs/api/components/schemas.yaml +++ b/docs/api/components/schemas.yaml @@ -1837,69 +1837,78 @@ Database: example: ["CRUD", "HTTP", "Query"] audit: description: Audit logging configuration. - type: object - properties: - enabled: - description: Whether audit logging is enabled. - type: boolean - default: false - enabled_events: - description: List of enabled audit events for this database. - type: array - items: - type: number - example: [1234, 5678] - disabled_users: - description: List of users for which audit logging is disabled - type: array - items: - type: object - properties: - domain: - description: The domain of the user for which audit logging is disabled. - type: string - name: - description: The name of the user for which audit logging is disabled. - type: string - disabled_roles: - description: List of roles for which audit logging is disabled - type: array - items: - type: object - properties: - domain: - description: The domain of the role for which audit logging is disabled. - type: string - name: - description: The name of the role for which audit logging is disabled. - type: string + allOf: + - type: object + properties: + enabled: + description: Whether audit logging is enabled. + type: boolean + default: false + enabled_events: + description: List of enabled audit events for this database. + type: array + items: + type: number + example: [1234, 5678] + - $ref: '#/Disabled-users-and-roles' title: Database-config -Database-audit: - title: Database-audit - description: A map of audit events and whether they are enabled or not. +Disabled-users-and-roles: type: object properties: - enabled: - type: boolean - events: - type: object - additionalProperties: - x-additionalPropertiesName: audit_id - description: The audit event ID and whether it is enabled or not. - type: boolean + disabled_users: + description: List of users for which audit logging is disabled. + type: array + items: + type: object + properties: + domain: + description: The domain of the user for which audit logging is disabled. Either cbs or sgw. + type: string + name: + description: The name of the user for which audit logging is disabled. + type: string + disabled_roles: + description: List of roles for which audit logging is disabled. Either cbs or sgw. + type: array + items: + type: object + properties: + domain: + description: The domain of the role for which audit logging is disabled. + type: string + name: + description: The name of the role for which audit logging is disabled. + type: string +Database-audit: + title: Simple + description: A map of audit events and whether they are enabled or not. + allOf: + - type: object + properties: + enabled: + type: boolean + events: + type: object + additionalProperties: + x-additionalPropertiesName: audit_id + description: The audit event ID and whether it is enabled or not. + type: boolean + - $ref: '#/Disabled-users-and-roles' Database-audit-verbose: - title: Database-audit-verbose + title: Verbose description: A map of detailed audit events. - type: object - properties: - enabled: - type: boolean - events: - type: object - additionalProperties: - x-additionalPropertiesName: audit_id - description: The audit event ID and whether it is enabled or not. - $ref: '#/AuditEventVerbose' + allOf: + - type: object + properties: + enabled: + type: boolean + events: + type: object + additionalProperties: + x-additionalPropertiesName: audit_id + description: The audit event ID and whether it is enabled or not. + $ref: '#/AuditEventVerbose' + - $ref: '#/Disabled-users-and-roles' AuditEventVerbose: title: audit-event-verbose description: Detailed information about an audit event. @@ -2380,7 +2389,7 @@ Logging-config: type: integer collation_buffer_size: description: The size of the log collation buffer. - default: 10 + default: 0 type: integer readOnly: true warn: @@ -2399,7 +2408,7 @@ Logging-config: type: integer collation_buffer_size: description: The size of the log collation buffer - default: 1000 + default: 0 type: integer readOnly: true info: @@ -2418,7 +2427,7 @@ Logging-config: type: integer collation_buffer_size: description: The size of the log collation buffer - default: 1000 + default: 0 type: integer readOnly: true debug: @@ -2437,7 +2446,7 @@ Logging-config: type: integer collation_buffer_size: description: The size of the log collation buffer - default: 0 + default: 1000 type: integer readOnly: true trace: @@ -2456,7 +2465,7 @@ Logging-config: type: integer collation_buffer_size: description: The size of the log collation buffer - default: 0 + default: 1000 type: integer readOnly: true stats: diff --git a/docs/api/paths/admin/db-_config-audit.yaml b/docs/api/paths/admin/db-_config-audit.yaml index a6b9dc28f2..986fa216e9 100644 --- a/docs/api/paths/admin/db-_config-audit.yaml +++ b/docs/api/paths/admin/db-_config-audit.yaml @@ -12,7 +12,7 @@ get: Required Sync Gateway RBAC roles: - * TODO + * Sync Gateway Architect parameters: - name: verbose in: query @@ -49,7 +49,7 @@ put: Required Sync Gateway RBAC roles: - * TODO + * Sync Gateway Architect requestBody: description: The new database audit configuration to use content: @@ -77,7 +77,7 @@ post: Required Sync Gateway RBAC roles: - * TODO + * Sync Gateway Architect parameters: - name: verbose in: query