Closed buger closed 2 months ago
Swagger Changes
Changes in swagger.yml too large (line count 4303), check CI lint action for differences
โฑ๏ธ Estimated effort to review: 3 ๐ต๐ต๐ตโชโช |
๐งช No relevant tests |
๐ No security concerns identified |
โก Key issues to review Possible Bug The `redocly lint` command in line 23 might fail if the `redocly.yml` configuration file is not correctly set up or missing required rules. Ensure that all configurations and dependencies are correctly specified. Security Concern The use of a GitHub token in the environment variable in line 32 could expose sensitive information if not handled securely. Ensure that the token is used securely and that permissions are limited. |
Category | Suggestion | Score |
Security |
Securely include the token in Git requests without exposing it in the URL___ **To enhance security, avoid exposing tokens in the repository URL. Use theextraheader option in git config to securely include the token in requests.**
[.github/workflows/lint-swagger.yml [34]](https://github.com/TykTechnologies/tyk/pull/6541/files#diff-211d7beb5c2247bdb14cd6aaa6da2feb35176618e91541850a5f4eebf736990dR34-R34)
```diff
-git config --global url."https://${TOKEN}@github.com".insteadOf "https://github.com"
+git config --global http.extraheader "AUTHORIZATION: bearer ${TOKEN}"
```
Suggestion importance[1-10]: 9Why: This suggestion addresses a significant security concern by preventing token exposure in URLs, which is crucial for protecting sensitive information in CI/CD environments. | 9 |
Best practice |
Use a specific node version instead of the latest major version___ **Consider using a more specific node version instead of the latest major version toensure consistent behavior across all runs. Using a specific version helps avoid potential issues due to unexpected changes in new releases.** [.github/workflows/lint-swagger.yml [19]](https://github.com/TykTechnologies/tyk/pull/6541/files#diff-211d7beb5c2247bdb14cd6aaa6da2feb35176618e91541850a5f4eebf736990dR19-R19) ```diff -node-version: 20 +node-version: '20.0.0' # Specify a full version number ``` Suggestion importance[1-10]: 7Why: Specifying a full node version number can help ensure consistent behavior across different runs, avoiding potential issues from unexpected changes in new releases. This is a good practice for maintaining stability in CI/CD workflows. | 7 |
Use a pre-built GitHub Action or Docker image for installing
___
**Instead of cloning and installing | 6 | |
Add a cleanup step to remove temporary files after use___ **Consider adding a cleanup step to remove theswagger-current.yml and swagger-prev.yml files after they are no longer needed. This can help manage disk space and ensure that sensitive data does not persist in the workspace.** [.github/workflows/lint-swagger.yml [60-66]](https://github.com/TykTechnologies/tyk/pull/6541/files#diff-211d7beb5c2247bdb14cd6aaa6da2feb35176618e91541850a5f4eebf736990dR60-R66) ```diff cp swagger.yml swagger-current.yml ... cp swagger.yml swagger-prev.yml +... +- name: Cleanup + run: rm -f swagger-current.yml swagger-prev.yml ``` Suggestion importance[1-10]: 5Why: Adding a cleanup step is a good practice for managing disk space and ensuring sensitive data does not persist unnecessarily. However, it is a minor improvement and not critical to the workflow's functionality. | 5 |
API Changes
no api changes detected
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
User description
TT-13109Generate New Swagger and Update Validator for Gateway (#6231)
User description
This pull request contains :
.This provides the documentation on how you can generate the gateway Open Api specification. It contains a read me with all the steps to generate the OAS.
The OAS code is in this pr : https://github.com/TykTechnologies/tyk/pull/6123 TT-13109
Type
Documentation
Description
tyk-api-documentation
directory.openapi-go
) for OAS generation.Changes walkthrough
README.md
Add Documentation for Generating Tyk API Swagger File
tyk-api-documentation/README.md
Specification (OAS).
file.
DX-1272: https://tyktech.atlassian.net/browse/DX-1272?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
TT-13109: https://tyktech.atlassian.net/browse/TT-13109?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Co-authored-by: Yaara yaara@tyk.io
PR Type
Documentation, Enhancement
Description
Changes walkthrough ๐
lint-swagger.yml
Add GitHub Actions workflow for Swagger linting and diffing
.github/workflows/lint-swagger.yml
Redocly CLI.
swagger.yml
..redocly.lint-ignore.yaml
Introduce Redocly lint ignore configuration
.redocly.lint-ignore.yaml
redocly.yml
Add Redocly configuration for OpenAPI linting
redocly.yml
swagger.md
Add documentation for Tyk API Swagger generation
docs/swagger.md
swagger.yml
...
swagger.yml ...