post.json 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. {
  2. "operationId": "createAccessList",
  3. "summary": "Create a Access List",
  4. "tags": ["Access Lists"],
  5. "security": [
  6. {
  7. "BearerAuth": ["access_lists"]
  8. }
  9. ],
  10. "requestBody": {
  11. "description": "Access List Payload",
  12. "required": true,
  13. "content": {
  14. "application/json": {
  15. "schema": {
  16. "type": "object",
  17. "additionalProperties": false,
  18. "required": ["name"],
  19. "properties": {
  20. "name": {
  21. "$ref": "../../../components/access-list-object.json#/properties/name"
  22. },
  23. "satisfy_any": {
  24. "$ref": "../../../components/access-list-object.json#/properties/satisfy_any"
  25. },
  26. "pass_auth": {
  27. "$ref": "../../../components/access-list-object.json#/properties/pass_auth"
  28. },
  29. "items": {
  30. "type": "array",
  31. "items": {
  32. "type": "object",
  33. "additionalProperties": false,
  34. "properties": {
  35. "username": {
  36. "type": "string",
  37. "minLength": 1
  38. },
  39. "password": {
  40. "type": "string",
  41. "minLength": 1
  42. }
  43. }
  44. }
  45. },
  46. "clients": {
  47. "type": "array",
  48. "items": {
  49. "type": "object",
  50. "additionalProperties": false,
  51. "properties": {
  52. "address": {
  53. "oneOf": [
  54. {
  55. "type": "string",
  56. "pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$"
  57. },
  58. {
  59. "type": "string",
  60. "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]))?$"
  61. },
  62. {
  63. "type": "string",
  64. "pattern": "^all$"
  65. }
  66. ]
  67. },
  68. "directive": {
  69. "$ref": "../../../components/access-list-object.json#/properties/directive"
  70. }
  71. }
  72. }
  73. },
  74. "meta": {
  75. "$ref": "../../../components/access-list-object.json#/properties/meta"
  76. }
  77. }
  78. }
  79. }
  80. }
  81. },
  82. "responses": {
  83. "201": {
  84. "description": "201 response",
  85. "content": {
  86. "application/json": {
  87. "examples": {
  88. "default": {
  89. "value": {
  90. "id": 1,
  91. "created_on": "2024-10-08T22:15:40.000Z",
  92. "modified_on": "2024-10-08T22:15:40.000Z",
  93. "owner_user_id": 1,
  94. "name": "test1234",
  95. "meta": {},
  96. "satisfy_any": true,
  97. "pass_auth": false,
  98. "proxy_host_count": 0,
  99. "owner": {
  100. "id": 1,
  101. "created_on": "2024-10-07T22:43:55.000Z",
  102. "modified_on": "2024-10-08T12:52:54.000Z",
  103. "is_deleted": false,
  104. "is_disabled": false,
  105. "email": "[email protected]",
  106. "name": "Administrator",
  107. "nickname": "some guy",
  108. "avatar": "//www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?default=mm",
  109. "roles": ["admin"]
  110. },
  111. "items": [
  112. {
  113. "id": 1,
  114. "created_on": "2024-10-08T22:15:40.000Z",
  115. "modified_on": "2024-10-08T22:15:40.000Z",
  116. "access_list_id": 1,
  117. "username": "admin",
  118. "password": "",
  119. "meta": {},
  120. "hint": "a****"
  121. },
  122. {
  123. "id": 2,
  124. "created_on": "2024-10-08T22:15:40.000Z",
  125. "modified_on": "2024-10-08T22:15:40.000Z",
  126. "access_list_id": 1,
  127. "username": "asdad",
  128. "password": "",
  129. "meta": {},
  130. "hint": "a*****"
  131. }
  132. ],
  133. "proxy_hosts": [],
  134. "clients": [
  135. {
  136. "id": 1,
  137. "created_on": "2024-10-08T22:15:40.000Z",
  138. "modified_on": "2024-10-08T22:15:40.000Z",
  139. "access_list_id": 1,
  140. "address": "127.0.0.1",
  141. "directive": "allow",
  142. "meta": {}
  143. }
  144. ]
  145. }
  146. }
  147. },
  148. "schema": {
  149. "$ref": "../../../components/access-list-object.json"
  150. }
  151. }
  152. }
  153. }
  154. }
  155. }