tibi-types/schemas/api-config/permissions.json

51 lines
1.6 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": {
"^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"]
}
}
}