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

58 lines
1.9 KiB
JSON
Raw Permalink Normal View History

2022-02-01 18:59:17 +01:00
{
"$schema": "http://json-schema.org/draft-07/schema#",
2022-02-26 10:43:52 +01:00
"title": "JSON Schema tibi-server permissions configuration",
"description": "tibi-server permissions linter",
2022-02-01 18:59:17 +01:00
"type": "object",
"additionalProperties": false,
"properties": {
"public": {
"description": "permissions for unauthorized public access",
"$ref": "#/definitions/permissionSet"
},
"user": {
2022-02-26 10:43:52 +01:00
"description": "permissions for authorized users (nativ tibi-server auth)",
2022-02-01 18:59:17 +01:00
"$ref": "#/definitions/permissionSet"
}
},
"patternProperties": {
2022-10-12 16:23:32 +02:00
"^x\\-": {
"description": "template property"
},
2022-02-01 18:59:17 +01:00
"^token:": {
"description": "permissions for header or query token",
"$ref": "#/definitions/permissionSet"
2022-10-24 10:48:04 +02:00
},
"^[a-zA-Z0-9_]+$": {
"description": "custom permissions",
"$ref": "#/definitions/permissionSet"
2022-02-01 18:59:17 +01:00
}
},
"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" }
}
2022-02-02 13:51:49 +01:00
},
"validProjections": {
"type": "array",
"items": {
"type": "string"
}
2022-02-01 18:59:17 +01:00
}
2022-02-02 13:51:49 +01:00
},
"required": ["methods"]
2022-02-01 18:59:17 +01:00
}
}
}