Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-13035

Enable JWT authentication in Swagger UI

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Invalid
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: squash
    • Labels:
      None

      Description

      There are two problems here:

      flasgger extracts the OpenAPI specs from the doc strings but since the /auth resource is created automatically by the flask-jwt package there's no place to add the doc strings.

      We could append that later in the OpenAPI spec generated by flasgger but Bearer Authentication is introduced only in OpenAPI 3.0 which is not supported by flasgger yet.

      https://swagger.io/docs/specification/authentication/bearer-authentication/

      This suggests we should perhaps write the OpenAPI 3.0 specification for the SQuaSH RESTful API and try the Swagger UI v3 in order to add the JWT token in the authorization headers.

        Attachments

          Issue Links

            Activity

            No builds found.
            afausti Angelo Fausti created issue -
            afausti Angelo Fausti made changes -
            Field Original Value New Value
            Epic Link DM-10181 [ 31811 ]
            afausti Angelo Fausti made changes -
            Status To Do [ 10001 ] In Progress [ 3 ]
            afausti Angelo Fausti made changes -
            Summary Add authorization header in the OpenAPI specification / Swagger UI Add jwt /auth endpoint in the OpenAPI specification
            afausti Angelo Fausti made changes -
            Summary Add jwt /auth endpoint in the OpenAPI specification Enable JWT authentication in Swagger UI
            afausti Angelo Fausti made changes -
            Description The {{/auth}} resource is created automatically by the {{flask-jwt}} package so there's no place to add the doc strings with the OpenAPI specifications that are extracted by {{flasgger}} and therefore the {{/auth}} does not show up in the Swagger UI.
            There are two problems here:

             {{flasgger}} extracts the OpenAPI specs from the doc strings but since the {{/auth}} resource is created automatically by the {{flask-jwt}} package there's no place to add the doc strings.

            We could append that later in the OpenAPI spec generated by {{flasgger}} but Bearer Authentication is introduced only in OpenAPI 3.0 which is not supported by {{flasgger}} yet.

            https://swagger.io/docs/specification/authentication/bearer-authentication/

            This suggests we should perhaps write the OpenAPI 3.0 specification for the SQuaSH RESTful API and try the Swagger UI v3 in order to add the JWT token in the authorization headers.
            afausti Angelo Fausti made changes -
            Epic Link DM-10181 [ 31811 ] DM-5504 [ 23337 ]
            afausti Angelo Fausti made changes -
            Epic Link DM-5504 [ 23337 ] DM-12787 [ 36405 ]
            afausti Angelo Fausti made changes -
            Status In Progress [ 3 ] To Do [ 10001 ]
            Hide
            afausti Angelo Fausti added a comment -

            Moved to To Do won't work on this issue for now.

            Show
            afausti Angelo Fausti added a comment - Moved to To Do won't work on this issue for now.
            afausti Angelo Fausti made changes -
            Epic Link DM-12787 [ 36405 ] DM-14312 [ 63991 ]
            afausti Angelo Fausti made changes -
            Component/s squash [ 14169 ]
            afausti Angelo Fausti made changes -
            Risk Score 0
            afausti Angelo Fausti made changes -
            Link This issue relates to DM-15329 [ DM-15329 ]
            afausti Angelo Fausti made changes -
            Description
            There are two problems here:

             {{flasgger}} extracts the OpenAPI specs from the doc strings but since the {{/auth}} resource is created automatically by the {{flask-jwt}} package there's no place to add the doc strings.

            We could append that later in the OpenAPI spec generated by {{flasgger}} but Bearer Authentication is introduced only in OpenAPI 3.0 which is not supported by {{flasgger}} yet.

            https://swagger.io/docs/specification/authentication/bearer-authentication/

            This suggests we should perhaps write the OpenAPI 3.0 specification for the SQuaSH RESTful API and try the Swagger UI v3 in order to add the JWT token in the authorization headers.
            There are two problems here:

             {{flasgger}} extracts the OpenAPI specs from the doc strings but since the {{/auth}} resource is created automatically by the {{flask-jwt}} package there's no place to add the doc strings.

            We could append that later in the OpenAPI spec generated by {{flasgger}} but Bearer Authentication is introduced only in OpenAPI 3.0 which is not supported by {{flasgger}} yet.

            https://swagger.io/docs/specification/authentication/bearer-authentication/

            This suggests we should perhaps write the OpenAPI 3.0 specification for the SQuaSH RESTful API and try the Swagger UI v3 in order to add the JWT token in the authorization headers.
            afausti Angelo Fausti made changes -
            Epic Link DM-14312 [ 63991 ] DM-5504 [ 23337 ]
            tjenness Tim Jenness made changes -
            Remote Link This issue links to "Page (Confluence)" [ 32808 ]
            Hide
            afausti Angelo Fausti added a comment -

            Superseded by DM-34629. FastAPI adds OpenAPI 3.0 specification.

            Show
            afausti Angelo Fausti added a comment - Superseded by DM-34629 . FastAPI adds OpenAPI 3.0 specification.
            afausti Angelo Fausti made changes -
            Resolution Done [ 10000 ]
            Status To Do [ 10001 ] Invalid [ 11005 ]

              People

              Assignee:
              afausti Angelo Fausti
              Reporter:
              afausti Angelo Fausti
              Watchers:
              Angelo Fausti
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.