tibi-types/schemas/api-config/permissions.json
Sebastian Frank 8db5fd03a2
All checks were successful
continuous-integration/drone/push Build is passing
custom permissions
2022-10-24 10:48:04 +02:00

58 lines
1.9 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"
},
"^[a-zA-Z0-9_]+$": {
"description": "custom permissions",
"$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"]
}
}
}