-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: request/response finding pattern fix
- Loading branch information
1 parent
5064f9f
commit 6be02b0
Showing
7 changed files
with
130 additions
and
83 deletions.
There are no files selected for viewing
160 changes: 85 additions & 75 deletions
160
app/components/file-details/vulnerability-analysis-details/findings/vulnerable-api/index.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,94 @@ | ||
<div class='px-4 py-2'> | ||
<AkStack @direction='column'> | ||
{{#each this.currentVulnerabilityDetails as |item|}} | ||
{{#if item.value}} | ||
<AkStack @width='full' class='mb-1'> | ||
<AkStack @width='4/12'> | ||
<AkTypography | ||
data-test-analysisDetails-vulFindingLabel='{{item.label}}' | ||
@color='textSecondary' | ||
> | ||
{{item.label}} | ||
</AkTypography> | ||
</AkStack> | ||
|
||
<AkStack @width='9/12'> | ||
<AkTypography | ||
data-test-analysisDetails-vulFindingValue | ||
@fontWeight='medium' | ||
> | ||
{{item.value}} | ||
</AkTypography> | ||
</AkStack> | ||
</AkStack> | ||
{{/if}} | ||
{{/each}} | ||
<AkStack @direction='column'> | ||
{{#each this.currentVulnerabilityDetails as |item|}} | ||
{{#if item.value}} | ||
<AkStack @width='full' class='mb-1'> | ||
<AkStack @width='4/12'> | ||
<AkTypography | ||
data-test-analysisDetails-vulFindingLabel='{{item.label}}' | ||
@color='textSecondary' | ||
> | ||
{{item.label}} | ||
</AkTypography> | ||
</AkStack> | ||
|
||
{{#if @currentVulnerability.request.body}} | ||
{{#unless this.isRequestBodyEmpty}} | ||
<AkTypography @color='textSecondary'> | ||
{{t 'requestBody'}}: | ||
<AkStack @width='9/12'> | ||
<AkTypography | ||
data-test-analysisDetails-vulFindingValue | ||
@fontWeight='medium' | ||
> | ||
{{item.value}} | ||
</AkTypography> | ||
</AkStack> | ||
</AkStack> | ||
{{/if}} | ||
{{/each}} | ||
|
||
{{#if @currentVulnerability.request.body}} | ||
{{#unless this.isRequestBodyEmpty}} | ||
<AkTypography @color='textSecondary'> | ||
{{t 'requestBody'}}: | ||
</AkTypography> | ||
|
||
<div local-class='vulnerability-finding-container'> | ||
<pre | ||
local-class='vulnerability-finding-description {{if | ||
@analysis.isOverriddenAsPassed | ||
"analysis-overridded-passed" | ||
}}' | ||
> | ||
{{@currentVulnerability.request.body}} | ||
</pre> | ||
</div> | ||
{{/unless}} | ||
{{/if}} | ||
|
||
<div local-class='vulnerability-finding-container'> | ||
<pre local-class='vulnerability-finding-description'> | ||
{{@currentVulnerability.request.body}} | ||
</pre> | ||
</div> | ||
{{/unless}} | ||
{{/if}} | ||
{{#unless this.isRequestHeadersEmpty}} | ||
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox | ||
@title={{t 'requestHeaders'}} | ||
@copyIcon={{true}} | ||
@markedAsPassed={{@analysis.isOverriddenAsPassed}} | ||
>{{#each-in @currentVulnerability.request.headers as |key value|}}<span | ||
>{{key}}: {{value}}</span> | ||
{{/each-in}} | ||
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox> | ||
{{/unless}} | ||
|
||
{{#unless this.isRequestHeadersEmpty}} | ||
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox | ||
@title={{t 'requestHeaders'}} | ||
@copyIcon={{true}} | ||
@markedAsPassed={{@analysis.isOverriddenAsPassed}} | ||
>{{#each-in | ||
@currentVulnerability.request.headers | ||
as |key value| | ||
}}<span>{{key}}: {{value}}</span> | ||
{{/each-in}} | ||
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox> | ||
{{/unless}} | ||
{{#unless this.isRequestParamsEmpty}} | ||
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox | ||
@title={{t 'requestParameters'}} | ||
@copyIcon={{true}} | ||
@markedAsPassed={{@analysis.isOverriddenAsPassed}} | ||
>{{this.requestParamsKey}}<br />{{this.requestParamsToken}} | ||
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox> | ||
{{/unless}} | ||
|
||
{{#unless this.isRequestParamsEmpty}} | ||
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox | ||
@title={{t 'requestParameters'}} | ||
@copyIcon={{true}} | ||
@markedAsPassed={{@analysis.isOverriddenAsPassed}} | ||
>{{this.requestParamsKey}}<br />{{this.requestParamsToken}} | ||
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox> | ||
{{/unless}} | ||
{{#if @currentVulnerability.response.status_code}} | ||
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox | ||
@title={{t 'response'}} | ||
@markedAsPassed={{@analysis.isOverriddenAsPassed}} | ||
>{{this.responseStatusCode}}<br />{{this.responseMessage}} | ||
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox> | ||
{{/if}} | ||
|
||
{{#if @currentVulnerability.response.status_code}} | ||
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox | ||
@title={{t 'response'}} | ||
@markedAsPassed={{@analysis.isOverriddenAsPassed}} | ||
>{{this.responseStatusCode}}<br />{{this.responseMessage}} | ||
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox> | ||
{{/if}} | ||
{{#unless this.isResponseHeadersEmpty}} | ||
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox | ||
@title={{t 'responseHeaders'}} | ||
@copyIcon={{true}} | ||
@markedAsPassed={{@analysis.isOverriddenAsPassed}} | ||
>{{#each-in @currentVulnerability.response.headers as |key value|}}<span | ||
>{{key}}: {{value}}</span> | ||
{{/each-in}} | ||
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox> | ||
{{/unless}} | ||
|
||
{{#unless this.isResponseHeadersEmpty}} | ||
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox | ||
@title={{t 'responseHeaders'}} | ||
@copyIcon={{true}} | ||
@markedAsPassed={{@analysis.isOverriddenAsPassed}} | ||
>{{#each-in | ||
@currentVulnerability.response.headers | ||
as |key value| | ||
}}<span>{{key}}: {{value}}</span> | ||
{{/each-in}} | ||
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox> | ||
{{/unless}} | ||
</AkStack> | ||
{{#unless this.isResponseBodyEmpty}} | ||
<FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox | ||
@title={{t 'responseBody'}} | ||
@copyIcon={{true}} | ||
@markedAsPassed={{@analysis.isOverriddenAsPassed}} | ||
>{{@currentVulnerability.response.text}} | ||
</FileDetails::VulnerabilityAnalysisDetails::Findings::CodeBox> | ||
{{/unless}} | ||
</AkStack> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters