Redocly / Redocly/redocly-cli

Add support for OAuth `clientCredential` and `password` flows in Respect

Open
#2,122 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

p3 Respect Type: Enhancement
Dominant language
TypeScript
Stars
1.5k
Forks
228
Avg merge
1d 14h
Merged PRs (30d)
48

Description

Is your feature request related to a problem? Please describe.

Respect support making API calls with Digest security scheme by using x-security extension.
This type of authorization making similar double requests to the destination resource as OAuth clientCredential and password flows with some difference in algorithm of course.

Describe the solution you'd like

Support OAuth2 clientCredential and password flows in x-security extension without accessToken workaround:

components:
  securitySchemes:
    OAuth2Password:
      type: oauth2
      flows:
        password:
          tokenUrl: https://example.com/oauth/token
          scopes:
            read: Read access to protected resources
            write: Write access to protected resources
    OAuth2ClientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://example.com/oauth/token
          scopes:
            admin: Admin access to system
            read: Read-only access
x-security:
  scheme:
     type: oauth2
     flows:
        password:
          tokenUrl: https://example.com/oauth/token
          scopes:
            read: Read access to protected resources
            write: Write access to protected resources
  values:
    password: ..........
x-security:
  scheme:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://example.com/oauth/token
          scopes:
            admin: Admin access to system
            read: Read-only access
  values:
    username: .......
    password: ..........

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing Respect's existing x-security handling for the Digest scheme and the accessToken workaround. Compare that behavior with the OpenAPI OAuth2 password and clientCredentials flow examples in the issue; done means both flows can obtain and use credentials through x-security without the workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, authentication, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.