summaryrefslogtreecommitdiff
path: root/doc/auth_server_proto.yaml
blob: ee6f8cde1d77974fc7776ca454fc267fd09a74a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
openapi: 3.0.0
info:
  version: 1.0.0
  title: nstportal api
  description: Nst Portal api discriber
  contact:
    name: New Safty Technology
    email: support@newinfosec.ru
    url: 'https://www.newinfosec.ru'
  license:
    name: Apache 2.0
    url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
servers:
  - url: /
security:
  - cookieAuth: []
  - CSRFtoken: []
paths:
  '/getconf/':
    get:
      security: []
      description: Returns all connection params for reqested session
      operationId: getConf
      parameters:
        - name: sid
          in: query # path will also works
          required: true
          style: form
          schema:
            $ref: '#/components/schemas/Sid'
      responses:
        '200':
          description: config response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Config'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      security: []
      description: Returns all connection params for reqested session
      operationId: getConf
      parameters:
        - name: sid
          in: query # path will also works
          required: true
          style: form
          schema:
            $ref: '#/components/schemas/Sid'
      responses:
        '200':
          description: config response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Config'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Answer:
      description: Base for any server answers
      type: string
      enum: ['setconf', 'getconf', 'error']
    Sid:
      description: |
        Sid(token) - случайный набор байт(64) в формате base64 urlsafe, подписанный hmac-sha256
      type: string
      example: "xvwuWLOqAwIK2rlw9OoMLteD5aWKdzXbbApzLRKop4Vooc4CmEV3ZP9sHlrYMVHdNbHHdS9YtH5DFVycSZQmWG_TqjtRd06e2AQJ1OugAsdbWe7_p6GZ-9qO74k5CTkD"
    Config:
      required:
        - answer
      properties:
        answer:
         $ref: '#/components/schemas/Answer'
        settings:
          $ref: '#/components/schemas/Settings'
        host:
          type: string
          example: localhost
          description: адрес конечного ресурса или SI
        login:
          type: string
        password:
          type: string
        port:
          type: integer 
        proto:
          type: string
          enum: ['ssh', 'rdp', 'http']
        sid:
          $ref: '#/components/schemas/Sid'
    Settings:
      properties:
        pcb:
          type: boolean
        fntlm:
          type: boolean
        nowallp:
          type: boolean
        nowdrag:
          type: boolean
        nomani:
          type: boolean
        notheme:
          type: boolean
        nonla:
          type: boolean
        notls:
          type: boolean
        dtsize:
          type: string
          example: "1280x720"
        libsettings:
          $ref: '#/components/schemas/LibSettings'
    LibSettings:
      description: |
        "https://github.com/FreeRDP/FreeRDP/blob/master/libfreerdp/core/settings.c"
      properties:
        a:
          type: integer
          enum: [ 0, 1 ]
    Error:
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    cookieAuth:
      type: apiKey
      in: cookie
      name: portal_user
    CSRFtoken:
      type: apiKey
      in: cookie
      name:  xsrf