tibi-types/schemas/api-config/permissions.json
Sebastian Frank f250ddee2c
All checks were successful
continuous-integration/drone/push Build is passing
allow x- properties in schema
2022-10-12 16:23:32 +02:00

54 lines
1.7 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "JSON Schema tibi-server permissions configuration",
"description": "tibi-server permissions linter",
"type": "object",
"additionalProperties": false,
"properties": {
"public": {
"description": "permissions for unauthorized public access",
"$ref": "#/definitions/permissionSet"
},
"user": {
"description": "permissions for authorized users (nativ tibi-server auth)",
"$ref": "#/definitions/permissionSet"
}
},
"patternProperties": {
"^x\\-": {
"description": "template property"
},
"^token:": {
"description": "permissions for header or query token",
"$ref": "#/definitions/permissionSet"
}
},
"required": ["public", "user"],
"definitions": {
"permissionSet": {
"type": "object",
"additionalProperties": false,
"properties": {
"methods": {
"type": "object",
"description": "permissions for http methods",
"additionalProperties": false,
"properties": {
"get": { "type": "boolean" },
"post": { "type": "boolean" },
"put": { "type": "boolean" },
"delete": { "type": "boolean" }
}
},
"validProjections": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["methods"]
}
}
}