put.json 3.3 KB

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