Skip to content

Commit

Permalink
add docs for new applications field, minor refactoring to fix Python …
Browse files Browse the repository at this point in the history
…warnings
  • Loading branch information
tjarrettveracode committed Jan 3, 2025
1 parent 2851b44 commit 2bb64f8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ As an alternative to importing individual objects into your library, you can acc
- `get_apps(policy_check_after(opt))` : get a list of Veracode applications (JSON format). If provided, returns only applications that have a policy check date on or after `policy_check_after` (format is `yyyy-mm-dd`).
- `get_app(guid(opt),legacy_id(opt))`: get information for a single Veracode application using either the `guid` or the `legacy_id` (integer).
- `get_app_by_name(name)`: get list of applications whose names contain the search string `name`.
- `create_app(app_name, business_criticality, business_unit(opt), teams(opt), policy_guid(opt), custom_fields(opt array), bus_owner_name(opt), bus_owner_email(opt),git_repo_url(opt),custom_kms_alias(opt))`: create an application profile.
- `create_app(app_name, business_criticality, description(opt), business_unit(opt), teams(opt), policy_guid(opt), custom_fields(opt array), bus_owner_name(opt), bus_owner_email(opt),git_repo_url(opt),custom_kms_alias(opt))`: create an application profile.
- `business_criticality`: one of "VERY HIGH", "HIGH", "MEDIUM", "LOW", "VERY LOW"
- `description`: extended description of the application
- `business_unit`: the GUID of the business unit to which the application should be assigned
- `teams`: a list of the GUIDs of the teams to which the application should be assigned
- `policy_guid`: the GUID of the policy to set for this application.
Expand Down
5 changes: 3 additions & 2 deletions docs/applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ The following methods call Veracode REST APIs and return JSON.
- `Applications().get_all(policy_check_after(opt))` : get a list of Veracode applications (JSON format). If provided, returns only applications that have a policy check date on or after `policy_check_after` (format is `yyyy-mm-dd`).
- `Applications().get(guid(opt),legacy_id(opt))`: get information for a single Veracode application using either the `guid` or the `legacy_id` (integer).
- `Applications().get_by_name(name)`: get list of applications whose names contain the search string `name`.
- `Applications().create(app_name, business_criticality, business_unit(opt), teams(opt), policy_guid(opt), custom_fields(opt array), bus_owner_name(opt), bus_owner_email(opt),git_repo_url(opt),custom_kms_alias(opt))`: create an application profile.
- `Applications().create(app_name, business_criticality, description(opt), business_unit(opt), teams(opt), policy_guid(opt), custom_fields(opt array), bus_owner_name(opt), bus_owner_email(opt),git_repo_url(opt),custom_kms_alias(opt))`: create an application profile.
- `business_criticality`: one of "VERY HIGH", "HIGH", "MEDIUM", "LOW", "VERY LOW"
- `description`: extended description of the application.
- `business_unit`: the GUID of the business unit to which the application should be assigned
- `teams`: a list of the GUIDs of the teams to which the application should be assigned
- `policy_guid`: the GUID of the policy to set for this application.
Expand All @@ -17,7 +18,7 @@ The following methods call Veracode REST APIs and return JSON.
- `bus_owner_email`: the email address of the business owner of the application
- `git_repo_url`: the URL to the git repository containing the code for the application
- `custom_kms_alias`: the alias for the Customer Managed Encryption Key (CMK), which will be used to encrypt/decrypt customer provided data. Note: The Customer Managed Encrytion Key feature must be activated and configured for your organization before attempting to set this value.
- `Applications().update(guid, app_name, business_criticality, business_unit(opt), teams(opt), policy_guid(opt), custom_fields(opt array), bus_owner_name(opt), bus_owner_email(opt),git_repo_url(opt))`: update an application profile. Note that partial updates are NOT supported, so you need to provide all values including those that aren't changing.
- `Applications().update(guid, app_name, business_criticality, description(opt),business_unit(opt), teams(opt), policy_guid(opt), custom_fields(opt array), bus_owner_name(opt), bus_owner_email(opt),git_repo_url(opt))`: update an application profile. Note that partial updates are NOT supported, so you need to provide all values including those that aren't changing.
- `Applications().delete(guid)`: delete the application identified by `guid`. This is not a reversible action.

## Custom Fields
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = 'veracode_api_py'
version = '0.9.57'
version = '0.9.58'
authors = [ {name = "Tim Jarrett", email="tjarrett@veracode.com"} ]
description = 'Python helper library for working with the Veracode APIs. Handles retries, pagination, and other features of the modern Veracode REST APIs.'
readme = 'README.md'
Expand All @@ -22,4 +22,4 @@ dependencies = {file = ["requirements.txt"]}
[project.urls]
"Homepage" = "https://github.com/veracode/veracode-api-py"
"Bug Tracker" = "https://github.com/veracode/veracode-api-py/issues"
"Download" = "https://github.com/veracode/veracode-api-py/archive/v_0957.tar.gz"
"Download" = "https://github.com/veracode/veracode-api-py/archive/v_0958.tar.gz"
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
setup(
name = 'veracode_api_py',
packages = ['veracode_api_py'],
version = '0.9.57',
version = '0.9.58',
license='MIT',
description = 'Python helper library for working with the Veracode APIs. Handles retries, pagination, and other features of the modern Veracode REST APIs.',
long_description = long_description,
long_description_content_type="text/markdown",
author = 'Tim Jarrett',
author_email = 'tjarrett@veracode.com',
url = 'https://github.com/tjarrettveracode',
download_url = 'https://github.com/veracode/veracode-api-py/archive/v_0957.tar.gz',
download_url = 'https://github.com/veracode/veracode-api-py/archive/v_09578tar.gz',
keywords = ['veracode', 'veracode-api'],
install_requires=[
'veracode-api-signing'
Expand Down
4 changes: 2 additions & 2 deletions veracode_api_py/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create(self,app_name:str ,business_criticality, description: str=None, busin
custom_fields=custom_fields, bus_owner_name=bus_owner_name,
bus_owner_email=bus_owner_email, git_repo_url=git_repo_url, custom_kms_alias=custom_kms_alias)

def update(self,guid: UUID,app_name:str, description: str=None, business_criticality, business_unit: UUID=None,
def update(self,guid: UUID,app_name:str, business_criticality, description: str=None, business_unit: UUID=None,
teams=[], policy_guid:UUID=None, custom_fields=[],
bus_owner_name=None,bus_owner_email=None, git_repo_url=None):
return self._create_or_update("UPDATE",app_name=app_name,business_criticality=business_criticality,
Expand All @@ -53,7 +53,7 @@ def delete(self,guid: UUID):
uri = 'appsec/v1/applications/{}'.format(guid)
return APIHelper()._rest_request(uri,'DELETE')

def _create_or_update(self,method,app_name: str,description: str=None,business_criticality, business_unit: UUID=None,
def _create_or_update(self,method,app_name: str, business_criticality, description: str=None, business_unit: UUID=None,
teams=[],guid=None,policy_guid:UUID=None, custom_fields=[],
bus_owner_name=None,bus_owner_email=None,git_repo_url=None,custom_kms_alias:str=None):
if method == 'CREATE':
Expand Down

0 comments on commit 2bb64f8

Please sign in to comment.