Skip to content

Commit

Permalink
[TT-13375] Improved Upstream Auth validation rules (#6694)
Browse files Browse the repository at this point in the history
### **User description**
<details open>
<summary><a href="https://tyktech.atlassian.net/browse/TT-13375"
title="TT-13375" target="_blank">TT-13375</a></summary>
  <br />
  <table>
    <tr>
      <th>Summary</th>
      <td>Validate Upstream Auth settings</td>
    </tr>
    <tr>
      <th>Type</th>
      <td>
<img alt="Story"
src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium"
/>
        Story
      </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
-->

---

https://tyktech.atlassian.net/browse/TT-13375

## Description

Made Upstream Auth basic auth fields required: pwd, username and header
Made Upstream Oauth enabled and allowedAuthorizeTypes required


___

### **PR Type**
enhancement


___

### **Description**
- Enhanced validation rules for Upstream Basic Authentication by making
`username` and `password` fields required.
- Changed the `headerName` field to `header` in
`X-Tyk-UpstreamBasicAuthentication`, referencing `X-Tyk-AuthSource`.
- Updated `X-Tyk-UpstreamOAuth` to require `allowedAuthorizeTypes` and
allow `extraMetadata` to be `null`.



___



### **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>Enhance
validation rules for Upstream Auth configurations</code></dd></summary>
<hr>

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

<li>Made <code>username</code> and <code>password</code> fields required
in <br><code>X-Tyk-UpstreamBasicAuthentication</code>.<br> <li> Changed
<code>headerName</code> to <code>header</code> with a reference to
<code>X-Tyk-AuthSource</code>.<br> <li> Made
<code>allowedAuthorizeTypes</code> required in
<code>X-Tyk-UpstreamOAuth</code>.<br> <li> Allowed
<code>extraMetadata</code> to be <code>null</code> in
<code>X-Tyk-UpstreamOAuth</code>.<br>


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6694/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+23/-7</a>&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
  • Loading branch information
lghiur authored Nov 6, 2024
1 parent 2611a47 commit d7bed08
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions apidef/oas/schema/x-tyk-api-gateway.json
Original file line number Diff line number Diff line change
Expand Up @@ -2022,8 +2022,8 @@
"enabled": {
"type": "boolean"
},
"headerName": {
"type": "string"
"header": {
"$ref": "#/definitions/X-Tyk-AuthSource"
},
"username": {
"type": "string"
Expand All @@ -2033,7 +2033,9 @@
}
},
"required": [
"enabled"
"enabled",
"username",
"password"
]
},
"X-Tyk-UpstreamOAuth": {
Expand All @@ -2043,7 +2045,10 @@
"type": "boolean"
},
"allowedAuthorizeTypes": {
"type": ["array", "null"],
"type": [
"array",
"null"
],
"items": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -2075,7 +2080,10 @@
"$ref": "#/definitions/X-Tyk-AuthSource"
},
"extraMetadata": {
"type": "array"
"type": [
"array",
"null"
]
}
},
"required": [
Expand Down Expand Up @@ -2112,7 +2120,10 @@
"$ref": "#/definitions/X-Tyk-AuthSource"
},
"extraMetadata": {
"type": "array"
"type": [
"array",
"null"
]
}
},
"required": [
Expand All @@ -2123,7 +2134,12 @@
"password"
]
}
}
},
"required": [
"enabled",
"allowedAuthorizeTypes"
]
}

}
}

0 comments on commit d7bed08

Please sign in to comment.