auth.swagger.json 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "title": "auth.proto",
  5. "version": "version not set"
  6. },
  7. "schemes": [
  8. "http",
  9. "https"
  10. ],
  11. "consumes": [
  12. "application/json"
  13. ],
  14. "produces": [
  15. "application/json"
  16. ],
  17. "paths": {
  18. "/api/v1/auth/authenticate": {
  19. "post": {
  20. "operationId": "Authenticate",
  21. "responses": {
  22. "200": {
  23. "description": "",
  24. "schema": {
  25. "$ref": "#/definitions/pbAuthAuthenticateResponse"
  26. }
  27. }
  28. },
  29. "parameters": [
  30. {
  31. "name": "body",
  32. "in": "body",
  33. "required": true,
  34. "schema": {
  35. "$ref": "#/definitions/pbAuthAuthenticateRequest"
  36. }
  37. }
  38. ],
  39. "tags": [
  40. "AuthService"
  41. ]
  42. }
  43. },
  44. "/api/v1/auth/status": {
  45. "get": {
  46. "operationId": "Status",
  47. "responses": {
  48. "200": {
  49. "description": "",
  50. "schema": {
  51. "$ref": "#/definitions/pbAuthStatusResponse"
  52. }
  53. }
  54. },
  55. "tags": [
  56. "AuthService"
  57. ]
  58. }
  59. }
  60. },
  61. "definitions": {
  62. "UserResponseUser": {
  63. "type": "object",
  64. "properties": {
  65. "username": {
  66. "type": "string"
  67. },
  68. "server_serial_number": {
  69. "type": "string"
  70. },
  71. "cert": {
  72. "type": "string"
  73. },
  74. "created_at": {
  75. "type": "string"
  76. },
  77. "ip_net": {
  78. "type": "string"
  79. },
  80. "no_gw": {
  81. "type": "boolean",
  82. "format": "boolean"
  83. },
  84. "host_id": {
  85. "type": "integer",
  86. "format": "int64"
  87. },
  88. "is_admin": {
  89. "type": "boolean",
  90. "format": "boolean"
  91. },
  92. "is_connected": {
  93. "type": "boolean",
  94. "format": "boolean"
  95. },
  96. "connected_since": {
  97. "type": "string"
  98. },
  99. "bytes_sent": {
  100. "type": "string",
  101. "format": "uint64"
  102. },
  103. "bytes_received": {
  104. "type": "string",
  105. "format": "uint64"
  106. },
  107. "expires_at": {
  108. "type": "string"
  109. }
  110. }
  111. },
  112. "pbAuthAuthenticateRequest": {
  113. "type": "object",
  114. "properties": {
  115. "username": {
  116. "type": "string"
  117. },
  118. "password": {
  119. "type": "string"
  120. }
  121. }
  122. },
  123. "pbAuthAuthenticateResponse": {
  124. "type": "object",
  125. "properties": {
  126. "token": {
  127. "type": "string"
  128. }
  129. }
  130. },
  131. "pbAuthStatusResponse": {
  132. "type": "object",
  133. "properties": {
  134. "user": {
  135. "$ref": "#/definitions/UserResponseUser"
  136. },
  137. "is_root": {
  138. "type": "boolean",
  139. "format": "boolean"
  140. }
  141. }
  142. }
  143. }
  144. }