Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TT-13535/TT-13566] make upstream oauth password client secret not required #6701

Conversation

jeffy-mathew
Copy link
Contributor

@jeffy-mathew jeffy-mathew commented Nov 13, 2024

User description

TT-13566
Summary Make upstream auth oauth password client secret not required in oas schema
Type Sub-task Sub-task
Status In Dev
Points N/A
Labels -

Description

make upstream oauth password client secret not required

Related Issue

Parent: https://tyktech.atlassian.net/browse/TT-13535
Subtask: https://tyktech.atlassian.net/browse/TT-13566

Motivation and Context

How This Has Been Tested

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring or add test (improvements in base code or adds test coverage to functionality)

Checklist

  • I ensured that the documentation is up to date
  • I explained why this PR updates go.mod in detail with reasoning why it's required
  • I would like a code coverage CI quality gate exception and have explained why

PR Type

enhancement


Description

  • Removed the requirement for clientSecret in the OAuth password flow schema, making it optional.
  • This change allows for more flexible configurations where a client secret is not necessary.

Changes walkthrough 📝

Relevant files
Enhancement
x-tyk-api-gateway.json
Make `clientSecret` optional in OAuth password schema       

apidef/oas/schema/x-tyk-api-gateway.json

  • Removed clientSecret from the list of required fields.
  • Updated the schema to make clientSecret optional for OAuth password
    flows.
  • +0/-1     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    @buger
    Copy link
    Member

    buger commented Nov 13, 2024

    I'm a bot and I 👍 this PR title. 🤖

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Schema Change
    The removal of 'clientSecret' from the required fields in the JSON schema needs careful validation to ensure it aligns with the intended functionality and does not introduce any regressions or security issues.

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Enhancement
    Add "clientSecret" as an optional field to maintain schema flexibility

    Consider adding "clientSecret" as an optional field in the schema if it is not
    mandatory. This ensures that the schema remains flexible and can handle cases where
    a client secret might be provided.

    apidef/oas/schema/x-tyk-api-gateway.json [2129-2134]

    +"properties": {
    +  "clientSecret": {
    +    "type": ["string", "null"]
    +  }
    +},
     "required": [
       "clientId",
       "tokenUrl",
       "username",
       "password"
     ]
    Suggestion importance[1-10]: 7

    Why: The suggestion to reintroduce "clientSecret" as an optional field is relevant because it was removed in the PR, potentially affecting the flexibility of the schema. Making it optional rather than required could be beneficial for cases where it might be needed without enforcing it, thus enhancing the schema's adaptability and use-case coverage.

    7

    Copy link
    Contributor

    API Changes

    no api changes detected

    Copy link

    sonarcloud bot commented Nov 13, 2024

    Quality Gate Failed Quality Gate failed

    Failed conditions
    0.0% Coverage on New Code (required ≥ 80%)

    See analysis details on SonarQube Cloud

    @jeffy-mathew jeffy-mathew merged commit 43ac641 into master Nov 13, 2024
    29 of 40 checks passed
    @jeffy-mathew jeffy-mathew deleted the fix/TT-13535/TT-13566/make-upstream-oauth-password-client-secret-not-required branch November 13, 2024 15:39
    @jeffy-mathew
    Copy link
    Contributor Author

    /release to release-5.7

    @jeffy-mathew
    Copy link
    Contributor Author

    /release to release-5.7.0

    Copy link

    tykbot bot commented Nov 15, 2024

    Working on it! Note that it can take a few minutes.

    1 similar comment
    Copy link

    tykbot bot commented Nov 15, 2024

    Working on it! Note that it can take a few minutes.

    tykbot bot pushed a commit that referenced this pull request Nov 15, 2024
    …quired (#6701)
    
    <!-- Provide a general summary of your changes in the Title above -->
    
    ## Description
    
    make upstream oauth password client secret not required
    
    ## Related Issue
    Parent: https://tyktech.atlassian.net/browse/TT-13535
    Subtask: https://tyktech.atlassian.net/browse/TT-13566
    ## Motivation and Context
    
    <!-- Why is this change required? What problem does it solve? -->
    
    ## How This Has Been Tested
    
    <!-- Please describe in detail how you tested your changes -->
    <!-- Include details of your testing environment, and the tests -->
    <!-- you ran to see how your change affects other areas of the code,
    etc. -->
    <!-- This information is helpful for reviewers and QA. -->
    
    ## Screenshots (if appropriate)
    
    ## Types of changes
    
    <!-- What types of changes does your code introduce? Put an `x` in all
    the boxes that apply: -->
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [ ] Refactoring or add test (improvements in base code or adds test
    coverage to functionality)
    
    ## Checklist
    
    <!-- Go over all the following points, and put an `x` in all the boxes
    that apply -->
    <!-- If there are no documentation updates required, mark the item as
    checked. -->
    <!-- Raise up any additional concerns not covered by the checklist. -->
    
    - [ ] I ensured that the documentation is up to date
    - [ ] I explained why this PR updates go.mod in detail with reasoning
    why it's required
    - [ ] I would like a code coverage CI quality gate exception and have
    explained why
    
    (cherry picked from commit 43ac641)
    Copy link

    tykbot bot commented Nov 15, 2024

    @jeffy-mathew Seems like there is conflict and it require manual merge.

    tykbot bot pushed a commit that referenced this pull request Nov 15, 2024
    …quired (#6701)
    
    <!-- Provide a general summary of your changes in the Title above -->
    
    ## Description
    
    make upstream oauth password client secret not required
    
    ## Related Issue
    Parent: https://tyktech.atlassian.net/browse/TT-13535
    Subtask: https://tyktech.atlassian.net/browse/TT-13566
    ## Motivation and Context
    
    <!-- Why is this change required? What problem does it solve? -->
    
    ## How This Has Been Tested
    
    <!-- Please describe in detail how you tested your changes -->
    <!-- Include details of your testing environment, and the tests -->
    <!-- you ran to see how your change affects other areas of the code,
    etc. -->
    <!-- This information is helpful for reviewers and QA. -->
    
    ## Screenshots (if appropriate)
    
    ## Types of changes
    
    <!-- What types of changes does your code introduce? Put an `x` in all
    the boxes that apply: -->
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [ ] Refactoring or add test (improvements in base code or adds test
    coverage to functionality)
    
    ## Checklist
    
    <!-- Go over all the following points, and put an `x` in all the boxes
    that apply -->
    <!-- If there are no documentation updates required, mark the item as
    checked. -->
    <!-- Raise up any additional concerns not covered by the checklist. -->
    
    - [ ] I ensured that the documentation is up to date
    - [ ] I explained why this PR updates go.mod in detail with reasoning
    why it's required
    - [ ] I would like a code coverage CI quality gate exception and have
    explained why
    
    (cherry picked from commit 43ac641)
    Copy link

    tykbot bot commented Nov 15, 2024

    @jeffy-mathew Seems like there is conflict and it require manual merge.

    jeffy-mathew added a commit that referenced this pull request Nov 15, 2024
    …ord client secret not required (#6701) (#6706)
    
    ### **User description**
    <details open>
    <summary><a href="https://tyktech.atlassian.net/browse/TT-13566"
    title="TT-13566" target="_blank">TT-13566</a></summary>
      <br />
      <table>
        <tr>
          <th>Summary</th>
    <td>Make upstream auth oauth password client secret not required in oas
    schema</td>
        </tr>
        <tr>
          <th>Type</th>
          <td>
    <img alt="Sub-task"
    src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10316?size=medium"
    />
            Sub-task
          </td>
        </tr>
        <tr>
          <th>Status</th>
          <td>Ready for Testing</td>
        </tr>
        <tr>
          <th>Points</th>
          <td>N/A</td>
        </tr>
        <tr>
          <th>Labels</th>
          <td>-</td>
        </tr>
      </table>
    </details>
    <!--
      do not remove this marker as it will break jira-lint's functionality.
      added_by_jira_lint
    -->
    
    ---
    
    [TT-13535/TT-13566] make upstream oauth password client secret not
    required (#6701)
    
    <!-- Provide a general summary of your changes in the Title above -->
    
    ## Description
    
    make upstream oauth password client secret not required
    
    ## Related Issue
    Parent: https://tyktech.atlassian.net/browse/TT-13535
    Subtask: https://tyktech.atlassian.net/browse/TT-13566
    ## Motivation and Context
    
    <!-- Why is this change required? What problem does it solve? -->
    
    ## How This Has Been Tested
    
    <!-- Please describe in detail how you tested your changes -->
    <!-- Include details of your testing environment, and the tests -->
    <!-- you ran to see how your change affects other areas of the code,
    etc. -->
    <!-- This information is helpful for reviewers and QA. -->
    
    ## Screenshots (if appropriate)
    
    ## Types of changes
    
    <!-- What types of changes does your code introduce? Put an `x` in all
    the boxes that apply: -->
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [ ] Refactoring or add test (improvements in base code or adds test
    coverage to functionality)
    
    ## Checklist
    
    <!-- Go over all the following points, and put an `x` in all the boxes
    that apply -->
    <!-- If there are no documentation updates required, mark the item as
    checked. -->
    <!-- Raise up any additional concerns not covered by the checklist. -->
    
    - [ ] I ensured that the documentation is up to date
    - [ ] I explained why this PR updates go.mod in detail with reasoning
    why it's required
    - [ ] I would like a code coverage CI quality gate exception and have
    explained why
    
    
    ___
    
    ### **PR Type**
    Enhancement
    
    
    ___
    
    ### **Description**
    - Removed the requirement for `clientSecret` in the OAuth password flow
    schema, making it optional.
    - This change allows for more flexible configurations where a client
    secret is not necessary.
    
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>x-tyk-api-gateway.json</strong><dd><code>Make
    `clientSecret` optional in OAuth password schema</code>&nbsp; &nbsp;
    &nbsp; &nbsp; </dd></summary>
    <hr>
    
    apidef/oas/schema/x-tyk-api-gateway.json
    
    <li>Removed <code>clientSecret</code> from the list of required
    fields.<br> <li> Updated the schema to make <code>clientSecret</code>
    optional for OAuth password <br>flows.<br>
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6706/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+0/-1</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
    request to receive relevant information
    
    Co-authored-by: Jeffy Mathew <[email protected]>
    jeffy-mathew added a commit that referenced this pull request Nov 15, 2024
    …sword client secret not required (#6701) (#6707)
    
    ### **User description**
    <details open>
    <summary><a href="https://tyktech.atlassian.net/browse/TT-13566"
    title="TT-13566" target="_blank">TT-13566</a></summary>
      <br />
      <table>
        <tr>
          <th>Summary</th>
    <td>Make upstream auth oauth password client secret not required in oas
    schema</td>
        </tr>
        <tr>
          <th>Type</th>
          <td>
    <img alt="Sub-task"
    src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10316?size=medium"
    />
            Sub-task
          </td>
        </tr>
        <tr>
          <th>Status</th>
          <td>Ready for Testing</td>
        </tr>
        <tr>
          <th>Points</th>
          <td>N/A</td>
        </tr>
        <tr>
          <th>Labels</th>
          <td>-</td>
        </tr>
      </table>
    </details>
    <!--
      do not remove this marker as it will break jira-lint's functionality.
      added_by_jira_lint
    -->
    
    ---
    
    [TT-13535/TT-13566] make upstream oauth password client secret not
    required (#6701)
    
    <!-- Provide a general summary of your changes in the Title above -->
    
    ## Description
    
    make upstream oauth password client secret not required
    
    ## Related Issue
    Parent: https://tyktech.atlassian.net/browse/TT-13535
    Subtask: https://tyktech.atlassian.net/browse/TT-13566
    ## Motivation and Context
    
    <!-- Why is this change required? What problem does it solve? -->
    
    ## How This Has Been Tested
    
    <!-- Please describe in detail how you tested your changes -->
    <!-- Include details of your testing environment, and the tests -->
    <!-- you ran to see how your change affects other areas of the code,
    etc. -->
    <!-- This information is helpful for reviewers and QA. -->
    
    ## Screenshots (if appropriate)
    
    ## Types of changes
    
    <!-- What types of changes does your code introduce? Put an `x` in all
    the boxes that apply: -->
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [ ] Refactoring or add test (improvements in base code or adds test
    coverage to functionality)
    
    ## Checklist
    
    <!-- Go over all the following points, and put an `x` in all the boxes
    that apply -->
    <!-- If there are no documentation updates required, mark the item as
    checked. -->
    <!-- Raise up any additional concerns not covered by the checklist. -->
    
    - [ ] I ensured that the documentation is up to date
    - [ ] I explained why this PR updates go.mod in detail with reasoning
    why it's required
    - [ ] I would like a code coverage CI quality gate exception and have
    explained why
    
    
    ___
    
    ### **PR Type**
    Enhancement
    
    
    ___
    
    ### **Description**
    - Removed the requirement for `clientSecret` in the OAuth password flow
    schema, making it optional.
    - This change allows for more flexible configurations where a client
    secret is not necessary.
    
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>x-tyk-api-gateway.json</strong><dd><code>Make
    `clientSecret` optional in OAuth password schema</code>&nbsp; &nbsp;
    &nbsp; &nbsp; </dd></summary>
    <hr>
    
    apidef/oas/schema/x-tyk-api-gateway.json
    
    <li>Removed <code>clientSecret</code> from the list of required
    fields.<br> <li> Updated the schema to make <code>clientSecret</code>
    optional for OAuth password <br>flows.<br>
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6707/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+0/-1</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
    request to receive relevant information
    
    Co-authored-by: Jeffy Mathew <[email protected]>
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants