all repos

onasty @ 3f33118

a one-time notes service

onasty/api/paths/auth/oauth-provider-callback.yml(view raw)

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
get:
  tags: [OAuth]
  summary: OAuth callback handler
  security:
    - {}

  parameters:
    - name: provider
      in: path
      required: true
      schema:
        type: string
        enum: [google, github]

    - name: code
      in: query
      required: true
      description: Authorization code from OAuth provider
      schema:
        type: string
        example: "4/0AX4XfWjYxT5..."

    - name: state
      in: query
      required: false
      description: CSRF protection state parameter
      schema:
        type: string

  responses:
    '200':
      description: OAuth login successful
      content:
        application/json:
          schema:
            $ref: '../../components/schemas/JwtTokens.yml'

    # TODO: unimplemented
    # '302':
    #   description: Redirect to frontend with tokens (alternative flow)
    #   headers:
    #     Location:
    #       description: Frontend URL with tokens as query params or hash
    #       schema:
    #         type: string
    #         example: "onasty.local/api/v1/auth/success?access=...&refresh=..."

    '400':
      $ref: '../../components/responses/ErrorResponse.yml'

    '500':
      $ref: '../../components/responses/ErrorResponse.yml'