post.json 3.1 KB

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