github / rest-api-description

An OpenAPI description for GitHub's REST API
MIT License
1.38k stars 225 forks source link

[Schema Inaccuracy] Security Schemes Missing #237

Open philsturgeon opened 3 years ago

philsturgeon commented 3 years ago

Schema Inaccuracy

GitHub REST API uses OAuth2 access tokens, and has some support for query string tokens (deprecated) and basic auth (hmmmm) which could be described in your OpenAPI.

Expected

    components:
      securitySchemes:
        BasicAuth:
          type: http
          scheme: basic

        OAuth2:
          type: oauth2
          flows:
            authorizationCode:
              authorizationUrl: https://example.com/oauth/authorize
              tokenUrl: https://example.com/oauth/token
              scopes:
                read: Grants read access
                write: Grants write access
                admin: Grants access to admin operations

Also this gave me the idea to make security schemes in OpenAPI, deprecateable thank you! https://github.com/OAI/OpenAPI-Specification/issues/2506

ahoglund commented 3 years ago

@philsturgeon - Thanks for opening this issue! I'll add it to our internal backlog for discussion with the team.

tomaszdurka commented 3 weeks ago

I want to use Github api spec in an automated way. Is there possibility to add securitySchemes and security requirements for operations into the spec?

Thanks