onetrust-api 0.1.0__py3-none-any.whl

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 (140) hide show
  1. onetrust_api/__init__.py +61 -0
  2. onetrust_api/__main__.py +5 -0
  3. onetrust_api/agent/AGENTS.md +12 -0
  4. onetrust_api/agent/CRON.md +12 -0
  5. onetrust_api/agent/CRON_LOG.md +5 -0
  6. onetrust_api/agent/HEARTBEAT.md +28 -0
  7. onetrust_api/agent/IDENTITY.md +15 -0
  8. onetrust_api/agent/MCP_AGENTS.md +13 -0
  9. onetrust_api/agent/USER.md +7 -0
  10. onetrust_api/agent/icon.png +0 -0
  11. onetrust_api/agent/mcp_config.json +11 -0
  12. onetrust_api/agent_server.py +84 -0
  13. onetrust_api/api/__init__.py +7 -0
  14. onetrust_api/api/_operation_manifest.py +5421 -0
  15. onetrust_api/api/api_client_access_management.py +439 -0
  16. onetrust_api/api/api_client_ai_governance.py +263 -0
  17. onetrust_api/api/api_client_assessments.py +405 -0
  18. onetrust_api/api/api_client_audit_management.py +139 -0
  19. onetrust_api/api/api_client_base.py +389 -0
  20. onetrust_api/api/api_client_bulk_export.py +91 -0
  21. onetrust_api/api/api_client_cmp.py +67 -0
  22. onetrust_api/api/api_client_compliance_automation.py +43 -0
  23. onetrust_api/api/api_client_consent_interfaces.py +19 -0
  24. onetrust_api/api/api_client_consent_receipts.py +43 -0
  25. onetrust_api/api/api_client_cookie_consent.py +474 -0
  26. onetrust_api/api/api_client_cookie_consent_legacy.py +139 -0
  27. onetrust_api/api/api_client_cookie_domain_data.py +19 -0
  28. onetrust_api/api/api_client_cross_device_consent.py +19 -0
  29. onetrust_api/api/api_client_data_catalog.py +295 -0
  30. onetrust_api/api/api_client_data_discovery.py +348 -0
  31. onetrust_api/api/api_client_data_discovery_worker.py +55 -0
  32. onetrust_api/api/api_client_data_mapping.py +509 -0
  33. onetrust_api/api/api_client_data_mapping_legacy.py +57 -0
  34. onetrust_api/api/api_client_documents.py +31 -0
  35. onetrust_api/api/api_client_dsar.py +503 -0
  36. onetrust_api/api/api_client_esg.py +67 -0
  37. onetrust_api/api/api_client_incidents.py +91 -0
  38. onetrust_api/api/api_client_integrations.py +55 -0
  39. onetrust_api/api/api_client_inventory.py +175 -0
  40. onetrust_api/api/api_client_issues_management.py +115 -0
  41. onetrust_api/api/api_client_it_risk_management.py +697 -0
  42. onetrust_api/api/api_client_mobile_app_consent.py +19 -0
  43. onetrust_api/api/api_client_object_manager.py +483 -0
  44. onetrust_api/api/api_client_policy_management.py +79 -0
  45. onetrust_api/api/api_client_privacy_notices.py +45 -0
  46. onetrust_api/api/api_client_task_management.py +43 -0
  47. onetrust_api/api/api_client_tprm.py +187 -0
  48. onetrust_api/api/api_client_training.py +67 -0
  49. onetrust_api/api/api_client_universal_consent.py +1289 -0
  50. onetrust_api/api/api_client_user_provisioning.py +319 -0
  51. onetrust_api/api_client.py +86 -0
  52. onetrust_api/auth.py +95 -0
  53. onetrust_api/mcp/__init__.py +146 -0
  54. onetrust_api/mcp/mcp_access_management.py +112 -0
  55. onetrust_api/mcp/mcp_ai_governance.py +107 -0
  56. onetrust_api/mcp/mcp_assessments.py +104 -0
  57. onetrust_api/mcp/mcp_audit_management.py +62 -0
  58. onetrust_api/mcp/mcp_bulk_export.py +54 -0
  59. onetrust_api/mcp/mcp_cmp.py +50 -0
  60. onetrust_api/mcp/mcp_compliance_automation.py +46 -0
  61. onetrust_api/mcp/mcp_consent_interfaces.py +42 -0
  62. onetrust_api/mcp/mcp_consent_receipts.py +46 -0
  63. onetrust_api/mcp/mcp_cookie_consent.py +116 -0
  64. onetrust_api/mcp/mcp_cookie_consent_legacy.py +62 -0
  65. onetrust_api/mcp/mcp_cookie_domain_data.py +40 -0
  66. onetrust_api/mcp/mcp_cross_device_consent.py +42 -0
  67. onetrust_api/mcp/mcp_custom_api.py +47 -0
  68. onetrust_api/mcp/mcp_data_catalog.py +88 -0
  69. onetrust_api/mcp/mcp_data_discovery.py +92 -0
  70. onetrust_api/mcp/mcp_data_discovery_worker.py +48 -0
  71. onetrust_api/mcp/mcp_data_mapping.py +140 -0
  72. onetrust_api/mcp/mcp_data_mapping_legacy.py +54 -0
  73. onetrust_api/mcp/mcp_documents.py +44 -0
  74. onetrust_api/mcp/mcp_dsar.py +118 -0
  75. onetrust_api/mcp/mcp_esg.py +50 -0
  76. onetrust_api/mcp/mcp_incidents.py +54 -0
  77. onetrust_api/mcp/mcp_integrations.py +48 -0
  78. onetrust_api/mcp/mcp_inventory.py +84 -0
  79. onetrust_api/mcp/mcp_issues_management.py +58 -0
  80. onetrust_api/mcp/mcp_it_risk_management.py +166 -0
  81. onetrust_api/mcp/mcp_mobile_app_consent.py +40 -0
  82. onetrust_api/mcp/mcp_object_manager.py +149 -0
  83. onetrust_api/mcp/mcp_policy_management.py +52 -0
  84. onetrust_api/mcp/mcp_privacy_notices.py +48 -0
  85. onetrust_api/mcp/mcp_task_management.py +46 -0
  86. onetrust_api/mcp/mcp_tprm.py +70 -0
  87. onetrust_api/mcp/mcp_training.py +50 -0
  88. onetrust_api/mcp/mcp_universal_consent.py +236 -0
  89. onetrust_api/mcp/mcp_user_provisioning.py +92 -0
  90. onetrust_api/mcp_server.py +78 -0
  91. onetrust_api/onetrust_models.py +44 -0
  92. onetrust_api/specs/ai-governance.json +1 -0
  93. onetrust_api/specs/consent-preferences-consent-interfaces.json +1 -0
  94. onetrust_api/specs/consent-preferences-consent-management-platform-cmp.json +1 -0
  95. onetrust_api/specs/consent-preferences-consent-receipts.json +1 -0
  96. onetrust_api/specs/consent-preferences-cookie-consent-swagger.json +1 -0
  97. onetrust_api/specs/consent-preferences-cookie-consent.json +1 -0
  98. onetrust_api/specs/consent-preferences-cookie-domain-data.json +1 -0
  99. onetrust_api/specs/consent-preferences-cross-device-consent.json +1 -0
  100. onetrust_api/specs/consent-preferences-mobile-app-consent.json +1 -0
  101. onetrust_api/specs/consent-preferences-policy-notice-management.json +1 -0
  102. onetrust_api/specs/consent-preferences-universal-consent-preference-management-oas.json +1 -0
  103. onetrust_api/specs/data-use-governance-data-catalog.json +1 -0
  104. onetrust_api/specs/data-use-governance-data-discovery-worker-node.json +1 -0
  105. onetrust_api/specs/data-use-governance-data-discovery.json +1 -0
  106. onetrust_api/specs/esg-program-reporting-disclosures.json +1 -0
  107. onetrust_api/specs/platform-access-management.json +1 -0
  108. onetrust_api/specs/platform-bulk-export.json +1 -0
  109. onetrust_api/specs/platform-documents.json +1 -0
  110. onetrust_api/specs/platform-integrations.json +1 -0
  111. onetrust_api/specs/platform-inventory.json +1 -0
  112. onetrust_api/specs/platform-object-manager.json +1 -0
  113. onetrust_api/specs/platform-task-management.json +1 -0
  114. onetrust_api/specs/platform-user-provisioning.json +1 -0
  115. onetrust_api/specs/privacy-automation-assessment-automation.json +1 -0
  116. onetrust_api/specs/privacy-automation-data-mapping-automation-swagger.json +1 -0
  117. onetrust_api/specs/privacy-automation-data-mapping-automation.json +1 -0
  118. onetrust_api/specs/privacy-automation-data-subject-request-dsr-automation.json +1 -0
  119. onetrust_api/specs/privacy-automation-incident-management.json +1 -0
  120. onetrust_api/specs/tech-risk-compliance-audit-management.json +1 -0
  121. onetrust_api/specs/tech-risk-compliance-compliance-automation.json +1 -0
  122. onetrust_api/specs/tech-risk-compliance-enterprise-policy-management.json +1 -0
  123. onetrust_api/specs/tech-risk-compliance-issues-management.json +1 -0
  124. onetrust_api/specs/tech-risk-compliance-it-risk-management.json +1 -0
  125. onetrust_api/specs/tech-risk-compliance-training.json +1 -0
  126. onetrust_api/specs/third-party-management-third-party-risk-management.json +1 -0
  127. onetrust_api-0.1.0.dist-info/METADATA +227 -0
  128. onetrust_api-0.1.0.dist-info/RECORD +140 -0
  129. onetrust_api-0.1.0.dist-info/WHEEL +5 -0
  130. onetrust_api-0.1.0.dist-info/entry_points.txt +3 -0
  131. onetrust_api-0.1.0.dist-info/licenses/LICENSE +21 -0
  132. onetrust_api-0.1.0.dist-info/top_level.txt +3 -0
  133. scripts/generate_from_openapi.py +389 -0
  134. tests/__init__.py +0 -0
  135. tests/conftest.py +40 -0
  136. tests/test_auth.py +33 -0
  137. tests/test_mcp_server.py +32 -0
  138. tests/test_onetrust_api_brute_force_coverage.py +107 -0
  139. tests/test_onetrust_coverage.py +82 -0
  140. tests/test_startup.py +35 -0
