access-lists.json 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "$id": "endpoints/access-lists",
  4. "title": "Access Lists",
  5. "description": "Endpoints relating to Access Lists",
  6. "stability": "stable",
  7. "type": "object",
  8. "definitions": {
  9. "id": {
  10. "$ref": "../definitions.json#/definitions/id"
  11. },
  12. "created_on": {
  13. "$ref": "../definitions.json#/definitions/created_on"
  14. },
  15. "modified_on": {
  16. "$ref": "../definitions.json#/definitions/modified_on"
  17. },
  18. "name": {
  19. "type": "string",
  20. "description": "Name of the Access List"
  21. },
  22. "directive": {
  23. "type": "string",
  24. "enum": ["allow", "deny"]
  25. },
  26. "address": {
  27. "oneOf": [
  28. {
  29. "type": "string",
  30. "pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$"
  31. },
  32. {
  33. "type": "string",
  34. "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]))?$"
  35. },
  36. {
  37. "type": "string",
  38. "pattern": "^all$"
  39. }
  40. ]
  41. },
  42. "satisfy_any": {
  43. "type": "boolean"
  44. },
  45. "pass_auth": {
  46. "type": "boolean"
  47. },
  48. "meta": {
  49. "type": "object"
  50. }
  51. },
  52. "properties": {
  53. "id": {
  54. "$ref": "#/definitions/id"
  55. },
  56. "created_on": {
  57. "$ref": "#/definitions/created_on"
  58. },
  59. "modified_on": {
  60. "$ref": "#/definitions/modified_on"
  61. },
  62. "name": {
  63. "$ref": "#/definitions/name"
  64. },
  65. "meta": {
  66. "$ref": "#/definitions/meta"
  67. }
  68. },
  69. "links": [
  70. {
  71. "title": "List",
  72. "description": "Returns a list of Access Lists",
  73. "href": "/nginx/access-lists",
  74. "access": "private",
  75. "method": "GET",
  76. "rel": "self",
  77. "http_header": {
  78. "$ref": "../examples.json#/definitions/auth_header"
  79. },
  80. "targetSchema": {
  81. "type": "array",
  82. "items": {
  83. "$ref": "#/properties"
  84. }
  85. }
  86. },
  87. {
  88. "title": "Create",
  89. "description": "Creates a new Access List",
  90. "href": "/nginx/access-list",
  91. "access": "private",
  92. "method": "POST",
  93. "rel": "create",
  94. "http_header": {
  95. "$ref": "../examples.json#/definitions/auth_header"
  96. },
  97. "schema": {
  98. "type": "object",
  99. "additionalProperties": false,
  100. "required": ["name"],
  101. "properties": {
  102. "name": {
  103. "$ref": "#/definitions/name"
  104. },
  105. "satisfy_any": {
  106. "$ref": "#/definitions/satisfy_any"
  107. },
  108. "pass_auth": {
  109. "$ref": "#/definitions/pass_auth"
  110. },
  111. "items": {
  112. "type": "array",
  113. "minItems": 0,
  114. "items": {
  115. "type": "object",
  116. "additionalProperties": false,
  117. "properties": {
  118. "username": {
  119. "type": "string",
  120. "minLength": 1
  121. },
  122. "password": {
  123. "type": "string",
  124. "minLength": 1
  125. }
  126. }
  127. }
  128. },
  129. "clients": {
  130. "type": "array",
  131. "minItems": 0,
  132. "items": {
  133. "type": "object",
  134. "additionalProperties": false,
  135. "properties": {
  136. "address": {
  137. "$ref": "#/definitions/address"
  138. },
  139. "directive": {
  140. "$ref": "#/definitions/directive"
  141. }
  142. }
  143. }
  144. },
  145. "meta": {
  146. "$ref": "#/definitions/meta"
  147. }
  148. }
  149. },
  150. "targetSchema": {
  151. "properties": {
  152. "$ref": "#/properties"
  153. }
  154. }
  155. },
  156. {
  157. "title": "Update",
  158. "description": "Updates a existing Access List",
  159. "href": "/nginx/access-list/{definitions.identity.example}",
  160. "access": "private",
  161. "method": "PUT",
  162. "rel": "update",
  163. "http_header": {
  164. "$ref": "../examples.json#/definitions/auth_header"
  165. },
  166. "schema": {
  167. "type": "object",
  168. "additionalProperties": false,
  169. "properties": {
  170. "name": {
  171. "$ref": "#/definitions/name"
  172. },
  173. "satisfy_any": {
  174. "$ref": "#/definitions/satisfy_any"
  175. },
  176. "pass_auth": {
  177. "$ref": "#/definitions/pass_auth"
  178. },
  179. "items": {
  180. "type": "array",
  181. "minItems": 0,
  182. "items": {
  183. "type": "object",
  184. "additionalProperties": false,
  185. "properties": {
  186. "username": {
  187. "type": "string",
  188. "minLength": 1
  189. },
  190. "password": {
  191. "type": "string",
  192. "minLength": 0
  193. }
  194. }
  195. }
  196. },
  197. "clients": {
  198. "type": "array",
  199. "minItems": 0,
  200. "items": {
  201. "type": "object",
  202. "additionalProperties": false,
  203. "properties": {
  204. "address": {
  205. "$ref": "#/definitions/address"
  206. },
  207. "directive": {
  208. "$ref": "#/definitions/directive"
  209. }
  210. }
  211. }
  212. }
  213. }
  214. },
  215. "targetSchema": {
  216. "properties": {
  217. "$ref": "#/properties"
  218. }
  219. }
  220. },
  221. {
  222. "title": "Delete",
  223. "description": "Deletes a existing Access List",
  224. "href": "/nginx/access-list/{definitions.identity.example}",
  225. "access": "private",
  226. "method": "DELETE",
  227. "rel": "delete",
  228. "http_header": {
  229. "$ref": "../examples.json#/definitions/auth_header"
  230. },
  231. "targetSchema": {
  232. "type": "boolean"
  233. }
  234. }
  235. ]
  236. }