access-lists.json 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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. "meta": {
  46. "type": "object"
  47. }
  48. },
  49. "properties": {
  50. "id": {
  51. "$ref": "#/definitions/id"
  52. },
  53. "created_on": {
  54. "$ref": "#/definitions/created_on"
  55. },
  56. "modified_on": {
  57. "$ref": "#/definitions/modified_on"
  58. },
  59. "name": {
  60. "$ref": "#/definitions/name"
  61. },
  62. "meta": {
  63. "$ref": "#/definitions/meta"
  64. }
  65. },
  66. "links": [
  67. {
  68. "title": "List",
  69. "description": "Returns a list of Access Lists",
  70. "href": "/nginx/access-lists",
  71. "access": "private",
  72. "method": "GET",
  73. "rel": "self",
  74. "http_header": {
  75. "$ref": "../examples.json#/definitions/auth_header"
  76. },
  77. "targetSchema": {
  78. "type": "array",
  79. "items": {
  80. "$ref": "#/properties"
  81. }
  82. }
  83. },
  84. {
  85. "title": "Create",
  86. "description": "Creates a new Access List",
  87. "href": "/nginx/access-list",
  88. "access": "private",
  89. "method": "POST",
  90. "rel": "create",
  91. "http_header": {
  92. "$ref": "../examples.json#/definitions/auth_header"
  93. },
  94. "schema": {
  95. "type": "object",
  96. "additionalProperties": false,
  97. "required": ["name"],
  98. "properties": {
  99. "name": {
  100. "$ref": "#/definitions/name"
  101. },
  102. "satisfy_any": {
  103. "$ref": "#/definitions/satisfy_any"
  104. },
  105. "items": {
  106. "type": "array",
  107. "minItems": 0,
  108. "items": {
  109. "type": "object",
  110. "additionalProperties": false,
  111. "properties": {
  112. "username": {
  113. "type": "string",
  114. "minLength": 1
  115. },
  116. "password": {
  117. "type": "string",
  118. "minLength": 1
  119. }
  120. }
  121. }
  122. },
  123. "clients": {
  124. "type": "array",
  125. "minItems": 0,
  126. "items": {
  127. "type": "object",
  128. "additionalProperties": false,
  129. "properties": {
  130. "address": {
  131. "$ref": "#/definitions/address"
  132. },
  133. "directive": {
  134. "$ref": "#/definitions/directive"
  135. }
  136. }
  137. }
  138. },
  139. "meta": {
  140. "$ref": "#/definitions/meta"
  141. }
  142. }
  143. },
  144. "targetSchema": {
  145. "properties": {
  146. "$ref": "#/properties"
  147. }
  148. }
  149. },
  150. {
  151. "title": "Update",
  152. "description": "Updates a existing Access List",
  153. "href": "/nginx/access-list/{definitions.identity.example}",
  154. "access": "private",
  155. "method": "PUT",
  156. "rel": "update",
  157. "http_header": {
  158. "$ref": "../examples.json#/definitions/auth_header"
  159. },
  160. "schema": {
  161. "type": "object",
  162. "additionalProperties": false,
  163. "properties": {
  164. "name": {
  165. "$ref": "#/definitions/name"
  166. },
  167. "satisfy_any": {
  168. "$ref": "#/definitions/satisfy_any"
  169. },
  170. "items": {
  171. "type": "array",
  172. "minItems": 0,
  173. "items": {
  174. "type": "object",
  175. "additionalProperties": false,
  176. "properties": {
  177. "username": {
  178. "type": "string",
  179. "minLength": 1
  180. },
  181. "password": {
  182. "type": "string",
  183. "minLength": 0
  184. }
  185. }
  186. }
  187. },
  188. "clients": {
  189. "type": "array",
  190. "minItems": 0,
  191. "items": {
  192. "type": "object",
  193. "additionalProperties": false,
  194. "properties": {
  195. "address": {
  196. "$ref": "#/definitions/address"
  197. },
  198. "directive": {
  199. "$ref": "#/definitions/directive"
  200. }
  201. }
  202. }
  203. }
  204. }
  205. },
  206. "targetSchema": {
  207. "properties": {
  208. "$ref": "#/properties"
  209. }
  210. }
  211. },
  212. {
  213. "title": "Delete",
  214. "description": "Deletes a existing Access List",
  215. "href": "/nginx/access-list/{definitions.identity.example}",
  216. "access": "private",
  217. "method": "DELETE",
  218. "rel": "delete",
  219. "http_header": {
  220. "$ref": "../examples.json#/definitions/auth_header"
  221. },
  222. "targetSchema": {
  223. "type": "boolean"
  224. }
  225. }
  226. ]
  227. }