support to load swaggers from an extension#639
Conversation
- Add swagger data extension to the extensions list - Update documentation to include new extension usage
| } | ||
|
|
||
| targetFile := filepath.Base(extFile) | ||
| fmt.Println("start to save", filepath.Join(output, targetFile)) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 months ago
To fix the problem, we should avoid logging the full path that includes potentially sensitive information. Instead, we can log only the filename or a sanitized version of the path. This way, we maintain the functionality of logging progress without exposing sensitive data.
- Modify the logging statement to exclude the sensitive parts of the path.
- Specifically, in the
DownloadSwaggerDatafunction, change the logging statement on line 52 to log only thetargetFileinstead of the full path. - No additional methods or imports are needed for this change.
| @@ -51,3 +51,3 @@ | ||
| targetFile := filepath.Base(extFile) | ||
| fmt.Println("start to save", filepath.Join(output, targetFile)) | ||
| fmt.Println("start to save", targetFile) | ||
| if err = downloader.WriteTo(reader, output, targetFile); err == nil { |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
|
There are 1 test cases, failed count 0:
Reported by api-testing. |
…uring archive extraction ("Zip Slip")
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Rick <1450685+LinuxSuRen@users.noreply.github.com>
|



What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #