onetrust-api 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. onetrust_api-0.1.0/LICENSE +21 -0
  2. onetrust_api-0.1.0/MANIFEST.in +4 -0
  3. onetrust_api-0.1.0/PKG-INFO +227 -0
  4. onetrust_api-0.1.0/README.md +197 -0
  5. onetrust_api-0.1.0/onetrust_api/__init__.py +61 -0
  6. onetrust_api-0.1.0/onetrust_api/__main__.py +5 -0
  7. onetrust_api-0.1.0/onetrust_api/agent/AGENTS.md +12 -0
  8. onetrust_api-0.1.0/onetrust_api/agent/CRON.md +12 -0
  9. onetrust_api-0.1.0/onetrust_api/agent/CRON_LOG.md +5 -0
  10. onetrust_api-0.1.0/onetrust_api/agent/HEARTBEAT.md +28 -0
  11. onetrust_api-0.1.0/onetrust_api/agent/IDENTITY.md +15 -0
  12. onetrust_api-0.1.0/onetrust_api/agent/MCP_AGENTS.md +13 -0
  13. onetrust_api-0.1.0/onetrust_api/agent/USER.md +7 -0
  14. onetrust_api-0.1.0/onetrust_api/agent/icon.png +0 -0
  15. onetrust_api-0.1.0/onetrust_api/agent/mcp_config.json +11 -0
  16. onetrust_api-0.1.0/onetrust_api/agent_server.py +84 -0
  17. onetrust_api-0.1.0/onetrust_api/api/__init__.py +7 -0
  18. onetrust_api-0.1.0/onetrust_api/api/_operation_manifest.py +5421 -0
  19. onetrust_api-0.1.0/onetrust_api/api/api_client_access_management.py +439 -0
  20. onetrust_api-0.1.0/onetrust_api/api/api_client_ai_governance.py +263 -0
  21. onetrust_api-0.1.0/onetrust_api/api/api_client_assessments.py +405 -0
  22. onetrust_api-0.1.0/onetrust_api/api/api_client_audit_management.py +139 -0
  23. onetrust_api-0.1.0/onetrust_api/api/api_client_base.py +389 -0
  24. onetrust_api-0.1.0/onetrust_api/api/api_client_bulk_export.py +91 -0
  25. onetrust_api-0.1.0/onetrust_api/api/api_client_cmp.py +67 -0
  26. onetrust_api-0.1.0/onetrust_api/api/api_client_compliance_automation.py +43 -0
  27. onetrust_api-0.1.0/onetrust_api/api/api_client_consent_interfaces.py +19 -0
  28. onetrust_api-0.1.0/onetrust_api/api/api_client_consent_receipts.py +43 -0
  29. onetrust_api-0.1.0/onetrust_api/api/api_client_cookie_consent.py +474 -0
  30. onetrust_api-0.1.0/onetrust_api/api/api_client_cookie_consent_legacy.py +139 -0
  31. onetrust_api-0.1.0/onetrust_api/api/api_client_cookie_domain_data.py +19 -0
  32. onetrust_api-0.1.0/onetrust_api/api/api_client_cross_device_consent.py +19 -0
  33. onetrust_api-0.1.0/onetrust_api/api/api_client_data_catalog.py +295 -0
  34. onetrust_api-0.1.0/onetrust_api/api/api_client_data_discovery.py +348 -0
  35. onetrust_api-0.1.0/onetrust_api/api/api_client_data_discovery_worker.py +55 -0
  36. onetrust_api-0.1.0/onetrust_api/api/api_client_data_mapping.py +509 -0
  37. onetrust_api-0.1.0/onetrust_api/api/api_client_data_mapping_legacy.py +57 -0
  38. onetrust_api-0.1.0/onetrust_api/api/api_client_documents.py +31 -0
  39. onetrust_api-0.1.0/onetrust_api/api/api_client_dsar.py +503 -0
  40. onetrust_api-0.1.0/onetrust_api/api/api_client_esg.py +67 -0
  41. onetrust_api-0.1.0/onetrust_api/api/api_client_incidents.py +91 -0
  42. onetrust_api-0.1.0/onetrust_api/api/api_client_integrations.py +55 -0
  43. onetrust_api-0.1.0/onetrust_api/api/api_client_inventory.py +175 -0
  44. onetrust_api-0.1.0/onetrust_api/api/api_client_issues_management.py +115 -0
  45. onetrust_api-0.1.0/onetrust_api/api/api_client_it_risk_management.py +697 -0
  46. onetrust_api-0.1.0/onetrust_api/api/api_client_mobile_app_consent.py +19 -0
  47. onetrust_api-0.1.0/onetrust_api/api/api_client_object_manager.py +483 -0
  48. onetrust_api-0.1.0/onetrust_api/api/api_client_policy_management.py +79 -0
  49. onetrust_api-0.1.0/onetrust_api/api/api_client_privacy_notices.py +45 -0
  50. onetrust_api-0.1.0/onetrust_api/api/api_client_task_management.py +43 -0
  51. onetrust_api-0.1.0/onetrust_api/api/api_client_tprm.py +187 -0
  52. onetrust_api-0.1.0/onetrust_api/api/api_client_training.py +67 -0
  53. onetrust_api-0.1.0/onetrust_api/api/api_client_universal_consent.py +1289 -0
  54. onetrust_api-0.1.0/onetrust_api/api/api_client_user_provisioning.py +319 -0
  55. onetrust_api-0.1.0/onetrust_api/api_client.py +86 -0
  56. onetrust_api-0.1.0/onetrust_api/auth.py +95 -0
  57. onetrust_api-0.1.0/onetrust_api/mcp/__init__.py +146 -0
  58. onetrust_api-0.1.0/onetrust_api/mcp/mcp_access_management.py +112 -0
  59. onetrust_api-0.1.0/onetrust_api/mcp/mcp_ai_governance.py +107 -0
  60. onetrust_api-0.1.0/onetrust_api/mcp/mcp_assessments.py +104 -0
  61. onetrust_api-0.1.0/onetrust_api/mcp/mcp_audit_management.py +62 -0
  62. onetrust_api-0.1.0/onetrust_api/mcp/mcp_bulk_export.py +54 -0
  63. onetrust_api-0.1.0/onetrust_api/mcp/mcp_cmp.py +50 -0
  64. onetrust_api-0.1.0/onetrust_api/mcp/mcp_compliance_automation.py +46 -0
  65. onetrust_api-0.1.0/onetrust_api/mcp/mcp_consent_interfaces.py +42 -0
  66. onetrust_api-0.1.0/onetrust_api/mcp/mcp_consent_receipts.py +46 -0
  67. onetrust_api-0.1.0/onetrust_api/mcp/mcp_cookie_consent.py +116 -0
  68. onetrust_api-0.1.0/onetrust_api/mcp/mcp_cookie_consent_legacy.py +62 -0
  69. onetrust_api-0.1.0/onetrust_api/mcp/mcp_cookie_domain_data.py +40 -0
  70. onetrust_api-0.1.0/onetrust_api/mcp/mcp_cross_device_consent.py +42 -0
  71. onetrust_api-0.1.0/onetrust_api/mcp/mcp_custom_api.py +47 -0
  72. onetrust_api-0.1.0/onetrust_api/mcp/mcp_data_catalog.py +88 -0
  73. onetrust_api-0.1.0/onetrust_api/mcp/mcp_data_discovery.py +92 -0
  74. onetrust_api-0.1.0/onetrust_api/mcp/mcp_data_discovery_worker.py +48 -0
  75. onetrust_api-0.1.0/onetrust_api/mcp/mcp_data_mapping.py +140 -0
  76. onetrust_api-0.1.0/onetrust_api/mcp/mcp_data_mapping_legacy.py +54 -0
  77. onetrust_api-0.1.0/onetrust_api/mcp/mcp_documents.py +44 -0
  78. onetrust_api-0.1.0/onetrust_api/mcp/mcp_dsar.py +118 -0
  79. onetrust_api-0.1.0/onetrust_api/mcp/mcp_esg.py +50 -0
  80. onetrust_api-0.1.0/onetrust_api/mcp/mcp_incidents.py +54 -0
  81. onetrust_api-0.1.0/onetrust_api/mcp/mcp_integrations.py +48 -0
  82. onetrust_api-0.1.0/onetrust_api/mcp/mcp_inventory.py +84 -0
  83. onetrust_api-0.1.0/onetrust_api/mcp/mcp_issues_management.py +58 -0
  84. onetrust_api-0.1.0/onetrust_api/mcp/mcp_it_risk_management.py +166 -0
  85. onetrust_api-0.1.0/onetrust_api/mcp/mcp_mobile_app_consent.py +40 -0
  86. onetrust_api-0.1.0/onetrust_api/mcp/mcp_object_manager.py +149 -0
  87. onetrust_api-0.1.0/onetrust_api/mcp/mcp_policy_management.py +52 -0
  88. onetrust_api-0.1.0/onetrust_api/mcp/mcp_privacy_notices.py +48 -0
  89. onetrust_api-0.1.0/onetrust_api/mcp/mcp_task_management.py +46 -0
  90. onetrust_api-0.1.0/onetrust_api/mcp/mcp_tprm.py +70 -0
  91. onetrust_api-0.1.0/onetrust_api/mcp/mcp_training.py +50 -0
  92. onetrust_api-0.1.0/onetrust_api/mcp/mcp_universal_consent.py +236 -0
  93. onetrust_api-0.1.0/onetrust_api/mcp/mcp_user_provisioning.py +92 -0
  94. onetrust_api-0.1.0/onetrust_api/mcp_server.py +78 -0
  95. onetrust_api-0.1.0/onetrust_api/onetrust_models.py +44 -0
  96. onetrust_api-0.1.0/onetrust_api/specs/ai-governance.json +1 -0
  97. onetrust_api-0.1.0/onetrust_api/specs/consent-preferences-consent-interfaces.json +1 -0
  98. onetrust_api-0.1.0/onetrust_api/specs/consent-preferences-consent-management-platform-cmp.json +1 -0
  99. onetrust_api-0.1.0/onetrust_api/specs/consent-preferences-consent-receipts.json +1 -0
  100. onetrust_api-0.1.0/onetrust_api/specs/consent-preferences-cookie-consent-swagger.json +1 -0
  101. onetrust_api-0.1.0/onetrust_api/specs/consent-preferences-cookie-consent.json +1 -0
  102. onetrust_api-0.1.0/onetrust_api/specs/consent-preferences-cookie-domain-data.json +1 -0
  103. onetrust_api-0.1.0/onetrust_api/specs/consent-preferences-cross-device-consent.json +1 -0
  104. onetrust_api-0.1.0/onetrust_api/specs/consent-preferences-mobile-app-consent.json +1 -0
  105. onetrust_api-0.1.0/onetrust_api/specs/consent-preferences-policy-notice-management.json +1 -0
  106. onetrust_api-0.1.0/onetrust_api/specs/consent-preferences-universal-consent-preference-management-oas.json +1 -0
  107. onetrust_api-0.1.0/onetrust_api/specs/data-use-governance-data-catalog.json +1 -0
  108. onetrust_api-0.1.0/onetrust_api/specs/data-use-governance-data-discovery-worker-node.json +1 -0
  109. onetrust_api-0.1.0/onetrust_api/specs/data-use-governance-data-discovery.json +1 -0
  110. onetrust_api-0.1.0/onetrust_api/specs/esg-program-reporting-disclosures.json +1 -0
  111. onetrust_api-0.1.0/onetrust_api/specs/platform-access-management.json +1 -0
  112. onetrust_api-0.1.0/onetrust_api/specs/platform-bulk-export.json +1 -0
  113. onetrust_api-0.1.0/onetrust_api/specs/platform-documents.json +1 -0
  114. onetrust_api-0.1.0/onetrust_api/specs/platform-integrations.json +1 -0
  115. onetrust_api-0.1.0/onetrust_api/specs/platform-inventory.json +1 -0
  116. onetrust_api-0.1.0/onetrust_api/specs/platform-object-manager.json +1 -0
  117. onetrust_api-0.1.0/onetrust_api/specs/platform-task-management.json +1 -0
  118. onetrust_api-0.1.0/onetrust_api/specs/platform-user-provisioning.json +1 -0
  119. onetrust_api-0.1.0/onetrust_api/specs/privacy-automation-assessment-automation.json +1 -0
  120. onetrust_api-0.1.0/onetrust_api/specs/privacy-automation-data-mapping-automation-swagger.json +1 -0
  121. onetrust_api-0.1.0/onetrust_api/specs/privacy-automation-data-mapping-automation.json +1 -0
  122. onetrust_api-0.1.0/onetrust_api/specs/privacy-automation-data-subject-request-dsr-automation.json +1 -0
  123. onetrust_api-0.1.0/onetrust_api/specs/privacy-automation-incident-management.json +1 -0
  124. onetrust_api-0.1.0/onetrust_api/specs/tech-risk-compliance-audit-management.json +1 -0
  125. onetrust_api-0.1.0/onetrust_api/specs/tech-risk-compliance-compliance-automation.json +1 -0
  126. onetrust_api-0.1.0/onetrust_api/specs/tech-risk-compliance-enterprise-policy-management.json +1 -0
  127. onetrust_api-0.1.0/onetrust_api/specs/tech-risk-compliance-issues-management.json +1 -0
  128. onetrust_api-0.1.0/onetrust_api/specs/tech-risk-compliance-it-risk-management.json +1 -0
  129. onetrust_api-0.1.0/onetrust_api/specs/tech-risk-compliance-training.json +1 -0
  130. onetrust_api-0.1.0/onetrust_api/specs/third-party-management-third-party-risk-management.json +1 -0
  131. onetrust_api-0.1.0/onetrust_api.egg-info/PKG-INFO +227 -0
  132. onetrust_api-0.1.0/onetrust_api.egg-info/SOURCES.txt +145 -0
  133. onetrust_api-0.1.0/onetrust_api.egg-info/dependency_links.txt +1 -0
  134. onetrust_api-0.1.0/onetrust_api.egg-info/entry_points.txt +3 -0
  135. onetrust_api-0.1.0/onetrust_api.egg-info/requires.txt +18 -0
  136. onetrust_api-0.1.0/onetrust_api.egg-info/top_level.txt +5 -0
  137. onetrust_api-0.1.0/pyproject.toml +59 -0
  138. onetrust_api-0.1.0/requirements.txt +5 -0
  139. onetrust_api-0.1.0/scripts/generate_from_openapi.py +389 -0
  140. onetrust_api-0.1.0/setup.cfg +4 -0
  141. onetrust_api-0.1.0/tests/__init__.py +0 -0
  142. onetrust_api-0.1.0/tests/conftest.py +40 -0
  143. onetrust_api-0.1.0/tests/test_auth.py +33 -0
  144. onetrust_api-0.1.0/tests/test_mcp_server.py +32 -0
  145. onetrust_api-0.1.0/tests/test_onetrust_api_brute_force_coverage.py +107 -0
  146. onetrust_api-0.1.0/tests/test_onetrust_coverage.py +82 -0
  147. onetrust_api-0.1.0/tests/test_startup.py +35 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Audel Rouhi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ include LICENSE
