diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2021-12-03 10:16:47 +0000 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2021-12-03 10:16:47 +0000 |
| commit | db60663793e8fe3e4d600ceb0862e50cdebb339f (patch) | |
| tree | 73aaac0b42d355734229815f1b83084e46192b62 | |
| parent | aa3ca9bde19f0f1d2b403e827c9184f2764c060c (diff) | |
add user permissions to JSON schema
| -rw-r--r-- | internal/config/server.go | 2 | ||||
| -rwxr-xr-x | samples/dtail.schema.json | 24 |
2 files changed, 24 insertions, 2 deletions
diff --git a/internal/config/server.go b/internal/config/server.go index e901a7a..4c96567 100644 --- a/internal/config/server.go +++ b/internal/config/server.go @@ -49,7 +49,7 @@ type ServerConfig struct { MaxConcurrentTails int // The max line length until it's split up into multiple smaller lines. MaxLineLength int - // The user permissions. TODO: Add to JSON schema + // The user permissions. Permissions Permissions `json:",omitempty"` // The mapr log format MapreduceLogFormat string `json:",omitempty"` diff --git a/samples/dtail.schema.json b/samples/dtail.schema.json index 7551449..7f5cbed 100755 --- a/samples/dtail.schema.json +++ b/samples/dtail.schema.json @@ -2,6 +2,20 @@ "$schema": "https://json-schema.org/2019-09/schema", "description": "Schema for dtail.json", "definitions": { + "userPermission": { + "type": "array", + "items": { + "type": "string" + } + }, + "userPermissions": { + "type": "object", + "patternProperties": { + "^.*$": { + "$ref": "#/definitions/userPermission" + } + } + }, "loglevel": { "type": "string", "enum": [ @@ -365,7 +379,15 @@ }, "Permissions": { "type": "object", - "properties": {} + "additionalProperties": true, + "patternProperties": { + "^Default$": { + "$ref": "#/definitions/userPermission" + }, + "^Users$": { + "$ref": "#/definitions/userPermissions" + } + } }, "Schedule": { "type": "array", |
