@@ -13,6 +13,7 @@ import {
1313 Occurrence ,
1414 Validity ,
1515} from "./api-types" ;
16+ import { pluralize } from "../utils" ;
1617
1718const validityDisplayName : Record < Validity , string > = {
1819 unknown : "Unknown" ,
@@ -45,6 +46,7 @@ function filterUriOccurrences(occurrences: Occurrence[]): Occurrence[] {
4546 * @param results ggshield scan results
4647 * @returns incidents diagnostics
4748 */
49+
4850export function parseGGShieldResults (
4951 results : GGShieldScanResults ,
5052) : Diagnostic [ ] {
@@ -63,6 +65,22 @@ export function parseGGShieldResults(
6365 new Position ( occurrence . line_start - 1 , occurrence . index_start ) ,
6466 new Position ( occurrence . line_end - 1 , occurrence . index_end ) ,
6567 ) ;
68+
69+ let vaultInfo = "" ;
70+
71+ if ( incident . secret_vaulted ) {
72+ if ( incident . vault_path_count !== null ) {
73+ vaultInfo += `Secret found in vault: YES (${ incident . vault_path_count } ${ pluralize ( incident . vault_path_count , "location" ) } )
74+ ├─ Vault Type: ${ incident . vault_type }
75+ ├─ Vault Name: ${ incident . vault_name }
76+ └─ Secret Path: ${ incident . vault_path } ` ;
77+ } else {
78+ vaultInfo += "Secret found in vault: YES" ;
79+ }
80+ } else {
81+ vaultInfo += "Secret found in vault: NO" ;
82+ }
83+
6684 let diagnostic = new Diagnostic (
6785 range ,
6886 `ggshield: ${ occurrence . type }
@@ -73,11 +91,11 @@ Known by GitGuardian dashboard: ${incident.known_secret ? "YES" : "NO"}
7391Total occurrences: ${ incident . total_occurrences }
7492Incident URL: ${ incident . incident_url || "N/A" }
7593Secret SHA: ${ incident . ignore_sha }
76- Secret in Secrets Manager: ${ incident . secret_vaulted ? "YES" : "NO" } `,
94+ ${ vaultInfo } `,
7795 DiagnosticSeverity . Warning ,
7896 ) ;
7997
80- diagnostic . source = "gitguardian " ;
98+ diagnostic . source = "\ngitguardian " ;
8199 diagnostics . push ( diagnostic ) ;
82100 } ,
83101 ) ;
0 commit comments