Install & Compatibility
Where this runs
tested against v26.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.608s · 36.6MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 5.9s · import 0.553s · 37MB
39MB installed
● package 39MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
RequestsAuthPluginVeracodeHMAC
✓ from veracode_api_signing.plugin_requests import RequestsAuthPluginVeracodeHMAC
✗ from veracode_api_signing import RequestsAuthPluginVeracodeHMAC
The authentication plugin is located within the `plugin_requests` submodule, not directly under the top-level package.
This quickstart demonstrates how to make an authenticated GET request to the Veracode REST API's `/applications` endpoint using the `veracode-api-signing` library with the popular `requests` library. API credentials are expected to be available as environment variables `VERACODE_API_KEY_ID` and `VERACODE_API_KEY_SECRET`, or alternatively, loaded from a `~/.veracode/credentials` file. The `RequestsAuthPluginVeracodeHMAC` automatically signs the request with the provided or discovered credentials.
import requests
import os
from veracode_api_signing.plugin_requests import RequestsAuthPluginVeracodeHMAC
# Veracode API credentials can be loaded from ~/.veracode/credentials or environment variables.
# For quickstart, using environment variables for demonstration. In production, prefer file.
api_id = os.environ.get('VERACODE_API_KEY_ID', '')
api_key_secret = os.environ.get('VERACODE_API_KEY_SECRET', '')
if not api_id or not api_key_secret:
print("WARNING: VERACODE_API_KEY_ID and VERACODE_API_KEY_SECRET environment variables are not set.")
print("Please set them or configure ~/.veracode/credentials file for successful authentication.")
# Exit or provide mock values for a non-failing example
api_id = 'YOUR_MOCK_API_ID'
api_key_secret = 'YOUR_MOCK_API_SECRET'
# The base URL for Veracode REST APIs. For US Commercial Region.
# Adjust for other regions if necessary (e.g., https://api.veracode.eu/appsec/v1)
api_base = "https://api.veracode.com/appsec/v1"
try:
# Make a GET request to an API endpoint, e.g., /applications
# The RequestsAuthPluginVeracodeHMAC automatically handles signing the request.
response = requests.get(api_base + "/applications", auth=RequestsAuthPluginVeracodeHMAC(api_key_id=api_id, api_key_secret=api_key_secret))
response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx)
print("Successfully fetched applications:")
print(response.json())
except requests.exceptions.HTTPError as e:
print(f"HTTP Error: {e.response.status_code} - {e.response.text}")
except requests.exceptions.RequestException as e:
print(f"An error occurred: {e}")
Debug
Known issues
breakingAs of September 2019, Veracode API authentication transitioned from username/password (basic authentication) to API ID and Key (HMAC signing) for XML APIs, and REST APIs have always required HMAC. Any code still using basic authentication will fail.fixGenerate Veracode API credentials (API ID and Key) and update your code to use HMAC signing via this library or an equivalent method. Ensure your API ID and Key are set as environment variables or in a `~/.veracode/credentials` file.
affects: < 19.9.0 (for XML APIs), all versions for REST APIs without HMAC
gotchaVeracode API credentials should be stored in either a `~/.veracode/credentials` file or as environment variables, but not both simultaneously for the same configuration profile, as this can lead to unpredictable behavior.fixChoose one method for providing credentials (either the file or environment variables) and stick to it. The library will attempt to load from the file first, then environment variables. For programmatic control over multiple accounts, passing `api_key_id` and `api_key_secret` directly to the `RequestsAuthPluginVeracodeHMAC` constructor is an option.
affects: All
deprecatedThe Veracode XML Admin API was deprecated in June 2022 in favor of the Identity REST APIs, with support ending on June 30, 2023. While `veracode-api-signing` can still sign requests for XML APIs, new integrations should exclusively target the more modern REST APIs.fixMigrate any automation using the XML Admin API to the Identity REST APIs. Familiarize yourself with the REST API documentation for the relevant endpoints.
affects: All versions when used with XML Admin API
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'veracode_api_signing'
The `veracode-api-signing` library has not been installed in the current Python environment.
fixpip install veracode-api-signing
VeracodeAPIError: VERACODE_API_KEY_ID and VERACODE_API_KEY_SECRET must be set
The `VeracodeHMACAuth` class requires Veracode API credentials, which were not provided directly or found in the `VERACODE_API_KEY_ID` and `VERACODE_API_KEY_SECRET` environment variables.
fixSet the `VERACODE_API_KEY_ID` and `VERACODE_API_KEY_SECRET` environment variables, or pass the `api_key_id` and `api_key_secret` arguments directly to the `VeracodeHMACAuth` constructor.
ImportError: cannot import name 'VeracodeHMACAuth' from 'veracode_api_signing'
The `VeracodeHMACAuth` class is located within the `plugin` submodule, not directly under the top-level `veracode_api_signing` package.
fixfrom veracode_api_signing.plugin import VeracodeHMACAuth
Upgrade
Version history
26.5.0latest on PyPI · released May 27, 2026
Audit
Dependencies
requestsrequiredCommonly used with `RequestsAuthPluginVeracodeHMAC` for making HTTP requests.