@@ -668,35 +668,35 @@ def upload_scan(self, engagement_id, scan_type, file, active, scan_date, tags=No
668668 files = data
669669 )
670670
671- ##### Credential API #####
671+ ##### Re-upload API #####
672672
673- def list_credentials (self , name = None , username = None , limit = 20 ):
674- """Retrieves all the globally configured credentials .
673+ def reupload_scan (self , test_id , scan_type , file , active , scan_date , tags = None , build = None ):
674+ """Re-uploads and processes a scan file .
675675
676- :param name_contains: Search by credential name.
677- :param username: Search by username
678- :param limit: Number of records to return.
676+ :param test_id: Test identifier.
677+ :param file: Path to the scan file to be uploaded.
679678
680679 """
680+ if tags is None :
681+ tags = ''
681682
682- params = {}
683- if limit :
684- params ['limit' ] = limit
685-
686- if name :
687- params ['name__contains' ] = name
688-
689- if username :
690- params ['username__contains' ] = username
683+ if build is None :
684+ build = ''
691685
692- return self ._request ('GET' , 'credentials/' , params )
686+ data = {
687+ 'test' : ('' , self .get_test_uri (test_id )),
688+ 'file' : open (file , 'rb' ),
689+ 'scan_type' : ('' , scan_type ),
690+ 'active' : ('' , active ),
691+ 'scan_date' : ('' , scan_date ),
692+ 'tags' : ('' , tags ),
693+ 'build_id' : ('' , build )
694+ }
693695
694- def get_credential (self , cred_id , limit = 20 ):
695- """
696- Retrieves a credential using the given credential id.
697- :param credential_id: Credential identification.
698- """
699- return self ._request ('GET' , 'credentials/' + str (cred_id ) + '/' )
696+ return self ._request (
697+ 'POST' , 'reimportscan/' ,
698+ files = data
699+ )
700700
701701 ##### Credential Mapping API #####
702702
0 commit comments