@@ -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
+ }
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/python
2
+ import logging
3
+ import os
4
+ import sys
5
+ import warnings
6
+
7
+ __version__ = "0.1.0"
8
+
9
+ logging.basicConfig(
10
+ level=logging.INFO,
11
+ format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
12
+ handlers=[logging.StreamHandler()],
13
+ )
14
+ logger = logging.getLogger(__name__)
15
+
16
+ DEFAULT_AGENT_NAME = None
17
+ DEFAULT_AGENT_DESCRIPTION = None
18
+ DEFAULT_AGENT_SYSTEM_PROMPT = None
19
+
20
+
21
+ def agent_server():
22
+ from agent_utilities import (
23
+ build_system_prompt_from_workspace,
24
+ create_agent_parser,
25
+ create_agent_server,
26
+ initialize_workspace,
27
+ load_identity,
28
+ )
29
+
30
+ global DEFAULT_AGENT_NAME, DEFAULT_AGENT_DESCRIPTION, DEFAULT_AGENT_SYSTEM_PROMPT
31
+ initialize_workspace()
32
+ meta = load_identity()
33
+ DEFAULT_AGENT_NAME = os.getenv(
34
+ "DEFAULT_AGENT_NAME", meta.get("name", "OneTrust Api")
35
+ )
36
+ DEFAULT_AGENT_DESCRIPTION = os.getenv(
37
+ "AGENT_DESCRIPTION",
38
+ meta.get(
39
+ "description", "AI agent for OneTrust privacy and compliance management."
40
+ ),
41
+ )
42
+ DEFAULT_AGENT_SYSTEM_PROMPT = os.getenv(
43
+ "AGENT_SYSTEM_PROMPT",
44
+ meta.get("content") or build_system_prompt_from_workspace(),
45
+ )
46
+
47
+ warnings.filterwarnings("ignore", message=".*urllib3.*or chardet.*")
48
+ warnings.filterwarnings("ignore", category=DeprecationWarning, module="fastmcp")
49
+
50
+ print(f"{DEFAULT_AGENT_NAME} v{__version__}", file=sys.stderr)
51
+ parser = create_agent_parser()
52
+ args = parser.parse_args()
53
+
54
+ if args.debug:
55
+ logging.getLogger().setLevel(logging.DEBUG)
56
+ logger.debug("Debug mode enabled")
57
+
58
+ # Start server using the auto-discovery pattern (from mcp_config.json).
59
+ # With many tool tags the agent-utilities graph router engages automatically.
60
+ create_agent_server(
61
+ mcp_url=args.mcp_url,
62
+ mcp_config=args.mcp_config or "mcp_config.json",
63
+ host=args.host,
64
+ port=args.port,
65
+ provider=args.provider,
66
+ model_id=args.model_id,
67
+ router_model=args.model_id,
68
+ agent_model=args.model_id,
69
+ base_url=args.base_url,
70
+ api_key=args.api_key,
71
+ custom_skills_directory=args.custom_skills_directory,
72
+ enable_web_ui=args.web,
73
+ enable_otel=args.otel,
74
+ otel_endpoint=args.otel_endpoint,
75
+ otel_headers=args.otel_headers,
76
+ otel_public_key=args.otel_public_key,
77
+ otel_secret_key=args.otel_secret_key,
78
+ otel_protocol=args.otel_protocol,
79
+ debug=args.debug,
80
+ )
81
+
82
+
83
+ if __name__ == "__main__":
84
+ agent_server()
@@ -0,0 +1,7 @@
1
+ """OneTrust API client layer.
2
+
3
+ ``api_client_base`` holds the hand-authored HTTP/auth/pagination machinery; the
4
+ ``api_client_<domain>`` modules are generated from the vendored OpenAPI specs by
5
+ ``scripts/generate_from_openapi.py`` and composed into the single ``Api`` class in
6
+ ``onetrust_api.api_client``.
7
+ """