imbi-api 2.66.0__tar.gz → 2.68.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.
- {imbi_api-2.66.0 → imbi_api-2.68.0}/PKG-INFO +2 -2
- {imbi_api-2.66.0 → imbi_api-2.68.0}/pyproject.toml +2 -2
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/agent_tools.py +1 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/agent_api.py +11 -7
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/agent_api_routes.py +38 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/authorization_codes.py +30 -17
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/organizations.py +133 -8
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/seed.py +26 -2
- imbi_api-2.68.0/src/imbi/api/document_orgs.py +118 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/drift.py +14 -12
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/__init__.py +0 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/_document_reads.py +46 -13
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/_document_scope.py +14 -15
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/_helpers.py +7 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/admin_plugins.py +2 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/agent_platform.py +0 -2
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/agent_usage.py +0 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/agents.py +21 -11
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/ai_model_defaults.py +0 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/ai_models.py +0 -2
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/ai_providers.py +0 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/auth.py +125 -12
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/comments.py +11 -30
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/document_analytics.py +43 -15
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/document_presence.py +14 -13
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/documents.py +92 -18
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/environments.py +20 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/harness.py +97 -10
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/integration_workflow_steps.py +0 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/maintenance.py +115 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/mcp_servers.py +0 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/operations_log.py +0 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/organizations.py +225 -151
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/project_deployments.py +74 -36
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/project_integrations.py +0 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/project_plugins.py +0 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/project_types.py +11 -5
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/projects.py +133 -11
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/prompts.py +738 -275
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/pull_requests.py +11 -5
- imbi_api-2.68.0/src/imbi/api/endpoints/release_periods.py +773 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/scoring.py +6 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/search.py +13 -24
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/secret_broker.py +0 -6
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/ticket_harness.py +1 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/tickets.py +135 -24
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/uploads.py +20 -2
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/user_activity.py +27 -5
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/workflow_runs.py +21 -11
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/workflows.py +23 -9
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/harness/__init__.py +2 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/harness/store.py +24 -7
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/llm/prompted.py +8 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/maintenance/log.py +93 -6
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/maintenance/operations.py +60 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/maintenance/registry.py +56 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/maintenance/worker.py +3 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/mcp_test.py +6 -1
- imbi_api-2.68.0/src/imbi/api/prompt_orgs.py +197 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/prompts/seed.py +3 -1
- imbi_api-2.68.0/src/imbi/api/release_periods.py +275 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/release_promote/service.py +21 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/secret_broker/broker.py +148 -52
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/secret_broker/schemata.toml +6 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/tickets/__init__.py +4 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/tickets/schemata.toml +102 -3
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/tickets/store.py +359 -49
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/workflows/__init__.py +5 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/workflows/runs.py +10 -5
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/workflows/runtime_schemata.toml +21 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/workflows/schemata.toml +12 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/workflows/store.py +1 -1
- imbi_api-2.68.0/src/imbi/api/workflows/ticket_trigger.py +450 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/test_oauth_server.py +191 -5
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/test_organizations.py +320 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/test_seed.py +2 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_admin_plugins.py +29 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_agent_api.py +19 -3
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_agent_task_actions.py +43 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_agent_task_harness.py +22 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_agent_task_log.py +6 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_agent_task_relations.py +1 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_agent_tasks.py +58 -7
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_agents.py +12 -6
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_ai_providers.py +1 -3
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_auth.py +104 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_comments.py +2 -7
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_comments_attention.py +2 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_components.py +1 -8
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_cross_org_reads.py +24 -14
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_document_likes.py +1 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_document_presence.py +7 -2
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_document_reads.py +17 -3
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_document_reads_sql.py +206 -3
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_document_templates.py +1 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_document_versions.py +1 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_documents.py +1 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_environments.py +84 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_events.py +1 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_harness.py +119 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_harness_egress.py +1 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_harness_secrets.py +13 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_integrations.py +1 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_link_definitions.py +1 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_maintenance.py +98 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_mcp_servers.py +3 -7
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_operations_log.py +1 -6
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_organizations.py +24 -8
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_person_tickets.py +1 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_analysis.py +4 -10
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_configuration.py +1 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_deployments.py +251 -5
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_deployments_autonomous.py +8 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_incidents.py +1 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_integrations.py +1 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_lifecycle.py +1 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_stars.py +1 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_types.py +14 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_projects.py +15 -13
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_prompt_decisions.py +22 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_prompt_generative.py +44 -61
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_prompts.py +555 -160
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_pull_requests.py +22 -4
- imbi_api-2.68.0/tests/endpoints/test_release_periods_graph.py +460 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_releases.py +1 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_scoring.py +1 -4
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_search.py +32 -58
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_tags.py +1 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_teams.py +2 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_ticket_handoff.py +152 -0
- imbi_api-2.68.0/tests/endpoints/test_ticket_links.py +94 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_ticket_reopen.py +24 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_ticket_waiting.py +1 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_uploads.py +23 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_webhooks.py +2 -7
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_workflow_runs.py +81 -3
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/support.py +15 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_agent_platform.py +3 -2
- imbi_api-2.68.0/tests/test_document_org_scope.py +196 -0
- imbi_api-2.68.0/tests/test_document_orgs.py +122 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_drift.py +26 -10
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_maintenance_log.py +77 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_mcp_server_orgs.py +3 -1
- imbi_api-2.68.0/tests/test_prompt_orgs.py +258 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_prompt_seed.py +3 -1
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_prompted.py +1 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_release_promote_service.py +38 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_secret_broker.py +255 -10
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_ticket_state_trigger.py +270 -3
- imbi_api-2.66.0/src/imbi/api/workflows/ticket_trigger.py +0 -266
- {imbi_api-2.66.0 → imbi_api-2.68.0}/.gitignore +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/README.md +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/moon.yml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/README.md +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/ai_catalog_orgs.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/app.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/autonomous.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/internal_services.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/local_auth.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/login_providers.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/membership.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/models.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/oauth_clients.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/password.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/permissions.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/principals.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/sessions.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/tokens.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/auth/totp.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/blueprint_attributes.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/blueprint_compliance.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/blueprint_sections.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/blueprint_values.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/commit_sync/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/commit_sync/queue.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/commit_sync/service.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/component_facts.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/component_governance_orgs.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/conversation_orgs.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/cves.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/deployment_sweeper.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/deployment_sync/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/deployment_sync/queue.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/deployment_sync/service.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/documents/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/documents/read_sweeper.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/domain/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/domain/models.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/domain/scoring.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/drift_classifier.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/email/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/email/client.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/email/dependencies.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/email/models.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/email/templates/base.html +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/email/templates/base.txt +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/email/templates/password_reset.html +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/email/templates/password_reset.txt +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/email/templates/welcome.html +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/email/templates/welcome.txt +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/email/templates.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/_credentials.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/_document_events.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/_document_history.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/_json_fields.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/_local_time.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/_pagination.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/_request_urls.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/_search_index.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/admin.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/ai_proxy.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/api_keys.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/auth_providers.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/blueprints.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/client_credentials.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/components.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/cves.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/dashboard.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/document_likes.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/document_templates.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/document_versions.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/events.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/graph_query.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/iggy_connectors.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/integrations.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/link_definitions.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/local_auth.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/mfa.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/oauth_metadata.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/plugin_edges.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/plugin_entities.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/plugins.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/project_analysis.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/project_commit_sync.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/project_configuration.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/project_incidents.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/project_lifecycle.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/project_logs.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/project_pr_sync.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/project_stars.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/releases.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/roles.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/sa_api_keys.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/scoring_policies.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/service_accounts.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/status.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/tags.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/teams.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/users.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/endpoints/webhooks.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/entrypoint.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/graph_sql.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/harness/auth.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/harness/egress.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/harness/marketplaces.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/harness/metrics.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/harness/platform.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/harness/schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/harness/sweeper.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/harness/tokens.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/identity/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/identity/attribution.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/identity/endpoints.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/identity/errors.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/identity/flows.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/identity/host_integration.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/identity/models.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/identity/repository.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/identity/resolution.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/identity/state.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/identity/sweeper.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/iggy_metrics.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/lifespans.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/llm/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/llm/dependencies.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/llm/generate.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/llm/tokens.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/maintenance/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/maintenance/state.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/mcp_server_orgs.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/middleware/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/middleware/rate_limit.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/model_calls/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/model_calls/schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/models.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/openapi.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/orphan_releases.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/plugins/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/plugins/assignment_writer.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/plugins/assignments.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/plugins/credentials.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/plugins/installer.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/plugins/lifecycle.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/plugins/lifecycle_dispatch.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/plugins/release_dispatch.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/plugins/reload.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/plugins/resolution.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/plugins/schemas.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/pr_sync/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/pr_sync/queue.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/pr_sync/service.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/preferences/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/preferences/schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/prompts/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/prompts/release_notes_system.md +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/py.typed +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/relationships.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/release_promote/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/release_promote/queue.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/sbom.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/scoring/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/scoring/queue.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/secret_broker/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/secret_broker/audit.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/secret_broker/identity.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/secret_broker/model_key.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/secret_broker/providers.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/secret_broker/store.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/settings.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/storage/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/storage/client.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/storage/dependencies.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/storage/thumbnails.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/storage/validation.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/tags.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/teams.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/tickets/announce.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/tickets/custom_fields.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/tickets/log.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/tickets/sweeper.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/workflows/plugin_calls.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/workflows/sweeper.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/src/imbi/api/workflows/tickets.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/test_authentication.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/test_authorization.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/test_encryption.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/test_internal_services.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/test_login_providers.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/test_membership.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/test_permissions.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/test_sessions.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/auth/test_totp.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/clickhouse/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/clickhouse/test_client.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/clickhouse/test_init.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/clickhouse/test_privacy.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/email/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/email/test_audit_clickhouse.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/email/test_client.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/email/test_init.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/email/test_integration.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/email/test_models.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/email/test_templates.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_admin.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_agent_platform.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_agent_usage.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_ai_model_defaults.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_ai_models.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_ai_proxy.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_api_keys.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_auth_providers.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_blueprints.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_caller_org_slugs.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_client_credentials.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_components_graph.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_credentials.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_cves.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_dashboard.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_document_analytics.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_github_app_repository.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_graph_query.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_iggy_connectors.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_init.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_integration_workflow_steps.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_integration_workflow_steps_choices.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_json_fields.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_local_auth.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_mfa.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_pagination.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_plugin_label_validation.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_plugins.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_commit_sync.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_logs.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_plugins.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_project_response_surfacing.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_projects_bulk_graph.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_projects_helpers.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_request_urls.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_roles.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_sa_api_keys.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_scoring_policies.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_search_index.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_secret_broker.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_service_accounts.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_service_writeback.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_shared_identifier.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_status.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_ticket_agent_activity.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_ticket_attributes.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_ticket_custom_fields.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_ticket_units.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_user_activity.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_user_preferences.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_users.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_workflow_run_history.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_workflow_triggers.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/endpoints/test_workflows.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/marketplaces/claude-code.json +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/release_2_58/harness_schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/release_2_58/tickets_schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/release_a/harness_schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/release_a/tickets_schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/release_a_minus_1/agent_runtime_schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/release_a_minus_1/harness_schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/release_b/harness_schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/release_b/tickets_schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/release_b1/harness_schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/release_b1/tickets_schemata.toml +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/sbom/npm-realistic.json +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/sbom/pypi-realistic.json +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/fixtures/sbom/tiny.json +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/identity/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/identity/test_endpoints.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/identity/test_errors.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/identity/test_flows.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/identity/test_host_integration.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/identity/test_repository.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/identity/test_resolution.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/identity/test_state.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/identity/test_sweeper.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/marketplace_support.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/middleware/test_rate_limit.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/secret_support.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/storage/__init__.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/storage/test_client.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/storage/test_init.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/storage/test_thumbnails.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/storage/test_validation.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_agent_task_events_e2e.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_agent_tools.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_ai_catalog_orgs.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_ai_provider_tokens.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_app.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_assignment_writer.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_auth_settings.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_blueprint_attributes.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_blueprint_compliance.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_blueprint_values.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_blueprints.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_clickhouse_project_ids.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_commit_sync_queue.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_commit_sync_service.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_component_facts.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_cves.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_deployment_array_drop.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_deployment_sweeper.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_deployment_sync_queue.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_deployment_sync_service.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_drift_classifier.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_entrypoint.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_graph_sql.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_identity_attribution.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_iggy_metrics.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_init.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_installer.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_lifecycle_dispatch.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_lifespans.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_maintenance_operations.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_maintenance_state.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_maintenance_worker.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_model_calls.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_models.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_openapi.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_orphan_releases.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_plugin_schemas.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_plugins.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_plugins_assignments.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_plugins_credentials.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_pr_sync_queue.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_pr_sync_service.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_projects_drift_ranges.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_pull_request_resync_clickhouse.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_pull_request_reviews_clickhouse.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_pull_requests_pending_deploy.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_release_dispatch.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_sbom.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_scoring_queue.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_scoring_triggers.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_secret_github_app.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_secret_identity.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_secret_mcp_credential.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_secret_providers.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_settings.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_tags.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_tickets_rename.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_workflow_reconcile.py +0 -0
- {imbi_api-2.66.0 → imbi_api-2.68.0}/tests/test_workflow_tickets.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: imbi-api
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.68.0
|
|
4
4
|
Summary: Imbi is the open-source service catalog that tracks every service's ownership, deployments, and health, and runs the AI agents and workflows that fix them.
|
|
5
5
|
Author-email: Alex Campbell <alexc@aweber.com>, Dave Shawley <daves@aweber.com>, "Gavin M. Roy" <gavinr@aweber.com>
|
|
6
6
|
License-Expression: BSD-3-Clause
|
|
@@ -21,7 +21,7 @@ Requires-Dist: filetype
|
|
|
21
21
|
Requires-Dist: httpx2>=2.16.2
|
|
22
22
|
Requires-Dist: httpx<1,>=0.28.1
|
|
23
23
|
Requires-Dist: idna>=3.18
|
|
24
|
-
Requires-Dist: imbi-common[databases,llm,mcp,script,sentry,server]==2.
|
|
24
|
+
Requires-Dist: imbi-common[databases,llm,mcp,script,sentry,server]==2.68.0
|
|
25
25
|
Requires-Dist: jinja2
|
|
26
26
|
Requires-Dist: jsonpatch>=1.33
|
|
27
27
|
Requires-Dist: jsonschema>=4.26
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "imbi-api"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.68.0"
|
|
4
4
|
description = "Imbi is the open-source service catalog that tracks every service's ownership, deployments, and health, and runs the AI agents and workflows that fix them."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.14"
|
|
@@ -30,7 +30,7 @@ dependencies = [
|
|
|
30
30
|
"httpx>=0.28.1,<1",
|
|
31
31
|
"httpx2>=2.16.2",
|
|
32
32
|
"idna>=3.18",
|
|
33
|
-
"imbi-common[databases,llm,mcp,script,sentry,server]==2.
|
|
33
|
+
"imbi-common[databases,llm,mcp,script,sentry,server]==2.68.0",
|
|
34
34
|
"jinja2",
|
|
35
35
|
"jsonpatch>=1.33",
|
|
36
36
|
"jsonschema>=4.26",
|
|
@@ -142,7 +142,7 @@ def index(app: fastapi.FastAPI) -> None:
|
|
|
142
142
|
for route in app.routes
|
|
143
143
|
if isinstance(route, fastapi.routing.APIRoute)
|
|
144
144
|
for method in route.methods
|
|
145
|
-
if keys.get((route.endpoint, method)) in DEFAULT_ROUTES
|
|
145
|
+
if keys.get((route.endpoint, route.path, method)) in DEFAULT_ROUTES
|
|
146
146
|
)
|
|
147
147
|
|
|
148
148
|
|
|
@@ -131,15 +131,18 @@ def refused(module: str, method: str, key: str | None = None) -> bool:
|
|
|
131
131
|
|
|
132
132
|
def route_keys(
|
|
133
133
|
app: fastapi.FastAPI, prefix: str
|
|
134
|
-
) -> dict[tuple[typing.Any, str], str]:
|
|
135
|
-
"""``(endpoint, method)`` to ``"METHOD /template"`` (the
|
|
136
|
-
without the API prefix) for every mounted API route.
|
|
137
|
-
|
|
134
|
+
) -> dict[tuple[typing.Any, str, str], str]:
|
|
135
|
+
"""``(endpoint, path, method)`` to ``"METHOD /template"`` (the
|
|
136
|
+
template without the API prefix) for every mounted API route. The
|
|
137
|
+
path is in the key because routes can share one endpoint."""
|
|
138
|
+
keys: dict[tuple[typing.Any, str, str], str] = {}
|
|
138
139
|
for route in app.routes:
|
|
139
140
|
if isinstance(route, routing.APIRoute):
|
|
140
141
|
template = route.path.removeprefix(prefix) or '/'
|
|
141
142
|
for method in route.methods:
|
|
142
|
-
keys[(route.endpoint, method)] =
|
|
143
|
+
keys[(route.endpoint, route.path, method)] = (
|
|
144
|
+
f'{method} {template}'
|
|
145
|
+
)
|
|
143
146
|
return keys
|
|
144
147
|
|
|
145
148
|
|
|
@@ -256,10 +259,11 @@ async def guard(
|
|
|
256
259
|
return
|
|
257
260
|
endpoint = request.scope.get('endpoint')
|
|
258
261
|
module = str(getattr(endpoint, '__module__', ''))
|
|
259
|
-
keys: dict[tuple[typing.Any, str], str] = getattr(
|
|
262
|
+
keys: dict[tuple[typing.Any, str, str], str] = getattr(
|
|
260
263
|
request.app.state, 'agent_api_routes', {}
|
|
261
264
|
)
|
|
262
|
-
|
|
265
|
+
path = getattr(request.scope.get('route'), 'path', '')
|
|
266
|
+
key = keys.get((endpoint, path, request.method))
|
|
263
267
|
org_slug: str | None
|
|
264
268
|
if core.is_agent_api_token(token):
|
|
265
269
|
error = 'agent_api_forbidden'
|
|
@@ -17,6 +17,7 @@ ALLOWED_ROUTES: frozenset[str] = frozenset(
|
|
|
17
17
|
'DELETE /organizations/{org_slug}/document-templates/{slug}',
|
|
18
18
|
'DELETE /organizations/{org_slug}/documents/{document_id}',
|
|
19
19
|
'DELETE /organizations/{org_slug}/documents/{document_id}/comments/{thread_id}/comments/{comment_id}',
|
|
20
|
+
'DELETE /organizations/{org_slug}/projects/{project_id}/documents/{document_id}/comments/{thread_id}/comments/{comment_id}',
|
|
20
21
|
'DELETE /organizations/{org_slug}/documents/{document_id}/editing',
|
|
21
22
|
'DELETE /organizations/{org_slug}/documents/{document_id}/like',
|
|
22
23
|
'DELETE /organizations/{org_slug}/environments/{slug}',
|
|
@@ -38,6 +39,11 @@ ALLOWED_ROUTES: frozenset[str] = frozenset(
|
|
|
38
39
|
'GET /operations-log/plugin-templates',
|
|
39
40
|
'GET /organizations/{org_slug}/agent-marketplaces/',
|
|
40
41
|
'GET /organizations/{org_slug}/agent-platform-config/',
|
|
42
|
+
'GET /organizations/{org_slug}/projects/{project_id}/release-period-status',
|
|
43
|
+
'GET /organizations/{org_slug}/release-approvals',
|
|
44
|
+
'GET /organizations/{org_slug}/release-approvals/pending',
|
|
45
|
+
'GET /organizations/{org_slug}/release-periods',
|
|
46
|
+
'GET /organizations/{org_slug}/release-periods/{slug}',
|
|
41
47
|
'GET /organizations/{org_slug}/tickets/',
|
|
42
48
|
'GET /organizations/{org_slug}/tickets/counts',
|
|
43
49
|
'GET /organizations/{org_slug}/tickets/labels',
|
|
@@ -45,6 +51,7 @@ ALLOWED_ROUTES: frozenset[str] = frozenset(
|
|
|
45
51
|
'GET /organizations/{org_slug}/tickets/waiting',
|
|
46
52
|
'GET /organizations/{org_slug}/tickets/{short_id}',
|
|
47
53
|
'GET /organizations/{org_slug}/tickets/{short_id}/events',
|
|
54
|
+
'GET /organizations/{org_slug}/tickets/{short_id}/links',
|
|
48
55
|
'GET /organizations/{org_slug}/tickets/{short_id}/position',
|
|
49
56
|
'GET /organizations/{org_slug}/tickets/{short_id}/projects',
|
|
50
57
|
'GET /organizations/{org_slug}/tickets/{short_id}/relations',
|
|
@@ -67,6 +74,7 @@ ALLOWED_ROUTES: frozenset[str] = frozenset(
|
|
|
67
74
|
'GET /organizations/{org_slug}/documents/{document_id}/analytics',
|
|
68
75
|
'GET /organizations/{org_slug}/documents/{document_id}/analytics/readers',
|
|
69
76
|
'GET /organizations/{org_slug}/documents/{document_id}/comments',
|
|
77
|
+
'GET /organizations/{org_slug}/projects/{project_id}/documents/{document_id}/comments',
|
|
70
78
|
'GET /organizations/{org_slug}/documents/{document_id}/editing',
|
|
71
79
|
'GET /organizations/{org_slug}/documents/{document_id}/likes',
|
|
72
80
|
'GET /organizations/{org_slug}/documents/{document_id}/versions',
|
|
@@ -131,6 +139,8 @@ ALLOWED_ROUTES: frozenset[str] = frozenset(
|
|
|
131
139
|
'GET /organizations/{org_slug}/projects/{project_id}/score/history',
|
|
132
140
|
'GET /organizations/{org_slug}/projects/{project_id}/score/trend',
|
|
133
141
|
'GET /organizations/{org_slug}/projects/{project_id}/services/',
|
|
142
|
+
# The prompts the organization uses: its own and the defaults.
|
|
143
|
+
'GET /organizations/{org_slug}/prompts/',
|
|
134
144
|
'GET /organizations/{org_slug}/pull-requests/',
|
|
135
145
|
'GET /organizations/{org_slug}/pull-requests/activity',
|
|
136
146
|
'GET /organizations/{org_slug}/pull-requests/pending-deploy',
|
|
@@ -170,7 +180,9 @@ ALLOWED_ROUTES: frozenset[str] = frozenset(
|
|
|
170
180
|
'PATCH /organizations/{org_slug}/document-templates/{slug}',
|
|
171
181
|
'PATCH /organizations/{org_slug}/documents/{document_id}',
|
|
172
182
|
'PATCH /organizations/{org_slug}/documents/{document_id}/comments/{thread_id}',
|
|
183
|
+
'PATCH /organizations/{org_slug}/projects/{project_id}/documents/{document_id}/comments/{thread_id}',
|
|
173
184
|
'PATCH /organizations/{org_slug}/documents/{document_id}/comments/{thread_id}/comments/{comment_id}',
|
|
185
|
+
'PATCH /organizations/{org_slug}/projects/{project_id}/documents/{document_id}/comments/{thread_id}/comments/{comment_id}',
|
|
174
186
|
'PATCH /organizations/{org_slug}/environments/{slug}',
|
|
175
187
|
'PATCH /organizations/{org_slug}/link-definitions/{slug}',
|
|
176
188
|
'PATCH /organizations/{org_slug}/project-types/{slug}',
|
|
@@ -184,8 +196,11 @@ ALLOWED_ROUTES: frozenset[str] = frozenset(
|
|
|
184
196
|
'POST /organizations/{org_slug}/operations-log/',
|
|
185
197
|
'POST /organizations/{org_slug}/document-templates/',
|
|
186
198
|
'POST /organizations/{org_slug}/documents/{document_id}/comments',
|
|
199
|
+
'POST /organizations/{org_slug}/projects/{project_id}/documents/{document_id}/comments',
|
|
187
200
|
'POST /organizations/{org_slug}/documents/{document_id}/comments/{thread_id}/comments',
|
|
201
|
+
'POST /organizations/{org_slug}/projects/{project_id}/documents/{document_id}/comments/{thread_id}/comments',
|
|
188
202
|
'POST /organizations/{org_slug}/documents/{document_id}/comments/{thread_id}/comments/{comment_id}/acknowledge',
|
|
203
|
+
'POST /organizations/{org_slug}/projects/{project_id}/documents/{document_id}/comments/{thread_id}/comments/{comment_id}/acknowledge',
|
|
189
204
|
'POST /organizations/{org_slug}/documents/{document_id}/read-events',
|
|
190
205
|
'POST /organizations/{org_slug}/documents/{document_id}/versions/{version}/restore',
|
|
191
206
|
'POST /organizations/{org_slug}/environments/',
|
|
@@ -239,11 +254,13 @@ REFUSED_ROUTES: frozenset[str] = frozenset(
|
|
|
239
254
|
{
|
|
240
255
|
# Platform administration: arbitrary graph queries, plugin entities, maintenance jobs
|
|
241
256
|
'DELETE /admin/plugins/{slug}/entities/{label}/{id}',
|
|
257
|
+
'DELETE /maintenance/pauses/{service}',
|
|
242
258
|
'PATCH /admin/plugins/{slug}/entities/{label}/{id}',
|
|
243
259
|
'POST /admin/graph/query',
|
|
244
260
|
'POST /admin/plugins/{slug}/entities/{label}',
|
|
245
261
|
'POST /maintenance/operations/{slug}/cancel',
|
|
246
262
|
'POST /maintenance/operations/{slug}/run',
|
|
263
|
+
'PUT /maintenance/pauses/{service}',
|
|
247
264
|
# Agent rules: platform configuration, marketplaces, AI models and providers, prompts and prompt runs
|
|
248
265
|
'DELETE /organizations/{org_slug}/ai-models/{id}',
|
|
249
266
|
'GET /organizations/{org_slug}/ai-models/',
|
|
@@ -259,7 +276,19 @@ REFUSED_ROUTES: frozenset[str] = frozenset(
|
|
|
259
276
|
'PATCH /prompts/{namespace}/{slug}',
|
|
260
277
|
'POST /organizations/{org_slug}/agent-marketplaces/',
|
|
261
278
|
'POST /organizations/{org_slug}/agent-marketplaces/{slug}/sync',
|
|
279
|
+
'POST /organizations/{org_slug}/prompts/',
|
|
262
280
|
'POST /organizations/{org_slug}/prompts/run',
|
|
281
|
+
'POST /organizations/{org_slug}/prompts/{namespace}/{slug}/override',
|
|
282
|
+
'DELETE /organizations/{org_slug}/prompts/{namespace}/{slug}',
|
|
283
|
+
'DELETE /organizations/{org_slug}/prompts/{namespace}/{slug}/labels/{label}',
|
|
284
|
+
'GET /organizations/{org_slug}/prompts/resolve',
|
|
285
|
+
'GET /organizations/{org_slug}/prompts/{namespace}/{slug}',
|
|
286
|
+
'GET /organizations/{org_slug}/prompts/{namespace}/{slug}/versions',
|
|
287
|
+
'GET /organizations/{org_slug}/prompts/{namespace}/{slug}/versions/{n}',
|
|
288
|
+
'POST /organizations/{org_slug}/prompts/{namespace}/{slug}/versions',
|
|
289
|
+
'PUT /organizations/{org_slug}/prompts/{namespace}/{slug}/default-label',
|
|
290
|
+
'PUT /organizations/{org_slug}/prompts/{namespace}/{slug}/labels/{label}',
|
|
291
|
+
'PUT /organizations/{org_slug}/prompts/{namespace}/{slug}/versions/{n}/evaluation',
|
|
263
292
|
'POST /prompts/',
|
|
264
293
|
'POST /prompts/{namespace}/{slug}/versions',
|
|
265
294
|
'PUT /organizations/{org_slug}/agent-platform-config/',
|
|
@@ -268,8 +297,15 @@ REFUSED_ROUTES: frozenset[str] = frozenset(
|
|
|
268
297
|
'PUT /prompts/{namespace}/{slug}/default-label',
|
|
269
298
|
'PUT /prompts/{namespace}/{slug}/labels/{label}',
|
|
270
299
|
'PUT /prompts/{namespace}/{slug}/versions/{n}/evaluation',
|
|
300
|
+
# Release periods: an agent refused by a period stops and reports it; only an admin approves a change
|
|
301
|
+
'DELETE /organizations/{org_slug}/release-approvals/{approval_id}',
|
|
302
|
+
'DELETE /organizations/{org_slug}/release-periods/{slug}',
|
|
303
|
+
'PATCH /organizations/{org_slug}/release-periods/{slug}',
|
|
304
|
+
'POST /organizations/{org_slug}/release-approvals/bulk',
|
|
305
|
+
'POST /organizations/{org_slug}/release-periods',
|
|
271
306
|
# Tickets: an agent works on its tickets through the harness routes only, so it cannot answer its own approval or question, reassign, or start another agent outside its chain
|
|
272
307
|
'DELETE /organizations/{org_slug}/tickets/{short_id}',
|
|
308
|
+
'DELETE /organizations/{org_slug}/tickets/{short_id}/links',
|
|
273
309
|
'DELETE /organizations/{org_slug}/tickets/{short_id}/projects/{project_id}',
|
|
274
310
|
'DELETE /organizations/{org_slug}/tickets/{short_id}/requires/{prerequisite}',
|
|
275
311
|
'PATCH /organizations/{org_slug}/tickets/{short_id}',
|
|
@@ -278,6 +314,7 @@ REFUSED_ROUTES: frozenset[str] = frozenset(
|
|
|
278
314
|
'POST /organizations/{org_slug}/tickets/{short_id}/acknowledge',
|
|
279
315
|
'POST /organizations/{org_slug}/tickets/{short_id}/cancel',
|
|
280
316
|
'POST /organizations/{org_slug}/tickets/{short_id}/hand-off',
|
|
317
|
+
'POST /organizations/{org_slug}/tickets/{short_id}/links',
|
|
281
318
|
'POST /organizations/{org_slug}/tickets/{short_id}/pause',
|
|
282
319
|
'POST /organizations/{org_slug}/tickets/{short_id}/priority',
|
|
283
320
|
'POST /organizations/{org_slug}/tickets/{short_id}/rank',
|
|
@@ -384,6 +421,7 @@ REFUSED_ROUTES: frozenset[str] = frozenset(
|
|
|
384
421
|
'GET /maintenance/log',
|
|
385
422
|
'GET /maintenance/operations',
|
|
386
423
|
'GET /maintenance/operations/{slug}',
|
|
424
|
+
'GET /maintenance/pauses',
|
|
387
425
|
# Shared records that hold data of other organizations: the
|
|
388
426
|
# prompt library holds every organization's agent prompts
|
|
389
427
|
# (agents/<org>.<agent>), and component release notes are
|
|
@@ -6,9 +6,10 @@ authenticated principal, and scope) and stores it in Valkey with a short
|
|
|
6
6
|
TTL. ``/auth/token`` redeems it with an atomic ``GETDEL`` so a code can
|
|
7
7
|
only be exchanged once, then verifies the PKCE code verifier.
|
|
8
8
|
|
|
9
|
-
Before a code is minted the user must approve the client
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Before a code is minted the user must approve the client and pick the
|
|
10
|
+
organization that the token works in. The pending request is held under
|
|
11
|
+
a single-use consent token, and an approval is remembered per (user,
|
|
12
|
+
client) with that organization, so a known client skips the prompt.
|
|
12
13
|
"""
|
|
13
14
|
|
|
14
15
|
import base64
|
|
@@ -37,6 +38,9 @@ class CodePayload(typing.TypedDict):
|
|
|
37
38
|
code_challenge: str
|
|
38
39
|
principal_id: str
|
|
39
40
|
scope: str | None
|
|
41
|
+
#: The organization that the token works in (ADR 0035); ``None``
|
|
42
|
+
#: for a user in no organization.
|
|
43
|
+
org_slug: str | None
|
|
40
44
|
|
|
41
45
|
|
|
42
46
|
async def issue_code(
|
|
@@ -47,6 +51,7 @@ async def issue_code(
|
|
|
47
51
|
code_challenge: str,
|
|
48
52
|
principal_id: str,
|
|
49
53
|
scope: str | None,
|
|
54
|
+
org_slug: str | None,
|
|
50
55
|
) -> str:
|
|
51
56
|
"""Mint and store a single-use authorization code, returning it."""
|
|
52
57
|
code = secrets.token_urlsafe(32)
|
|
@@ -56,6 +61,7 @@ async def issue_code(
|
|
|
56
61
|
'code_challenge': code_challenge,
|
|
57
62
|
'principal_id': principal_id,
|
|
58
63
|
'scope': scope,
|
|
64
|
+
'org_slug': org_slug,
|
|
59
65
|
}
|
|
60
66
|
await valkey_client.set( # pyright: ignore[reportUnknownMemberType]
|
|
61
67
|
f'{_KEY_PREFIX}{code}', json.dumps(payload), ex=_TTL_SECONDS
|
|
@@ -97,7 +103,9 @@ def verify_pkce(code_verifier: str, code_challenge: str) -> bool:
|
|
|
97
103
|
# -- user consent ---------------------------------------------------------
|
|
98
104
|
|
|
99
105
|
_CONSENT_TOKEN_PREFIX = 'oauth:consent-token:'
|
|
100
|
-
|
|
106
|
+
# v2: an approval names the organization. An approval stored before
|
|
107
|
+
# that names none, so the user approves again and picks one.
|
|
108
|
+
_CONSENT_GRANT_PREFIX = 'oauth:consent-grant:v2:'
|
|
101
109
|
# Time the user has to click Approve or Deny on the consent page.
|
|
102
110
|
_CONSENT_TOKEN_TTL_SECONDS = 300
|
|
103
111
|
# Time a remembered approval lets a client skip the consent page.
|
|
@@ -151,30 +159,35 @@ def _grant_key(principal_id: str, client_id: str, redirect_uri: str) -> str:
|
|
|
151
159
|
|
|
152
160
|
|
|
153
161
|
async def remember_consent(
|
|
154
|
-
valkey_client: valkey_module.Valkey,
|
|
162
|
+
valkey_client: valkey_module.Valkey,
|
|
163
|
+
payload: ConsentPayload,
|
|
164
|
+
org_slug: str,
|
|
155
165
|
) -> None:
|
|
156
|
-
"""Record that the user approved the client for this redirect URI
|
|
166
|
+
"""Record that the user approved the client for this redirect URI,
|
|
167
|
+
in the organization ``org_slug``."""
|
|
157
168
|
await valkey_client.set( # pyright: ignore[reportUnknownMemberType]
|
|
158
169
|
_grant_key(
|
|
159
170
|
payload['principal_id'],
|
|
160
171
|
payload['client_id'],
|
|
161
172
|
payload['redirect_uri'],
|
|
162
173
|
),
|
|
163
|
-
|
|
174
|
+
org_slug,
|
|
164
175
|
ex=_CONSENT_GRANT_TTL_SECONDS,
|
|
165
176
|
)
|
|
166
177
|
|
|
167
178
|
|
|
168
|
-
async def
|
|
179
|
+
async def consented_org(
|
|
169
180
|
valkey_client: valkey_module.Valkey, payload: ConsentPayload
|
|
170
|
-
) ->
|
|
171
|
-
"""
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
)
|
|
181
|
+
) -> str | None:
|
|
182
|
+
"""The organization of the user's approval of this client and URI,
|
|
183
|
+
or ``None`` for no approval."""
|
|
184
|
+
raw = await valkey_client.get( # pyright: ignore[reportUnknownMemberType]
|
|
185
|
+
_grant_key(
|
|
186
|
+
payload['principal_id'],
|
|
187
|
+
payload['client_id'],
|
|
188
|
+
payload['redirect_uri'],
|
|
179
189
|
)
|
|
180
190
|
)
|
|
191
|
+
if raw is None:
|
|
192
|
+
return None
|
|
193
|
+
return raw.decode('utf-8') if isinstance(raw, bytes) else str(raw)
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"""Membership of the organization in the request path.
|
|
2
2
|
|
|
3
|
-
Most permissions are not scoped to an organization.
|
|
4
|
-
``/organizations/{org_slug}/...``
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
``
|
|
9
|
-
|
|
3
|
+
Most permissions are not scoped to an organization. Most routers
|
|
4
|
+
mounted at ``/organizations/{org_slug}/...`` are in ``org_router``
|
|
5
|
+
(:mod:`imbi.api.endpoints.organizations`), which has
|
|
6
|
+
:func:`member_org_id` as a router dependency, so that a caller can
|
|
7
|
+
only use the routes of an organization that they are a member of
|
|
8
|
+
(``MEMBER_OF``). Three mounts are outside it and add their own check:
|
|
9
|
+
the document presence and document analytics routers use
|
|
10
|
+
:func:`member_org_id` on a direct mount, and the ticket harness router
|
|
11
|
+
uses ``harness_member_org_id`` on a direct mount. A
|
|
12
|
+
caller that is not a member gets ``403 organization_forbidden``, as in
|
|
13
|
+
:mod:`imbi.api.auth.autonomous`. There is no admin bypass.
|
|
10
14
|
|
|
11
15
|
A member's permissions on these routes are those of their role in that
|
|
12
16
|
organization only (issue #455): :func:`check_member` narrows
|
|
@@ -16,13 +20,16 @@ the route's own, so each ``require_permission`` check sees the narrowed
|
|
|
16
20
|
set.
|
|
17
21
|
"""
|
|
18
22
|
|
|
23
|
+
import hashlib
|
|
19
24
|
import logging
|
|
25
|
+
import time
|
|
20
26
|
import typing
|
|
21
27
|
|
|
22
28
|
import fastapi
|
|
29
|
+
import pydantic
|
|
23
30
|
|
|
24
31
|
from imbi.api.auth import autonomous, permissions
|
|
25
|
-
from imbi.common import graph
|
|
32
|
+
from imbi.common import graph, valkey
|
|
26
33
|
from imbi.common.auth import permissions as common_permissions
|
|
27
34
|
|
|
28
35
|
LOGGER = logging.getLogger(__name__)
|
|
@@ -34,6 +41,21 @@ OPTIONAL MATCH (u:User {{email: {email}}})-[:MEMBER_OF]->(o)
|
|
|
34
41
|
RETURN o.id AS id, u IS NOT NULL AS member
|
|
35
42
|
"""
|
|
36
43
|
|
|
44
|
+
#: How long :func:`cached_member_org_id` keeps a positive result.
|
|
45
|
+
#: A user who is removed from an organization, or whose role changes,
|
|
46
|
+
#: can keep the old access on these routes for this long.
|
|
47
|
+
MEMBER_CACHE_TTL_SECONDS = 30
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class _CachedMembership(pydantic.BaseModel):
|
|
51
|
+
"""A :func:`cached_member_org_id` entry in Valkey."""
|
|
52
|
+
|
|
53
|
+
org_id: typing.Annotated[str, pydantic.Field(min_length=1)]
|
|
54
|
+
permissions: list[str]
|
|
55
|
+
#: Wall-clock (``time.time()``) end of the entry. The Valkey expiry
|
|
56
|
+
#: starts when the write arrives, so a slow write can outlive it.
|
|
57
|
+
expires_at: float
|
|
58
|
+
|
|
37
59
|
|
|
38
60
|
def organization_id(value: object, slug: str) -> str:
|
|
39
61
|
"""The id of an organization node, parsed.
|
|
@@ -103,6 +125,109 @@ async def member_org_id(
|
|
|
103
125
|
return await check_member(org_slug, db, auth)
|
|
104
126
|
|
|
105
127
|
|
|
128
|
+
async def cached_member_org_id(
|
|
129
|
+
org_slug: str,
|
|
130
|
+
db: graph.Pool,
|
|
131
|
+
auth: typing.Annotated[
|
|
132
|
+
permissions.AuthContext, fastapi.Depends(permissions.get_current_user)
|
|
133
|
+
],
|
|
134
|
+
) -> str:
|
|
135
|
+
""":func:`member_org_id` that keeps a positive result for a user in
|
|
136
|
+
Valkey for :data:`MEMBER_CACHE_TTL_SECONDS`. A refusal is not kept.
|
|
137
|
+
|
|
138
|
+
Only for the document heartbeat routes, which a client calls every
|
|
139
|
+
few seconds (issue #1112). A removed or changed member keeps the old
|
|
140
|
+
access for the TTL, so use it only on routes that read data or
|
|
141
|
+
record the caller's own activity.
|
|
142
|
+
|
|
143
|
+
Raises:
|
|
144
|
+
403: The caller is not a member of the organization.
|
|
145
|
+
404: No such organization.
|
|
146
|
+
|
|
147
|
+
"""
|
|
148
|
+
key = _member_cache_key(org_slug, auth)
|
|
149
|
+
client = None
|
|
150
|
+
if key is not None:
|
|
151
|
+
try:
|
|
152
|
+
client = valkey.get_client()
|
|
153
|
+
cached = await client.get(key)
|
|
154
|
+
except Exception: # noqa: BLE001
|
|
155
|
+
LOGGER.debug('membership cache read failed', exc_info=True)
|
|
156
|
+
client = cached = None
|
|
157
|
+
if cached is not None:
|
|
158
|
+
try:
|
|
159
|
+
entry = _CachedMembership.model_validate_json(cached)
|
|
160
|
+
except pydantic.ValidationError:
|
|
161
|
+
LOGGER.debug('discarding malformed membership cache entry')
|
|
162
|
+
else:
|
|
163
|
+
if time.time() < entry.expires_at:
|
|
164
|
+
auth.permissions = set(entry.permissions)
|
|
165
|
+
return entry.org_id
|
|
166
|
+
# The TTL counts from the graph read, so a slow read or write does
|
|
167
|
+
# not make the entry live longer than the TTL after it.
|
|
168
|
+
expires_at = time.time() + MEMBER_CACHE_TTL_SECONDS
|
|
169
|
+
org_id = await check_member(org_slug, db, auth)
|
|
170
|
+
ttl_ms = int((expires_at - time.time()) * 1000)
|
|
171
|
+
if client is not None and key is not None and ttl_ms > 0:
|
|
172
|
+
try:
|
|
173
|
+
await client.set(
|
|
174
|
+
key,
|
|
175
|
+
_CachedMembership(
|
|
176
|
+
org_id=org_id,
|
|
177
|
+
permissions=sorted(auth.permissions),
|
|
178
|
+
expires_at=expires_at,
|
|
179
|
+
).model_dump_json(),
|
|
180
|
+
px=ttl_ms,
|
|
181
|
+
)
|
|
182
|
+
except Exception: # noqa: BLE001
|
|
183
|
+
LOGGER.debug('membership cache write failed', exc_info=True)
|
|
184
|
+
return org_id
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def _member_cache_key(
|
|
188
|
+
org_slug: str, auth: permissions.AuthContext
|
|
189
|
+
) -> str | None:
|
|
190
|
+
"""The cache key of a membership result, or ``None`` when the
|
|
191
|
+
result is not cached.
|
|
192
|
+
|
|
193
|
+
The key has the permissions before :func:`check_member` narrows
|
|
194
|
+
them, because an API key with fewer scopes gets fewer permissions.
|
|
195
|
+
Only users are cached: a service account, or a request on behalf of
|
|
196
|
+
another principal, has more checks than the key holds.
|
|
197
|
+
"""
|
|
198
|
+
if auth.user is None or auth.on_behalf_of is not None:
|
|
199
|
+
return None
|
|
200
|
+
scopes = hashlib.sha256(
|
|
201
|
+
'\n'.join(sorted(auth.permissions)).encode()
|
|
202
|
+
).hexdigest()[:16]
|
|
203
|
+
return f'imbi:org-member:{org_slug}:{auth.user.email}:{scopes}'
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
async def forget_member_cache(org_slug: str) -> None:
|
|
207
|
+
"""Remove the cached membership results of ``org_slug``.
|
|
208
|
+
|
|
209
|
+
Call this when an organization is deleted or its slug changes, so
|
|
210
|
+
that a new organization with the slug does not accept a member of
|
|
211
|
+
the old one. ponytail: a check that read the graph before the
|
|
212
|
+
change can still write an entry after this; it expires after
|
|
213
|
+
:data:`MEMBER_CACHE_TTL_SECONDS`.
|
|
214
|
+
"""
|
|
215
|
+
try:
|
|
216
|
+
client = valkey.get_client()
|
|
217
|
+
keys: list[bytes | str] = [
|
|
218
|
+
key # pyright: ignore[reportUnknownVariableType]
|
|
219
|
+
async for key in client.scan_iter( # pyright: ignore[reportUnknownMemberType,reportUnknownVariableType]
|
|
220
|
+
match=f'imbi:org-member:{org_slug}:*'
|
|
221
|
+
)
|
|
222
|
+
]
|
|
223
|
+
if keys:
|
|
224
|
+
await client.delete(*keys)
|
|
225
|
+
except Exception: # noqa: BLE001
|
|
226
|
+
LOGGER.warning(
|
|
227
|
+
'membership cache purge for %r failed', org_slug, exc_info=True
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
|
|
106
231
|
async def check_member(
|
|
107
232
|
org_slug: str, db: graph.Graph, auth: permissions.AuthContext
|
|
108
233
|
) -> str:
|
|
@@ -362,6 +362,31 @@ STANDARD_PERMISSIONS: list[tuple[str, str, str, str]] = [
|
|
|
362
362
|
'write',
|
|
363
363
|
'Mark packages, record advisories, and add package notes',
|
|
364
364
|
),
|
|
365
|
+
# Release periods: admin only (granted to no other default role)
|
|
366
|
+
(
|
|
367
|
+
'release_period:read',
|
|
368
|
+
'release_period',
|
|
369
|
+
'read',
|
|
370
|
+
'View release periods',
|
|
371
|
+
),
|
|
372
|
+
(
|
|
373
|
+
'release_period:write',
|
|
374
|
+
'release_period',
|
|
375
|
+
'write',
|
|
376
|
+
'Create, update, and delete release periods',
|
|
377
|
+
),
|
|
378
|
+
(
|
|
379
|
+
'release_approval:read',
|
|
380
|
+
'release_approval',
|
|
381
|
+
'read',
|
|
382
|
+
'View pending and granted release approvals',
|
|
383
|
+
),
|
|
384
|
+
(
|
|
385
|
+
'release_approval:write',
|
|
386
|
+
'release_approval',
|
|
387
|
+
'write',
|
|
388
|
+
'Approve and revoke changes during a release period',
|
|
389
|
+
),
|
|
365
390
|
# Tag management
|
|
366
391
|
('tag:create', 'tag', 'create', 'Create tags'),
|
|
367
392
|
('tag:read', 'tag', 'read', 'View tags'),
|
|
@@ -887,7 +912,7 @@ DEFAULT_ROLES: list[tuple[str, str, str, int, list[str], bool]] = [
|
|
|
887
912
|
(
|
|
888
913
|
'developer',
|
|
889
914
|
'Developer',
|
|
890
|
-
'Standard developer access to projects
|
|
915
|
+
'Standard developer access to projects',
|
|
891
916
|
500,
|
|
892
917
|
[
|
|
893
918
|
'agent:create',
|
|
@@ -898,7 +923,6 @@ DEFAULT_ROLES: list[tuple[str, str, str, int, list[str], bool]] = [
|
|
|
898
923
|
'ticket:manage',
|
|
899
924
|
'ticket:resolve',
|
|
900
925
|
'blueprint:read',
|
|
901
|
-
'blueprint:write',
|
|
902
926
|
'workflow:create',
|
|
903
927
|
'workflow:read',
|
|
904
928
|
'workflow:write',
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"""Link existing documents to their organization.
|
|
2
|
+
|
|
3
|
+
A ``Document`` now has a ``BELONGS_TO`` edge to its organization. Before
|
|
4
|
+
that change, only user documents had it, and the organization of a
|
|
5
|
+
project or project-type document came from its attachment. The
|
|
6
|
+
``document-org-backfill`` maintenance operation runs :func:`backfill`
|
|
7
|
+
one time after the upgrade.
|
|
8
|
+
|
|
9
|
+
The organization is the one of the attachment. A user document with no
|
|
10
|
+
edge (one made before issue #414) gets the organization of the user
|
|
11
|
+
when the user is in exactly one. A document that has no organization
|
|
12
|
+
after this (its attachment was deleted, or its user is in no or many
|
|
13
|
+
organizations) is logged and keeps no edge: no organization shows it.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
import logging
|
|
17
|
+
import typing
|
|
18
|
+
|
|
19
|
+
from imbi.common import clickhouse, graph
|
|
20
|
+
|
|
21
|
+
LOGGER = logging.getLogger(__name__)
|
|
22
|
+
|
|
23
|
+
_TAIL: typing.LiteralString = """
|
|
24
|
+
WHERE NOT EXISTS((d)-[:BELONGS_TO]->(:Organization))
|
|
25
|
+
WITH d, collect(DISTINCT o) AS orgs
|
|
26
|
+
WHERE size(orgs) = 1
|
|
27
|
+
WITH d, head(orgs) AS o
|
|
28
|
+
CREATE (d)-[:BELONGS_TO]->(o)
|
|
29
|
+
RETURN d.id AS id
|
|
30
|
+
"""
|
|
31
|
+
#: The organization of each attachment kind, bound as ``o``.
|
|
32
|
+
_HEADS: tuple[typing.LiteralString, ...] = (
|
|
33
|
+
"""
|
|
34
|
+
MATCH (d:Document)-[:ATTACHED_TO]->(:Project)
|
|
35
|
+
-[:OWNED_BY]->(:Team)-[:BELONGS_TO]->(o:Organization)
|
|
36
|
+
""",
|
|
37
|
+
"""
|
|
38
|
+
MATCH (d:Document)-[:ATTACHED_TO]->(:ProjectType)
|
|
39
|
+
-[:BELONGS_TO]->(o:Organization)
|
|
40
|
+
""",
|
|
41
|
+
"""
|
|
42
|
+
MATCH (d:Document)-[:ATTACHED_TO]->(:User)-[:MEMBER_OF]->(o:Organization)
|
|
43
|
+
""",
|
|
44
|
+
)
|
|
45
|
+
_UNPLACED: typing.LiteralString = """
|
|
46
|
+
MATCH (d:Document)
|
|
47
|
+
WHERE NOT EXISTS((d)-[:BELONGS_TO]->(:Organization))
|
|
48
|
+
RETURN d.id AS id
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
async def backfill(db: graph.Graph) -> int:
|
|
53
|
+
"""Link each document that has no organization to the organization
|
|
54
|
+
of its attachment; return the count of documents linked."""
|
|
55
|
+
linked = 0
|
|
56
|
+
for head in _HEADS:
|
|
57
|
+
linked += len(await db.execute(head + _TAIL, {}, ['id']))
|
|
58
|
+
for record in await db.execute(_UNPLACED, {}, ['id']):
|
|
59
|
+
LOGGER.warning(
|
|
60
|
+
'Document %s has no organization: its attachment is gone, or '
|
|
61
|
+
'its user is in no or many organizations',
|
|
62
|
+
graph.parse_agtype(record['id']),
|
|
63
|
+
)
|
|
64
|
+
if linked:
|
|
65
|
+
LOGGER.info('Linked %d documents to an organization', linked)
|
|
66
|
+
return linked
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
# The ClickHouse read rows written before they had ``org_id``, matched
|
|
70
|
+
# on their org slug. Two parallel arrays, not a Map: the driver sends a
|
|
71
|
+
# dict parameter as JSON, which ClickHouse cannot parse as a Map.
|
|
72
|
+
# ``mutations_sync = 2`` waits until every replica has the change, so
|
|
73
|
+
# the next run sees it. The WHERE matches only rows without ``org_id``,
|
|
74
|
+
# so a re-run changes nothing that an earlier run filled in.
|
|
75
|
+
_READ_TABLES: tuple[str, ...] = (
|
|
76
|
+
'document_read_events',
|
|
77
|
+
'document_read_sessions',
|
|
78
|
+
)
|
|
79
|
+
_ORGS: typing.LiteralString = (
|
|
80
|
+
'MATCH (o:Organization) WHERE o.id IS NOT NULL'
|
|
81
|
+
' RETURN o.slug AS slug, o.id AS id'
|
|
82
|
+
)
|
|
83
|
+
_MISSING = (
|
|
84
|
+
"SELECT count() AS c FROM imbi.{table} WHERE org_id = ''"
|
|
85
|
+
' AND has({{slugs:Array(String)}}, org_slug)'
|
|
86
|
+
)
|
|
87
|
+
_FILL = (
|
|
88
|
+
'ALTER TABLE imbi.{table} UPDATE org_id = transform('
|
|
89
|
+
"org_slug, {{slugs:Array(String)}}, {{ids:Array(String)}}, '')"
|
|
90
|
+
" WHERE org_id = '' AND has({{slugs:Array(String)}}, org_slug)"
|
|
91
|
+
' SETTINGS mutations_sync = 2'
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
async def clickhouse_backfill(db: graph.Graph) -> int:
|
|
96
|
+
"""Fill ``org_id`` in on the document read rows in ClickHouse that
|
|
97
|
+
have none, from their org slug; return the count of rows changed.
|
|
98
|
+
|
|
99
|
+
A row of an organization that no longer has its slug keeps no
|
|
100
|
+
``org_id``.
|
|
101
|
+
"""
|
|
102
|
+
records = await db.execute(_ORGS, {}, ['slug', 'id'])
|
|
103
|
+
if not records:
|
|
104
|
+
return 0
|
|
105
|
+
params = {
|
|
106
|
+
'slugs': [str(graph.parse_agtype(r['slug'])) for r in records],
|
|
107
|
+
'ids': [str(graph.parse_agtype(r['id'])) for r in records],
|
|
108
|
+
}
|
|
109
|
+
changed = 0
|
|
110
|
+
for table in _READ_TABLES:
|
|
111
|
+
rows = await clickhouse.query(_MISSING.format(table=table), params)
|
|
112
|
+
missing = int(rows[0]['c']) if rows else 0
|
|
113
|
+
if missing:
|
|
114
|
+
await clickhouse.command(_FILL.format(table=table), params)
|
|
115
|
+
changed += missing
|
|
116
|
+
if changed:
|
|
117
|
+
LOGGER.info('Filled org_id in on %d document read rows', changed)
|
|
118
|
+
return changed
|