2
+ include README.md
3
+ include requirements.txt
4
+ recursive-include onetrust_api *.md *.json *.yaml *.yml *.py
@@ -0,0 +1,227 @@
1
+ Metadata-Version: 2.4
2
+ Name: onetrust-api
3
+ Version: 0.1.0
4
+ Summary: OneTrust API + MCP Server + A2A Agent — 100% API coverage
5
+ Author-email: Audel Rouhi <knucklessg1@gmail.com>
6
+ License: MIT
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Environment :: Console
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: <3.15,>=3.11
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: agent-utilities>=0.49.0
16
+ Requires-Dist: python-dotenv>=1.0.0
17
+ Requires-Dist: requests>=2.32.0
18
+ Provides-Extra: mcp
19
+ Requires-Dist: agent-utilities[mcp]>=0.49.0; extra == "mcp"
20
+ Provides-Extra: agent
21
+ Requires-Dist: agent-utilities[agent,logfire]>=0.49.0; extra == "agent"
22
+ Provides-Extra: all
23
+ Requires-Dist: onetrust-api[agent,mcp]>=0.1.0; extra == "all"
24
+ Provides-Extra: test
25
+ Requires-Dist: pytest-xdist>=3.6.0; extra == "test"
26
+ Requires-Dist: pytest; extra == "test"
27
+ Requires-Dist: pytest-asyncio; extra == "test"
28
+ Requires-Dist: pytest-cov; extra == "test"
29
+ Dynamic: license-file
30
+
31
+ # OneTrust Api - A2A | AG-UI | MCP
32
+
33
+ ![PyPI - Version](https://img.shields.io/pypi/v/onetrust-api)
34
+ ![MCP Server](https://badge.mcpx.dev?type=server 'MCP Server')
35
+ ![PyPI - Downloads](https://img.shields.io/pypi/dd/onetrust-api)
36
+ ![GitHub Repo stars](https://img.shields.io/github/stars/Knuckles-Team/onetrust-api)
37
+ ![GitHub forks](https://img.shields.io/github/forks/Knuckles-Team/onetrust-api)
38
+ ![GitHub contributors](https://img.shields.io/github/contributors/Knuckles-Team/onetrust-api)
39
+ ![PyPI - License](https://img.shields.io/pypi/l/onetrust-api)
40
+ ![GitHub](https://img.shields.io/github/license/Knuckles-Team/onetrust-api)
41
+
42
+ ![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/Knuckles-Team/onetrust-api)
43
+ ![GitHub pull requests](https://img.shields.io/github/issues-pr/Knuckles-Team/onetrust-api)
44
+ ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/Knuckles-Team/onetrust-api)
45
+ ![GitHub issues](https://img.shields.io/github/issues/Knuckles-Team/onetrust-api)
46
+
47
+ ![GitHub top language](https://img.shields.io/github/languages/top/Knuckles-Team/onetrust-api)
48
+ ![GitHub language count](https://img.shields.io/github/languages/count/Knuckles-Team/onetrust-api)
49
+ ![GitHub repo size](https://img.shields.io/github/repo-size/Knuckles-Team/onetrust-api)
50
+ ![GitHub repo file count (file type)](https://img.shields.io/github/directory-file-count/Knuckles-Team/onetrust-api)
51
+ ![PyPI - Wheel](https://img.shields.io/pypi/wheel/onetrust-api)
52
+ ![PyPI - Implementation](https://img.shields.io/pypi/implementation/onetrust-api)
53
+
54
+ *Version: 0.1.0*
55
+
56
+ ## Overview
57
+
58
+ **OneTrust Api** is a production-grade Python API client, Model Context Protocol
59
+ (MCP) server, and A2A agent for the [OneTrust](https://www.onetrust.com/) privacy,
60
+ consent, data-governance, and risk platform.
61
+
62
+ It provides **100% coverage of the OneTrust public API** — every operation across
63
+ all **35 OpenAPI specifications** (~600 operations, 7 product areas) is exposed as
64
+ both a typed client method and an action-routed MCP tool. The client, MCP tools,
65
+ and a machine-readable coverage manifest are all **generated from the vendored
66
+ OpenAPI specs** (`onetrust_api/specs/*.json`) by `scripts/generate_from_openapi.py`,
67
+ and a coverage test asserts the three sets stay in lock-step.
68
+
69
+ ### Key Features
70
+
71
+ - **100% Action-Routed MCP Tools** — one consolidated tool per domain (e.g.
72
+ `onetrust_incidents`, `onetrust_dsar`, `onetrust_assessments`) takes an `action`
73
+ plus a `params_json` payload and routes to the underlying API method. 36 tools
74
+ cover every endpoint without flooding the IDE tool list.
75
+ - **Full OneTrust surface** — AI Governance, Consent & Preference Management,
76
+ Data Use Governance, Privacy Automation (DSAR, Assessments, Data Mapping,
77
+ Incidents), Tech Risk & Compliance, Third-Party Management, ESG, and Platform.
78
+ - **Flexible auth** — a pre-minted OAuth2 bearer token *or* the OAuth2
79
+ client-credentials flow (auto-exchanged and refreshed), plus OIDC delegation
80
+ (RFC 8693) via `agent-utilities`.
81
+ - **Multi-region / multi-service aware** — regional tenant pods, the consent
82
+ privacy-portal host, and on-prem worker nodes are resolved per-operation.
83
+ - **Resilient** — honours `429` `Retry-After`, retries transient `5xx`, and
84
+ handles both OneTrust pagination styles (offset and cursor).
85
+
86
+ ## MCP
87
+
88
+ ### Using as an MCP Server
89
+
90
+ The MCP Server runs in `stdio` (local) or `streamable-http` (networked) mode.
91
+ Each domain is a tool gated by a `{TAG}TOOL` environment variable (default `True`),
92
+ so you can scope the surface (e.g. set `ESGTOOL=False` to drop ESG).
93
+
94
+ #### Environment Variables
95
+
96
+ | Variable | Description |
97
+ | --- | --- |
98
+ | `ONETRUST_URL` | Tenant host URL, e.g. `https://acme.my.onetrust.com` (overrides region). |
99
+ | `ONETRUST_REGION` | Shared pod when no URL is set: `us`, `eu`, `de`, `uk`, `au`, `ca`, `fr`, `in`, `jp`, `trial`, `uat`, … (default `us`). |
100
+ | `ONETRUST_TOKEN` | Pre-minted OAuth2 bearer token. |
101
+ | `ONETRUST_CLIENT_ID` / `ONETRUST_CLIENT_SECRET` | OAuth2 client-credentials (exchanged at `/api/access/v1/oauth/token`). |
102
+ | `ONETRUST_CONSENT_URL` | Optional host for consent-transaction APIs (privacy portal). |
103
+ | `ONETRUST_WORKER_URL` | Optional on-prem Data Discovery worker-node host. |
104
+ | `ONETRUST_SSL_VERIFY` | Verify TLS (default `True`). |
105
+ | `<DOMAIN>TOOL` | Toggle a domain tool, e.g. `INCIDENTSTOOL`, `DSARTOOL`, `CONSENT_RECEIPTSTOOL` (default `True`). |
106
+
107
+ #### Run in stdio mode (default):
108
+ ```bash
109
+ export ONETRUST_URL="https://acme.my.onetrust.com"
110
+ export ONETRUST_TOKEN="your_token"
111
+ onetrust-mcp --transport "stdio"
112
+ ```
113
+
114
+ #### Run in HTTP mode:
115
+ ```bash
116
+ export ONETRUST_URL="https://acme.my.onetrust.com"
117
+ export ONETRUST_TOKEN="your_token"
118
+ onetrust-mcp --transport "streamable-http" --host "0.0.0.0" --port "8000"
119
+ ```
120
+
121
+ ### Tool Domains
122
+
123
+ `access_management`, `ai_governance`, `assessments`, `audit_management`,
124
+ `bulk_export`, `cmp`, `compliance_automation`, `consent_interfaces`,
125
+ `consent_receipts`, `cookie_consent`, `cookie_consent_legacy`,
126
+ `cookie_domain_data`, `cross_device_consent`, `data_catalog`, `data_discovery`,
127
+ `data_discovery_worker`, `data_mapping`, `data_mapping_legacy`, `documents`,
128
+ `dsar`, `esg`, `incidents`, `integrations`, `inventory`, `issues_management`,
129
+ `it_risk_management`, `mobile_app_consent`, `object_manager`, `policy_management`,
130
+ `privacy_notices`, `task_management`, `tprm`, `training`, `universal_consent`,
131
+ `user_provisioning` — plus `custom_api` (a raw REST escape hatch).
132
+
133
+ ## A2A Agent
134
+
135
+ ### Run A2A Server
136
+ ```bash
137
+ export ONETRUST_URL="https://acme.my.onetrust.com"
138
+ export ONETRUST_TOKEN="your_token"
139
+ onetrust-agent --provider openai --model-id gpt-4o --api-key sk-...
140
+ ```
141
+
142
+ ## Docker
143
+
144
+ ### Build
145
+
146
+ ```bash
147
+ docker build -t onetrust-api .
148
+ ```
149
+
150
+ ### Run MCP Server
151
+
152
+ ```bash
153
+ docker run -d \
154
+ --name onetrust-api \
155
+ -p 8000:8000 \
156
+ -e TRANSPORT=http \
157
+ -e ONETRUST_URL="http://your-service:8080" \
158
+ -e ONETRUST_TOKEN="your_token" \
159
+ knucklessg1/onetrust-api:latest
160
+ ```
161
+
162
+ ### Deploy with Docker Compose
163
+
164
+ ```yaml
165
+ services:
166
+ onetrust-api:
167
+ image: knucklessg1/onetrust-api:latest
168
+ environment:
169
+ - HOST=0.0.0.0
170
+ - PORT=8000
171
+ - TRANSPORT=http
172
+ - ONETRUST_URL=http://your-service:8080
173
+ - ONETRUST_TOKEN=your_token
174
+ ports:
175
+ - 8000:8000
176
+ ```
177
+
178
+ #### Configure `mcp.json` for AI Integration (e.g. Claude Desktop)
179
+
180
+ ```json
181
+ {
182
+ "mcpServers": {
183
+ "onetrust": {
184
+ "command": "uv",
185
+ "args": [
186
+ "run",
187
+ "--with",
188
+ "onetrust-api",
189
+ "onetrust-mcp"
190
+ ],
191
+ "env": {
192
+ "ONETRUST_URL": "http://your-service:8080",
193
+ "ONETRUST_TOKEN": "your_token"
194
+ }
195
+ }
196
+ }
197
+ }
198
+ ```
199
+
200
+ ## Install Python Package
201
+
202
+ ```bash
203
+ python -m pip install onetrust-api
204
+ ```
205
+ ```bash
206
+ uv pip install onetrust-api
207
+ ```
208
+
209
+ ## Documentation
210
+
211
+ The complete documentation is published as the
212
+ [official documentation site](https://knuckles-team.github.io/onetrust-api/) and is
213
+ the source of truth for installation, usage, and deployment.
214
+
215
+ | Page | Covers |
216
+ | --- | --- |
217
+ | [Overview](https://knuckles-team.github.io/onetrust-api/overview/) | the action-routed tool surface and architecture |
218
+ | [Installation](https://knuckles-team.github.io/onetrust-api/installation/) | pip, source, extras, prebuilt Docker image |
219
+ | [Usage (API / CLI / MCP)](https://knuckles-team.github.io/onetrust-api/usage/) | the MCP tools, the `Api` client, the CLI |
220
+ | [Deployment](https://knuckles-team.github.io/onetrust-api/deployment/) | run the MCP and agent servers, Compose, env config |
221
+
222
+ ## Repository Owners
223
+
224
+ <img width="100%" height="180em" src="https://github-readme-stats.vercel.app/api?username=Knucklessg1&show_icons=true&hide_border=true&&count_private=true&include_all_commits=true" />
225
+
226
+ ![GitHub followers](https://img.shields.io/github/followers/Knucklessg1)
227
+ ![GitHub User's stars](https://img.shields.io/github/stars/Knucklessg1)
@@ -0,0 +1,197 @@
1
+ # OneTrust Api - A2A | AG-UI | MCP
2
+
3
+ ![PyPI - Version](https://img.shields.io/pypi/v/onetrust-api)
4
+ ![MCP Server](https://badge.mcpx.dev?type=server 'MCP Server')
5
+ ![PyPI - Downloads](https://img.shields.io/pypi/dd/onetrust-api)
6
+ ![GitHub Repo stars](https://img.shields.io/github/stars/Knuckles-Team/onetrust-api)
7
+ ![GitHub forks](https://img.shields.io/github/forks/Knuckles-Team/onetrust-api)
8
+ ![GitHub contributors](https://img.shields.io/github/contributors/Knuckles-Team/onetrust-api)
9
+ ![PyPI - License](https://img.shields.io/pypi/l/onetrust-api)
10
+ ![GitHub](https://img.shields.io/github/license/Knuckles-Team/onetrust-api)
11
+
12
+ ![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/Knuckles-Team/onetrust-api)
13
+ ![GitHub pull requests](https://img.shields.io/github/issues-pr/Knuckles-Team/onetrust-api)
14
+ ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/Knuckles-Team/onetrust-api)
15
+ ![GitHub issues](https://img.shields.io/github/issues/Knuckles-Team/onetrust-api)
16
+
17
+ ![GitHub top language](https://img.shields.io/github/languages/top/Knuckles-Team/onetrust-api)
18
+ ![GitHub language count](https://img.shields.io/github/languages/count/Knuckles-Team/onetrust-api)
19
+ ![GitHub repo size](https://img.shields.io/github/repo-size/Knuckles-Team/onetrust-api)
20
+ ![GitHub repo file count (file type)](https://img.shields.io/github/directory-file-count/Knuckles-Team/onetrust-api)
21
+ ![PyPI - Wheel](https://img.shields.io/pypi/wheel/onetrust-api)
22
+ ![PyPI - Implementation](https://img.shields.io/pypi/implementation/onetrust-api)
23
+
24
+ *Version: 0.1.0*
25
+
26
+ ## Overview
27
+
28
+ **OneTrust Api** is a production-grade Python API client, Model Context Protocol
29
+ (MCP) server, and A2A agent for the [OneTrust](https://www.onetrust.com/) privacy,
30
+ consent, data-governance, and risk platform.
31
+
32
+ It provides **100% coverage of the OneTrust public API** — every operation across
33
+ all **35 OpenAPI specifications** (~600 operations, 7 product areas) is exposed as
34
+ both a typed client method and an action-routed MCP tool. The client, MCP tools,
35
+ and a machine-readable coverage manifest are all **generated from the vendored
36
+ OpenAPI specs** (`onetrust_api/specs/*.json`) by `scripts/generate_from_openapi.py`,
37
+ and a coverage test asserts the three sets stay in lock-step.
38
+
39
+ ### Key Features
40
+
41
+ - **100% Action-Routed MCP Tools** — one consolidated tool per domain (e.g.
42
+ `onetrust_incidents`, `onetrust_dsar`, `onetrust_assessments`) takes an `action`
43
+ plus a `params_json` payload and routes to the underlying API method. 36 tools
44
+ cover every endpoint without flooding the IDE tool list.
45
+ - **Full OneTrust surface** — AI Governance, Consent & Preference Management,
46
+ Data Use Governance, Privacy Automation (DSAR, Assessments, Data Mapping,
47
+ Incidents), Tech Risk & Compliance, Third-Party Management, ESG, and Platform.
48
+ - **Flexible auth** — a pre-minted OAuth2 bearer token *or* the OAuth2
49
+ client-credentials flow (auto-exchanged and refreshed), plus OIDC delegation
50
+ (RFC 8693) via `agent-utilities`.
51
+ - **Multi-region / multi-service aware** — regional tenant pods, the consent
52
+ privacy-portal host, and on-prem worker nodes are resolved per-operation.
53
+ - **Resilient** — honours `429` `Retry-After`, retries transient `5xx`, and
54
+ handles both OneTrust pagination styles (offset and cursor).
55
+
56
+ ## MCP
57
+
58
+ ### Using as an MCP Server
59
+
60
+ The MCP Server runs in `stdio` (local) or `streamable-http` (networked) mode.
61
+ Each domain is a tool gated by a `{TAG}TOOL` environment variable (default `True`),
62
+ so you can scope the surface (e.g. set `ESGTOOL=False` to drop ESG).
63
+
64
+ #### Environment Variables
65
+
66
+ | Variable | Description |
67
+ | --- | --- |
68
+ | `ONETRUST_URL` | Tenant host URL, e.g. `https://acme.my.onetrust.com` (overrides region). |
69
+ | `ONETRUST_REGION` | Shared pod when no URL is set: `us`, `eu`, `de`, `uk`, `au`, `ca`, `fr`, `in`, `jp`, `trial`, `uat`, … (default `us`). |
70
+ | `ONETRUST_TOKEN` | Pre-minted OAuth2 bearer token. |
71
+ | `ONETRUST_CLIENT_ID` / `ONETRUST_CLIENT_SECRET` | OAuth2 client-credentials (exchanged at `/api/access/v1/oauth/token`). |
72
+ | `ONETRUST_CONSENT_URL` | Optional host for consent-transaction APIs (privacy portal). |
73
+ | `ONETRUST_WORKER_URL` | Optional on-prem Data Discovery worker-node host. |
74
+ | `ONETRUST_SSL_VERIFY` | Verify TLS (default `True`). |
75
+ | `<DOMAIN>TOOL` | Toggle a domain tool, e.g. `INCIDENTSTOOL`, `DSARTOOL`, `CONSENT_RECEIPTSTOOL` (default `True`). |
76
+
77
+ #### Run in stdio mode (default):
78
+ ```bash
79
+ export ONETRUST_URL="https://acme.my.onetrust.com"
80
+ export ONETRUST_TOKEN="your_token"
81
+ onetrust-mcp --transport "stdio"
82
+ ```
83
+
84
+ #### Run in HTTP mode:
85
+ ```bash
86
+ export ONETRUST_URL="https://acme.my.onetrust.com"
87
+ export ONETRUST_TOKEN="your_token"
88
+ onetrust-mcp --transport "streamable-http" --host "0.0.0.0" --port "8000"
89
+ ```
90
+
91
+ ### Tool Domains
92
+
93
+ `access_management`, `ai_governance`, `assessments`, `audit_management`,
94
+ `bulk_export`, `cmp`, `compliance_automation`, `consent_interfaces`,
95
+ `consent_receipts`, `cookie_consent`, `cookie_consent_legacy`,
96
+ `cookie_domain_data`, `cross_device_consent`, `data_catalog`, `data_discovery`,
97
+ `data_discovery_worker`, `data_mapping`, `data_mapping_legacy`, `documents`,
98
+ `dsar`, `esg`, `incidents`, `integrations`, `inventory`, `issues_management`,
99
+ `it_risk_management`, `mobile_app_consent`, `object_manager`, `policy_management`,
100
+ `privacy_notices`, `task_management`, `tprm`, `training`, `universal_consent`,
101
+ `user_provisioning` — plus `custom_api` (a raw REST escape hatch).
102
+
103
+ ## A2A Agent
104
+
105
+ ### Run A2A Server
106
+ ```bash
107
+ export ONETRUST_URL="https://acme.my.onetrust.com"
108
+ export ONETRUST_TOKEN="your_token"
109
+ onetrust-agent --provider openai --model-id gpt-4o --api-key sk-...
110
+ ```
111
+
112
+ ## Docker
113
+
114
+ ### Build
115
+
116
+ ```bash
117
+ docker build -t onetrust-api .
118
+ ```
119
+
120
+ ### Run MCP Server
121
+
122
+ ```bash
123
+ docker run -d \
124
+ --name onetrust-api \
125
+ -p 8000:8000 \
126
+ -e TRANSPORT=http \
127
+ -e ONETRUST_URL="http://your-service:8080" \
128
+ -e ONETRUST_TOKEN="your_token" \
129
+ knucklessg1/onetrust-api:latest
130
+ ```
131
+
132
+ ### Deploy with Docker Compose
133
+
134
+ ```yaml
135
+ services:
136
+ onetrust-api:
137
+ image: knucklessg1/onetrust-api:latest
138
+ environment:
139
+ - HOST=0.0.0.0
140
+ - PORT=8000
141
+ - TRANSPORT=http
142
+ - ONETRUST_URL=http://your-service:8080
143
+ - ONETRUST_TOKEN=your_token
144
+ ports:
145
+ - 8000:8000
146
+ ```
147
+
148
+ #### Configure `mcp.json` for AI Integration (e.g. Claude Desktop)
149
+
150
+ ```json
151
+ {
152
+ "mcpServers": {
153
+ "onetrust": {
154
+ "command": "uv",
155
+ "args": [
156
+ "run",
157
+ "--with",
158
+ "onetrust-api",
159
+ "onetrust-mcp"
160
+ ],
161
+ "env": {
162
+ "ONETRUST_URL": "http://your-service:8080",
163
+ "ONETRUST_TOKEN": "your_token"
164
+ }
165
+ }
166
+ }
167
+ }
168
+ ```
169
+
170
+ ## Install Python Package
171
+
172
+ ```bash
173
+ python -m pip install onetrust-api
174
+ ```
175
+ ```bash
176
+ uv pip install onetrust-api
177
+ ```
178
+
179
+ ## Documentation
180
+
181
+ The complete documentation is published as the
182
+ [official documentation site](https://knuckles-team.github.io/onetrust-api/) and is
183
+ the source of truth for installation, usage, and deployment.
184
+
185
+ | Page | Covers |
186
+ | --- | --- |
187
+ | [Overview](https://knuckles-team.github.io/onetrust-api/overview/) | the action-routed tool surface and architecture |
188
+ | [Installation](https://knuckles-team.github.io/onetrust-api/installation/) | pip, source, extras, prebuilt Docker image |
189
+ | [Usage (API / CLI / MCP)](https://knuckles-team.github.io/onetrust-api/usage/) | the MCP tools, the `Api` client, the CLI |
190
+ | [Deployment](https://knuckles-team.github.io/onetrust-api/deployment/) | run the MCP and agent servers, Compose, env config |
191
+
192
+ ## Repository Owners
193
+
194
+ <img width="100%" height="180em" src="https://github-readme-stats.vercel.app/api?username=Knucklessg1&show_icons=true&hide_border=true&&count_private=true&include_all_commits=true" />
195
+
196
+ ![GitHub followers](https://img.shields.io/github/followers/Knucklessg1)
197
+ ![GitHub User's stars](https://img.shields.io/github/stars/Knucklessg1)
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env python
2
+
3
+ import importlib
4
+ import inspect
5
+ import warnings
6
+
7
+ # Suppress RequestsDependencyWarning due to chardet 6.x / requests 2.32.x mismatch
8
+ # Centralized here to ensure it runs before any sub-package imports
9
+ warnings.filterwarnings("ignore", message=".*urllib3.*or chardet.*")
10
+
11
+ __all__: list[str] = []
12
+
13
+ CORE_MODULES = [
14
+ "onetrust_api.api_client",
15
+ ]
16
+
17
+ OPTIONAL_MODULES = {
18
+ "onetrust_api.agent_server": "agent",
19
+ "onetrust_api.mcp_server": "mcp",
20
+ }
21
+
22
+
23
+ def _import_module_safely(module_name: str):
24
+ """Try to import a module and return it, or None if not available."""
25
+ try:
26
+ return importlib.import_module(module_name)
27
+ except ImportError:
28
+ return None
29
+
30
+
31
+ def _expose_members(module):
32
+ """Expose public classes and functions from a module into globals and __all__."""
33
+ for name, obj in inspect.getmembers(module):
34
+ if (inspect.isclass(obj) or inspect.isfunction(obj)) and not name.startswith(
35
+ "_"
36
+ ):
37
+ globals()[name] = obj
38
+ __all__.append(name)
39
+
40
+
41
+ for module_name in CORE_MODULES:
42
+ try:
43
+ module = importlib.import_module(module_name)
44
+ _expose_members(module)
45
+ except ImportError:
46
+ pass
47
+
48
+ for module_name, extra_name in OPTIONAL_MODULES.items():
49
+ module = _import_module_safely(module_name)
50
+ globals()[f"_{extra_name.upper()}_AVAILABLE"] = module is not None
51
+ if module is not None:
52
+ _expose_members(module)
53
+
54
+ __all__.extend(["_MCP_AVAILABLE", "_AGENT_AVAILABLE"])
55
+
56
+
57
+ """
58
+ onetrust-api
59
+
60
+ Python OneTrust API client + MCP server + A2A agent with 100% API coverage
61
+ """
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/python
2
+ from onetrust_api.agent_server import agent_server
3
+
4
+ if __name__ == "__main__":
5
+ agent_server()
@@ -0,0 +1,12 @@
1
+ # AGENTS.md - Known A2A Peer Agents
2
+ Last updated: 2026-06-15
3
+
4
+ This file is the local registry of other A2A agents this agent can discover and call.
5
+
6
+ ## Registered A2A Peers
7
+
8
+ | Name | Endpoint URL | Description | Capabilities | Auth | Notes / Last Connected |
9
+ |-----------------|---------------------------------|--------------------------------------|----------------------------------|-----------|------------------------|
10
+ | SearchMaster | http://search-agent:9000/a2a | Advanced web researcher | web_search, summarize, browse | none | 2026-06-15 |
11
+
12
+ *Add new rows manually or let the agent call `register_a2a_peer(...)`.*
@@ -0,0 +1,12 @@
1
+ # CRON.md - Persistent Scheduled Tasks
2
+ Last updated: 2026-06-15
3
+
4
+ ## Active Tasks
5
+
6
+ | ID | Name | Interval (min) | Prompt | Last run | Next approx |
7
+ |-------------|-------------------|----------------|-------------------------------------|-------------------|-------------|
8
+ | heartbeat | Heartbeat | 30 | @HEARTBEAT.md | — | — |
9
+ | log-cleanup | Log Cleanup | 720 | __internal:cleanup_cron_log | — | — |
10
+
11
+ *Edit this table to add/remove tasks. The agent reloads it periodically.*
12
+ *Use `@filename.md` in the Prompt column to load a multi-line prompt from a workspace file.*
@@ -0,0 +1,5 @@
1
+ # CRON_LOG.md - Scheduled Task History
2
+ Last updated: 2026-06-15
3
+
4
+ | Timestamp | Task ID | Status | Message |
5
+ |-----------|---------|--------|---------|
@@ -0,0 +1,28 @@
1
+ # Heartbeat — Periodic Self-Check
2
+
3
+ You are running a scheduled heartbeat. Perform these checks and report results concisely.
4
+
5
+ ## Checks
6
+
7
+ 1. **Tool Availability** — Call `list_tools` or equivalent to verify your MCP tools are reachable. Report any connection failures.
8
+ 2. **Memory Review** — Query the **Knowledge Graph** for any pending follow-up tasks, architectural decisions, or action items.
9
+ 3. **Cron Log** — Read `CRON_LOG.md` and check for recent errors (❌). Summarize any failures from the last 24 hours.
10
+ 4. **Peer Agents** — Read `AGENTS.md` and note if any registered peers need attention.
11
+ 5. **Domain-Specific Checks**:
12
+ - **Service Health**: Check service health status and scan recent logs for critical errors using available tools.
13
+ 6. **Self-Diagnostics** — Report your current model, available tool count, and any anomalies.
14
+
15
+ ## Response Format
16
+
17
+ If everything is healthy:
18
+ ```
19
+ HEARTBEAT_OK — All systems nominal. [tool_count] tools available. No pending actions.
20
+ ```
21
+
22
+ If issues found:
23
+ ```
24
+ HEARTBEAT_ALERT — [summary of issues found]
25
+ - Issue 1: ...
26
+ - Issue 2: ...
27
+ - Action needed: ...
28
+ ```
@@ -0,0 +1,15 @@
1
+ # IDENTITY.md - OneTrust Api Agent Identity
2
+
3
+ ## [default]
4
+ * **Name:** OneTrust Api Agent
5
+ * **Role:** Python OneTrust API client + MCP server + A2A agent with 100% API coverage
6
+ * **Emoji:** 🤖
7
+
8
+ ### System Prompt
9
+ You are the OneTrust Api Agent.
10
+ You must always first run `list_skills` to show all skills.
11
+ Then, use the `mcp-client` universal skill and check the reference documentation for `onetrust-api.md` to discover the exact tags and tools available for your capabilities.
12
+
13
+ ### Capabilities
14
+ - **MCP Operations**: Leverage the `mcp-client` skill to interact with the target MCP server. Refer to `onetrust-api.md` for specific tool capabilities.
15
+ - **Custom Agent**: Handle custom tasks or general tasks.
@@ -0,0 +1,13 @@
1
+ # MCP_AGENTS.md - Dynamic Agent Registry
2
+
3
+ This file tracks the generated agents from MCP servers. You can manually modify the 'Tools' list to customize agent expertise.
4
+
5
+ ## Agent Mapping Table
6
+
7
+ | Name | Description | System Prompt | Tools | Tag | Source MCP |
8
+ |------|-------------|---------------|-------|-----|------------|
9
+
10
+ ## Tool Inventory Table
11
+
12
+ | Tool Name | Description | Tag | Source |
13
+ |-----------|-------------|-----|--------|
@@ -0,0 +1,7 @@
1
+ # USER.md - About the Human
2
+
3
+ * **Name:** User
4
+ * **Preferred name:** User
5
+ * **Timezone:** America/Chicago
6
+ * **Location:** Chicago, Illinois
7
+ * **Style:** Technical, concise, no fluff
File without changes
@@ -0,0 +1,11 @@
1
+ {
2
+ "mcpServers": {
3
+ "onetrust": {
4
+ "command": "onetrust-mcp",
5
+ "env": {
6
+ "ONETRUST_URL": "${ONETRUST_URL:-http://localhost:8080}",
7
+ "ONETRUST_TOKEN": "${ONETRUST_TOKEN}"
8
+ }
9
+ }
10
+ }
11
+ }