File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ import CxMaskedSecret from "./CxMaskedSecret" ;
2+
3+ export default class CxMask {
4+ maskedSecrets : CxMaskedSecret [ ] ;
5+ maskedFile : string ;
6+
7+ constructor ( maskedSecrets : CxMaskedSecret [ ] , maskedFile : string ) {
8+ this . maskedSecrets = maskedSecrets ;
9+ this . maskedFile = maskedFile ;
10+ }
11+
12+ static parseMask ( resultObject : any ) : CxMask {
13+ return new CxMask ( resultObject . maskedSecrets , resultObject . maskedFile ) ;
14+ }
15+ }
Original file line number Diff line number Diff line change 1+ export default class CxMaskedSecret {
2+ masked : string ;
3+ secret : string ;
4+ line : number ;
5+
6+ constructor ( masked : string , secret : string , line : number ) {
7+ this . masked = masked ;
8+ this . secret = secret ;
9+ this . line = line ;
10+ }
11+ }
Original file line number Diff line number Diff line change 1+ import { CxWrapper } from '../main/wrapper/CxWrapper' ;
2+ import { CxCommandOutput } from "../main/wrapper/CxCommandOutput" ;
3+ import { BaseTest } from "./BaseTest" ;
4+
5+ describe ( "Mask cases" , ( ) => {
6+ const cxScanConfig = new BaseTest ( ) ;
7+ it ( 'Mask Successful case' , async ( ) => {
8+ const auth = new CxWrapper ( cxScanConfig ) ;
9+ const data = await auth . maskSecrets ( "dist/tests/data/package.json" )
10+ const cxCommandOutput : CxCommandOutput = data ;
11+ expect ( cxCommandOutput . payload . length ) . toEqual ( 1 ) ;
12+ } ) ;
13+
14+ } ) ;
You can’t perform that action at this time.
0 commit comments