Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TT-11909]: Added Session Lifetime to OAS (#6835)
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-11909" title="TT-11909" target="_blank">TT-11909</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS] Session lifetime </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>In Dev</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 --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description <!-- Describe your changes in detail --> [TT-1909](https://tyktech.atlassian.net/browse/TT-11909) ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## 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 [TT-1909]: https://tyktech.atlassian.net/browse/TT-1909?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ### **PR Type** Enhancement, Tests ___ ### **Description** - Added `session_lifetime_disabled` field to API definition. - Introduced `KeyRetentionPeriod` struct for token TTL management. - Updated OpenAPI schema to include `keyRetentionPeriod`. - Enhanced migration and linter tests to cover new fields. ___ ### **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>api_definitions.go</strong><dd><code>Introduced `session_lifetime_disabled` field</code> </dd></summary> <hr> apidef/api_definitions.go <li>Added <code>session_lifetime_disabled</code> field to API definition.<br> <li> Enhanced session lifetime management capabilities. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6835/files#diff-9961ccc89a48d32db5b47ba3006315ef52f6e5007fb4b09f8c5d6d299c669d67">+1/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>migration.go</strong><dd><code>Updated migration logic for session lifetime</code> </dd></summary> <hr> apidef/migration.go - Set `SessionLifetimeDisabled` flag in migration logic. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6835/files#diff-e1d9b55a26f9d6225d56d6f0161959217308e5ad4d6934e7d7df4595d9c2a130">+1/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>authentication.go</strong><dd><code>Introduced `KeyRetentionPeriod` for token TTL</code> </dd></summary> <hr> apidef/oas/authentication.go <li>Added <code>KeyRetentionPeriod</code> struct for token TTL management.<br> <li> Implemented <code>Fill</code> and <code>ExtractTo</code> methods for <code>KeyRetentionPeriod</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6835/files#diff-e51c9d24d4235e7cc53048cc1d92967d177585ba5e073f14876308a97bef6326">+35/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>x-tyk-api-gateway.json</strong><dd><code>Updated OpenAPI schema for `keyRetentionPeriod`</code> </dd></summary> <hr> apidef/oas/schema/x-tyk-api-gateway.json <li>Extended OpenAPI schema with <code>keyRetentionPeriod</code> definition.<br> <li> Defined properties and validation for <code>keyRetentionPeriod</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6835/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+16/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>schema.json</strong><dd><code>Updated schema with `session_lifetime_disabled`</code> </dd></summary> <hr> apidef/schema.json - Added `session_lifetime_disabled` field to schema. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6835/files#diff-32c8b876e77d1639afb2d20c37b74ed9e149b72cc7de429def13d3d454e075f3">+3/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>migration_test.go</strong><dd><code>Enhanced migration tests for session lifetime</code> </dd></summary> <hr> apidef/migration_test.go - Added test coverage for `SessionLifetimeDisabled` flag. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6835/files#diff-d79d77f814074b9e483554e36687e22fda759045141c3b094b039428744ff94c">+1/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>linter_test.go</strong><dd><code>Added linter test for `KeyRetentionPeriod`</code> </dd></summary> <hr> apidef/oas/linter_test.go - Updated linter tests to include `KeyRetentionPeriod`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6835/files#diff-b92239afd81e77a829fe7fe8410044dfd4dfda525d17dbf5f8811714a9c986d3">+1/-0</a> </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: Tit Petric <[email protected]>
- Loading branch information