common.json 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "$id": "common",
  4. "type": "object",
  5. "properties": {
  6. "id": {
  7. "description": "Unique identifier",
  8. "readOnly": true,
  9. "type": "integer",
  10. "minimum": 1,
  11. "example": 11
  12. },
  13. "expand": {
  14. "anyOf": [
  15. {
  16. "type": "null"
  17. },
  18. {
  19. "type": "array",
  20. "minItems": 1,
  21. "items": {
  22. "type": "string"
  23. }
  24. }
  25. ]
  26. },
  27. "query": {
  28. "anyOf": [
  29. {
  30. "type": "null"
  31. },
  32. {
  33. "type": "string",
  34. "minLength": 1,
  35. "maxLength": 255
  36. }
  37. ]
  38. },
  39. "created_on": {
  40. "description": "Date and time of creation",
  41. "readOnly": true,
  42. "type": "string",
  43. "example": "2025-10-28T04:17:54.000Z"
  44. },
  45. "modified_on": {
  46. "description": "Date and time of last update",
  47. "readOnly": true,
  48. "type": "string",
  49. "example": "2025-10-28T04:17:54.000Z"
  50. },
  51. "user_id": {
  52. "description": "User ID",
  53. "type": "integer",
  54. "minimum": 1,
  55. "example": 2
  56. },
  57. "certificate_id": {
  58. "description": "Certificate ID",
  59. "anyOf": [
  60. {
  61. "type": "integer",
  62. "minimum": 0,
  63. "example": 5
  64. },
  65. {
  66. "type": "string",
  67. "pattern": "^new$",
  68. "example": "new"
  69. }
  70. ],
  71. "example": 5
  72. },
  73. "access_list_id": {
  74. "description": "Access List ID",
  75. "type": "integer",
  76. "minimum": 0,
  77. "example": 3
  78. },
  79. "domain_names": {
  80. "description": "Domain Names separated by a comma",
  81. "type": "array",
  82. "minItems": 1,
  83. "maxItems": 100,
  84. "uniqueItems": true,
  85. "items": {
  86. "type": "string",
  87. "pattern": "^[^&| @!#%^();:/\\\\}{=+?<>,~`'\"]+$"
  88. },
  89. "example": ["example.com", "www.example.com"]
  90. },
  91. "enabled": {
  92. "description": "Is Enabled",
  93. "type": "boolean",
  94. "example": false
  95. },
  96. "ssl_forced": {
  97. "description": "Is SSL Forced",
  98. "type": "boolean",
  99. "example": true
  100. },
  101. "hsts_enabled": {
  102. "description": "Is HSTS Enabled",
  103. "type": "boolean",
  104. "example": true
  105. },
  106. "hsts_subdomains": {
  107. "description": "Is HSTS applicable to all subdomains",
  108. "type": "boolean",
  109. "example": true
  110. },
  111. "ssl_provider": {
  112. "type": "string",
  113. "pattern": "^(letsencrypt|other)$",
  114. "example": "letsencrypt"
  115. },
  116. "http2_support": {
  117. "description": "HTTP2 Protocol Support",
  118. "type": "boolean",
  119. "example": true
  120. },
  121. "block_exploits": {
  122. "description": "Should we block common exploits",
  123. "type": "boolean",
  124. "example": false
  125. },
  126. "caching_enabled": {
  127. "description": "Should we cache assets",
  128. "type": "boolean",
  129. "example": true
  130. },
  131. "email": {
  132. "description": "Email address",
  133. "type": "string",
  134. "pattern": "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$",
  135. "example": "[email protected]"
  136. },
  137. "directive": {
  138. "type": "string",
  139. "enum": ["allow", "deny"],
  140. "example": "allow"
  141. },
  142. "address": {
  143. "oneOf": [
  144. {
  145. "type": "string",
  146. "pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$"
  147. },
  148. {
  149. "type": "string",
  150. "pattern": "^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))?$"
  151. },
  152. {
  153. "type": "string",
  154. "pattern": "^all$"
  155. }
  156. ],
  157. "example": "192.168.0.11"
  158. },
  159. "access_items": {
  160. "type": "array",
  161. "items": {
  162. "type": "object",
  163. "additionalProperties": false,
  164. "properties": {
  165. "username": {
  166. "type": "string",
  167. "minLength": 1
  168. },
  169. "password": {
  170. "type": "string"
  171. }
  172. },
  173. "example": {
  174. "username": "admin",
  175. "password": "pass"
  176. }
  177. },
  178. "example": [
  179. {
  180. "username": "admin",
  181. "password": "pass"
  182. }
  183. ]
  184. },
  185. "access_clients": {
  186. "type": "array",
  187. "items": {
  188. "type": "object",
  189. "additionalProperties": false,
  190. "properties": {
  191. "address": {
  192. "$ref": "#/properties/address"
  193. },
  194. "directive": {
  195. "$ref": "#/properties/directive"
  196. }
  197. },
  198. "example": {
  199. "directive": "allow",
  200. "address": "192.168.0.0/24"
  201. }
  202. },
  203. "example": [
  204. {
  205. "directive": "allow",
  206. "address": "192.168.0.0/24"
  207. }
  208. ]
  209. },
  210. "certificate_files": {
  211. "description": "Certificate Files",
  212. "content": {
  213. "multipart/form-data": {
  214. "schema": {
  215. "type": "object",
  216. "additionalProperties": false,
  217. "required": ["certificate", "certificate_key"],
  218. "properties": {
  219. "certificate": {
  220. "type": "string",
  221. "example": "-----BEGIN CERTIFICATE-----\nMIID...-----END CERTIFICATE-----"
  222. },
  223. "certificate_key": {
  224. "type": "string",
  225. "example": "-----BEGIN CERTIFICATE-----\nMIID...-----END CERTIFICATE-----"
  226. },
  227. "intermediate_certificate": {
  228. "type": "string",
  229. "example": "-----BEGIN CERTIFICATE-----\nMIID...-----END CERTIFICATE-----"
  230. }
  231. }
  232. },
  233. "example": {
  234. "certificate": "-----BEGIN CERTIFICATE-----\nMIID...-----END CERTIFICATE-----",
  235. "certificate_key": "-----BEGIN PRIVATE\nMIID...-----END CERTIFICATE-----"
  236. }
  237. }
  238. }
  239. }
  240. }
  241. }