From 72fdc6eefcca50b141869919e1fe04a3baefd4f9 Mon Sep 17 00:00:00 2001 From: Luke Hagar Date: Wed, 4 Mar 2026 13:04:43 -0600 Subject: [PATCH 1/2] Standardize User-Agent and add telemetry headers Replace generic OpenAPI-Generator User-Agent with SailPoint-SDK/python/{ver} format. Add consumer_identifier/consumer_version fields to Configuration for consumers to identify themselves in the User-Agent via parenthetical suffix. Add previously missing X-SailPoint-SDK header (python/{ver}) and add X-SailPoint-SDK-Runtime and X-SailPoint-SDK-OS telemetry headers. Co-Authored-By: Claude Opus 4.6 --- sailpoint/configuration.py | 5 +++++ sdk-resources/resources/api_client.mustache | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sailpoint/configuration.py b/sailpoint/configuration.py index 571a772de..ff1c9a74b 100644 --- a/sailpoint/configuration.py +++ b/sailpoint/configuration.py @@ -53,6 +53,11 @@ def __init__(self, configurationParams: ConfigurationParams = None) -> None: self.experimental = False self.suppress_experimental_warnings = False + # Optional consumer identifier for User-Agent suffix (e.g. "sailpoint-cli") + self.consumer_identifier = None + # Optional consumer version for User-Agent suffix (e.g. "1.2.3") + self.consumer_version = None + self.temp_folder_path = None """Temp file folder for downloading files """ diff --git a/sdk-resources/resources/api_client.mustache b/sdk-resources/resources/api_client.mustache index 4099d3052..6aecef673 100644 --- a/sdk-resources/resources/api_client.mustache +++ b/sdk-resources/resources/api_client.mustache @@ -9,7 +9,9 @@ import decimal import json import mimetypes import os +import platform import re +import sys import tempfile import xmltodict @@ -95,7 +97,12 @@ class ApiClient: self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = '{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}' + self.user_agent = '{{{httpUserAgent}}}{{^httpUserAgent}}SailPoint-SDK/python/{{{packageVersion}}}{{/httpUserAgent}}' + if configuration and getattr(configuration, 'consumer_identifier', None) and getattr(configuration, 'consumer_version', None): + self.user_agent = f'{self.user_agent} ({configuration.consumer_identifier}/{configuration.consumer_version})' + self.default_headers['X-SailPoint-SDK'] = 'python/{{{packageVersion}}}' + self.default_headers['X-SailPoint-SDK-Runtime'] = f'python/{sys.version.split()[0]}' + self.default_headers['X-SailPoint-SDK-OS'] = f'{sys.platform}/{platform.machine()}' self.client_side_validation = configuration.client_side_validation {{#asyncio}} From 6856737fb085d62cf1f724fc3d3371a5547688e3 Mon Sep 17 00:00:00 2001 From: Luke Hagar Date: Thu, 5 Mar 2026 10:39:35 -0600 Subject: [PATCH 2/2] Consolidate telemetry into User-Agent header, remove custom X-SailPoint-* headers Format: SailPoint-SDK-Python/{version} ({os}; {arch}) Python/{py-version} (openapi-generator/{gen-version}) Co-Authored-By: Claude Opus 4.6 --- sdk-resources/resources/api_client.mustache | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sdk-resources/resources/api_client.mustache b/sdk-resources/resources/api_client.mustache index 6aecef673..24e8adbbf 100644 --- a/sdk-resources/resources/api_client.mustache +++ b/sdk-resources/resources/api_client.mustache @@ -97,12 +97,10 @@ class ApiClient: self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = '{{{httpUserAgent}}}{{^httpUserAgent}}SailPoint-SDK/python/{{{packageVersion}}}{{/httpUserAgent}}' + self.user_agent = 'SailPoint-SDK-Python/{{{packageVersion}}}' if configuration and getattr(configuration, 'consumer_identifier', None) and getattr(configuration, 'consumer_version', None): self.user_agent = f'{self.user_agent} ({configuration.consumer_identifier}/{configuration.consumer_version})' - self.default_headers['X-SailPoint-SDK'] = 'python/{{{packageVersion}}}' - self.default_headers['X-SailPoint-SDK-Runtime'] = f'python/{sys.version.split()[0]}' - self.default_headers['X-SailPoint-SDK-OS'] = f'{sys.platform}/{platform.machine()}' + self.user_agent = f'{self.user_agent} ({sys.platform}; {platform.machine()}) Python/{sys.version.split()[0]} (openapi-generator/{{generatorVersion}})' self.client_side_validation = configuration.client_side_validation {{#asyncio}}