Skip to content

Commit 38f9ffd

Browse files
Bump version no, docs
1 parent b3cdd96 commit 38f9ffd

7 files changed

Lines changed: 43 additions & 5 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ Please follow the instructions below to make a contribution.
2727
- [Bnreplah](https://github.com/bnreplah)
2828
- [Ashton Syed](https://github.com/ashtonsyed)
2929
- [Jbrule](https://github.com/jbrule)
30+
- [Cadonuno](https://github.com/cadonuno)

docs/xml.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The following methods call Veracode XML APIs and return XML output. For a more d
88
- `XMLAPI().get_build_list(app_id, sandbox_id(opt))`: get list of builds for the `app_id` (integer) passed. If `sandbox_id` (integer) passed, returns a list of builds in the sandbox.
99
- `XMLAPI().get_build_info(app_id, build_id, sandbox_id(opt))`: get build info for the `build_id` (integer) and `app_id` (integer) passed. If `sandbox_id` (integer) passed, returns information for the `build_id` in the sandbox.
1010
- `XMLAPI().get_detailed_report(build_id)`: get detailed report XML for the `build_id` (integer) passed.
11+
- `XMLAPI().get_detailed_report_pdf(build_id)`: get detailed report PDF for the `build_id` (integer) passed.
1112
- `XMLAPI().set_mitigation_info(build_id,flaw_id_list,action,comment)`: create a mitigation of type `action` with comment `comment` for the flaws in `flaw_id_list` (comma separated list of integers) of build `build_id` (integer). Supported values for `action`: 'Mitigate by Design', 'Mitigate by Network Environment', 'Mitigate by OS Environment', 'Approve Mitigation', 'Reject Mitigation', 'Potential False Positive', 'Reported to Library Maintainer'. Any other value passed to `action` is interpreted as a comment.
1213
- `XMLAPI().generate_archer(payload)`: generate an Archer report based on the comma separated list of parameters provided. Possible parameters include `period` (`yesterday`, `last_week`, `last_month`; all time if omitted), `from_date` (mm-dd-yyyy format), `to_date` (mm-dd-yyyy format), `scan_type` (one of `static`, `dynamic`, `manual`). Returns a payload that contains a token to download an Archer report.
1314
- `XMLAPI().download_archer(token(opt))`: get Archer report corresponding to the token passed. If no token passed, retrieves the latest Archer report generated.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = 'veracode_api_py'
3-
version = '0.9.66'
3+
version = '0.9.67'
44
authors = [ {name = "Tim Jarrett", email="tjarrett@veracode.com"} ]
55
description = 'Python helper library for working with the Veracode APIs. Handles retries, pagination, and other features of the modern Veracode REST APIs.'
66
readme = 'README.md'
@@ -22,4 +22,4 @@ dependencies = {file = ["requirements.txt"]}
2222
[project.urls]
2323
"Homepage" = "https://github.com/veracode/veracode-api-py"
2424
"Bug Tracker" = "https://github.com/veracode/veracode-api-py/issues"
25-
"Download" = "https://github.com/veracode/veracode-api-py/archive/v_0966.tar.gz"
25+
"Download" = "https://github.com/veracode/veracode-api-py/archive/v_0967.tar.gz"

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
requests==2.33
1+
requests==2.34.2
22
veracode-api-signing>=24.11.0
33
Pygments>= 2.9.0
44
idna>=3.7
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import time
2+
import sys
3+
import json
4+
import datetime
5+
from veracode_api_py import Analytics
6+
7+
wait_seconds = 15
8+
9+
print('Generating report...')
10+
11+
theguid = Analytics().create_scans_report(start_date="2025-10-01",application_id="1024496",policy_sandbox="POLICY",scan_type=["Static Analysis"])
12+
13+
print('Checking status for report {}...'.format(theguid))
14+
thestatus,thescans=Analytics().get(theguid)
15+
16+
while thestatus != 'COMPLETED':
17+
print('Waiting {} seconds before we try again...'.format(wait_seconds))
18+
time.sleep(wait_seconds)
19+
print('Checking status for report {}...'.format(theguid))
20+
thestatus,thescans=Analytics().get(theguid)
21+
22+
recordcount = len(thescans)
23+
24+
print('Retrieved {} findings'.format(recordcount))
25+
26+
if recordcount > 0:
27+
now = datetime.datetime.now().astimezone()
28+
filename = 'report-{}'.format(now)
29+
with open('{}.json'.format(filename), 'w') as outfile:
30+
json.dump(thescans,outfile)
31+
outfile.close()
32+
33+
print('Wrote {} scans to {}.json'.format(recordcount,filename))

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
setup(
88
name = 'veracode_api_py',
99
packages = ['veracode_api_py'],
10-
version = '0.9.66',
10+
version = '0.9.67',
1111
license='MIT',
1212
description = 'Python helper library for working with the Veracode APIs. Handles retries, pagination, and other features of the modern Veracode REST APIs.',
1313
long_description = long_description,
1414
long_description_content_type="text/markdown",
1515
author = 'Tim Jarrett',
1616
author_email = 'tjarrett@veracode.com',
1717
url = 'https://github.com/tjarrettveracode',
18-
download_url = 'https://github.com/veracode/veracode-api-py/archive/v_0966.tar.gz',
18+
download_url = 'https://github.com/veracode/veracode-api-py/archive/v_0967.tar.gz',
1919
keywords = ['veracode', 'veracode-api'],
2020
install_requires=[
2121
'veracode-api-signing'

veracode_api_py/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ def get_build_info(self, app_id, build_id=None, sandbox_id=None):
6060
def get_detailed_report(self, build_id):
6161
return XMLAPI().get_detailed_report(build_id)
6262

63+
def get_detailed_report_pdf(self, build_id):
64+
return XMLAPI().get_detailed_report_pdf(build_id)
65+
6366
def set_mitigation_info(self, build_id, flaw_id_list, action, comment):
6467
return XMLAPI().set_mitigation_info(build_id, flaw_id_list, action, comment)
6568

0 commit comments

Comments
 (0)