put.json 4.8 KB

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