Skip to content

FLPATH-3294: Kessel ReBAC authorization integration for on-prem#5933

Closed
jordigilh wants to merge 12 commits intoproject-koku:mainfrom
jordigilh:FLPATH-3294/kessel-rebac-integration
Closed

FLPATH-3294: Kessel ReBAC authorization integration for on-prem#5933
jordigilh wants to merge 12 commits intoproject-koku:mainfrom
jordigilh:FLPATH-3294/kessel-rebac-integration

Conversation

@jordigilh
Copy link
Copy Markdown
Contributor

@jordigilh jordigilh commented Mar 5, 2026

Summary

Adds Kessel ReBAC (Relationship-Based Access Control) as the authorization backend for on-prem Koku deployments, replacing the SaaS RBAC service dependency. This enables fine-grained, workspace-based access control using SpiceDB as the underlying authorization engine.

Builds on top of: #5895 (Sources API compatibility endpoints by @ELK4N4)

Key Changes

  • koku_rebac Django app: New authorization module with KesselAccessProvider that integrates with Kessel Inventory (gRPC) for StreamedListObjects and Kessel Relations (REST) for tuple management
  • SpiceDB schema (dev/kessel/schema.zed): Defines the full authorization model including workspaces, roles, role bindings, and cost management resource types (clusters, projects, nodes, VMs, integrations, and all cloud provider resources)
  • Integration as first-class Kessel resource: Sources/integrations are registered as cost_management/integration resources with structural relationships (has_cluster, has_project) enabling computed permission cascading — access to a namespace automatically grants visibility of its parent cluster and integration
  • Sources API authorization: Replaces SettingsAccessPermission with SourcesAccessPermission that filters sources by Kessel integration.read access; adds vary_on_headers for per-user cache isolation
  • Account Settings: Changed to IsAuthenticated for on-prem reads (non-sensitive settings), fixing 403s for non-admin users
  • Resource lifecycle: Automatic SpiceDB tuple creation during OCP data ingestion and cleanup on source deletion via Relations REST API
  • Middleware: KokuTenantMiddleware resolves authorization via KesselAccessProvider or RBACAccessProvider based on AUTHORIZATION_BACKEND setting

Architecture Documentation

  • ADR: docs/architecture/kessel-integration/onprem-workspace-management-adr.md — covers workspace hierarchy design, integration resource type rationale, PRD12 requirements coverage, Kessel gap inventory, and future expansion plans (VMs, AWS/Azure/GCP, split metering)
  • Development guide: docs/architecture/kessel-integration/kessel-development-guide.md
  • Detailed design docs: OCP integration, authorization delegation, HLD gaps analysis

SpiceDB Schema Highlights

  • cost_management/integration with structural containment (has_cluster, has_account, has_subscription, etc.)
  • Computed permissions cascade: granting openshift_project.read on a namespace automatically provides visibility of parent clusters and integrations
  • Pre-provisioned schema for future resource types: openshift_vm, aws_account, aws_organizational_unit, azure_subscription_guid, gcp_account, gcp_project
  • Workspace hierarchy with t_parent inheritance

Configuration

Env Variable Default Purpose
AUTHORIZATION_BACKEND rbac Set to kessel for on-prem
KESSEL_INVENTORY_HOST localhost Kessel Inventory gRPC host
KESSEL_INVENTORY_PORT 9081 Kessel Inventory gRPC port
KESSEL_RELATIONS_URL http://localhost:8100 Kessel Relations REST URL
ENHANCED_ORG_ADMIN False Must be False when using Kessel

Test Plan

  • Unit tests for koku_rebac module (client, config, access_provider, resource_reporter, middleware)
  • Integration tests with mocked Kessel services
  • Contract tests validating gRPC/REST API compatibility
  • E2E regression tests for resource reporting and access resolution
  • Helm chart integration tests: 205 passed, 11 skipped, 0 failures (full deployment on OpenShift cluster)
  • Manual validation of multi-user authorization scenarios (admin, restricted users with workspace-scoped access, computed permission cascading through structural relationships)
  • CI pipeline validation (pending — Koku Python test suite requires PostgreSQL)

Kessel API Gaps Identified

Documented in the ADR for the Kessel team:

  1. No structural relationship support — Relations API only handles t_workspace; structural tuples (has_cluster, has_project) require direct SpiceDB access
  2. No application-specific computed-visibility resourcesintegration type with cascading read permission is not expressible via Kessel Inventory API
  3. Schema deployment not integrated — ZED schema must be loaded via zed CLI; no Kessel API for schema management

Made with Cursor

Related PRs

@jordigilh jordigilh requested review from a team as code owners March 5, 2026 00:34
@jordigilh jordigilh force-pushed the FLPATH-3294/kessel-rebac-integration branch from 905f8ad to 4708a4c Compare March 5, 2026 00:49
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces Kessel ReBAC authorization for on-prem Koku deployments, providing a more flexible and granular access control mechanism. It includes a new Django app, SpiceDB schema, middleware, and API changes to integrate Kessel with Koku. The changes aim to remove the dependency on the SaaS RBAC service for on-prem deployments and enable workspace-based access control.

Highlights

  • Kessel ReBAC Integration: Adds Kessel ReBAC as the authorization backend for on-prem Koku deployments, replacing the SaaS RBAC service dependency.
  • Workspace-Based Access Control: Enables fine-grained, workspace-based access control using SpiceDB as the underlying authorization engine.
  • Sources API Authorization: Replaces SettingsAccessPermission with SourcesAccessPermission that filters sources by Kessel integration.read access.
  • Configuration: Introduces environment variables for configuring Kessel integration, including KESSEL_INVENTORY_HOST, KESSEL_INVENTORY_PORT, and KESSEL_RELATIONS_URL.
  • Deployment: Adds the ONPREM environment variable to the deployment configurations to toggle onprem data processing logic.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .coveragerc
    • Added reportdb_accessor.py to the omit list.
  • .dockerignore
    • Added dev/kessel/schema.zed and dev/kessel/seed-roles.yaml to be included in the docker image.
  • .gitignore
    • Added .claude/, .cursor/ to the .gitignore file.
  • Pipfile
    • Upgraded Django to version 5.2.0.
    • Updated unleashclient version constraint.
    • Added sqlalchemy and kessel-sdk dependencies.
  • README.md
    • Added instructions for on-premise deployments, including setting the ONPREM environment variable.
  • deploy/clowdapp.yaml
    • Added ONPREM environment variable to multiple deployment objects.
    • Replaced fixed replica counts with autoScaler configurations for several worker deployments.
  • deploy/kustomize/base/base.yaml
    • Added ONPREM parameter with a default value of False.
  • deploy/kustomize/patches/koku-reads.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/koku-writes.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/listener.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/masu.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/scheduler.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/sources-client.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/sources-listener.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-celery.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-cost-model-penalty.yaml
    • Removed replicas and added autoScaler configurations, and added ONPREM environment variable.
  • deploy/kustomize/patches/worker-cost-model-xl.yaml
    • Removed replicas and added autoScaler configurations, and added ONPREM environment variable.
  • deploy/kustomize/patches/worker-cost-model.yaml
    • Removed replicas and added autoScaler configurations, and added ONPREM environment variable.
  • deploy/kustomize/patches/worker-download-penalty.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-download-xl.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-download.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-hcs.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-ocp-penalty.yaml
    • Removed replicas and added autoScaler configurations, and added ONPREM environment variable.
  • deploy/kustomize/patches/worker-ocp-xl.yaml
    • Removed replicas and added autoScaler configurations, and added ONPREM environment variable.
  • deploy/kustomize/patches/worker-ocp.yaml
    • Removed replicas and added autoScaler configurations, and added ONPREM environment variable.
  • deploy/kustomize/patches/worker-priority-penalty.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-priority-xl.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-priority.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-refresh-penalty.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-refresh-xl.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-refresh.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-subs-extraction.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-subs-transmission.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-summary-penalty.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-summary-xl.yaml
    • Added ONPREM environment variable.
  • deploy/kustomize/patches/worker-summary.yaml
    • Added ONPREM environment variable.
  • dev/containers/trino/etc/jvm.config
    • Removed GClocker related options and enabled dynamic agent loading.
  • dev/kessel/README.md
    • Added a README file for Kessel local stack integration testing.
  • dev/kessel/docker-compose.yml
    • Added a docker-compose file for Kessel local stack.
  • dev/kessel/inventory-config.yaml
    • Added an inventory configuration file for local Kessel integration tests.
  • dev/kessel/resource-schemas/aws_account/common_representation.json
    • Added a common representation JSON file for AWS account resource schema.
  • dev/kessel/resource-schemas/aws_account/config.yaml
    • Added a configuration file for AWS account resource type.
  • dev/kessel/resource-schemas/aws_account/reporters/cost_management/aws_account.json
    • Added a JSON file for AWS account reporter.
  • dev/kessel/resource-schemas/aws_account/reporters/cost_management/config.yaml
    • Added a configuration file for AWS account reporter.
  • dev/kessel/resource-schemas/aws_organizational_unit/common_representation.json
    • Added a common representation JSON file for AWS organizational unit resource schema.
  • dev/kessel/resource-schemas/aws_organizational_unit/config.yaml
    • Added a configuration file for AWS organizational unit resource type.
  • dev/kessel/resource-schemas/aws_organizational_unit/reporters/cost_management/aws_organizational_unit.json
    • Added a JSON file for AWS organizational unit reporter.
  • dev/kessel/resource-schemas/aws_organizational_unit/reporters/cost_management/config.yaml
    • Added a configuration file for AWS organizational unit reporter.
  • dev/kessel/resource-schemas/azure_subscription_guid/common_representation.json
    • Added a common representation JSON file for Azure subscription GUID resource schema.
  • dev/kessel/resource-schemas/azure_subscription_guid/config.yaml
    • Added a configuration file for Azure subscription GUID resource type.
  • dev/kessel/resource-schemas/azure_subscription_guid/reporters/cost_management/azure_subscription_guid.json
    • Added a JSON file for Azure subscription GUID reporter.
  • dev/kessel/resource-schemas/azure_subscription_guid/reporters/cost_management/config.yaml
    • Added a configuration file for Azure subscription GUID reporter.
  • dev/kessel/resource-schemas/cost_model/common_representation.json
    • Added a common representation JSON file for cost model resource schema.
  • dev/kessel/resource-schemas/cost_model/config.yaml
    • Added a configuration file for cost model resource type.
  • dev/kessel/resource-schemas/cost_model/reporters/cost_management/config.yaml
    • Added a configuration file for cost model reporter.
  • dev/kessel/resource-schemas/cost_model/reporters/cost_management/cost_model.json
    • Added a JSON file for cost model reporter.
  • dev/kessel/resource-schemas/gcp_account/common_representation.json
    • Added a common representation JSON file for GCP account resource schema.
  • dev/kessel/resource-schemas/gcp_account/config.yaml
    • Added a configuration file for GCP account resource type.
  • dev/kessel/resource-schemas/gcp_account/reporters/cost_management/config.yaml
    • Added a configuration file for GCP account reporter.
  • dev/kessel/resource-schemas/gcp_account/reporters/cost_management/gcp_account.json
    • Added a JSON file for GCP account reporter.
  • dev/kessel/resource-schemas/gcp_project/common_representation.json
    • Added a common representation JSON file for GCP project resource schema.
  • dev/kessel/resource-schemas/gcp_project/config.yaml
    • Added a configuration file for GCP project resource type.
  • dev/kessel/resource-schemas/gcp_project/reporters/cost_management/config.yaml
    • Added a configuration file for GCP project reporter.
  • dev/kessel/resource-schemas/gcp_project/reporters/cost_management/gcp_project.json
    • Added a JSON file for GCP project reporter.
  • dev/kessel/resource-schemas/openshift_cluster/common_representation.json
    • Added a common representation JSON file for OpenShift cluster resource schema.
  • dev/kessel/resource-schemas/openshift_cluster/config.yaml
    • Added a configuration file for OpenShift cluster resource type.
  • dev/kessel/resource-schemas/openshift_cluster/reporters/cost_management/config.yaml
    • Added a configuration file for OpenShift cluster reporter.
  • dev/kessel/resource-schemas/openshift_cluster/reporters/cost_management/openshift_cluster.json
    • Added a JSON file for OpenShift cluster reporter.
  • dev/kessel/resource-schemas/openshift_node/common_representation.json
    • Added a common representation JSON file for OpenShift node resource schema.
  • dev/kessel/resource-schemas/openshift_node/config.yaml
    • Added a configuration file for OpenShift node resource type.
  • dev/kessel/resource-schemas/openshift_node/reporters/cost_management/config.yaml
    • Added a configuration file for OpenShift node reporter.
  • dev/kessel/resource-schemas/openshift_node/reporters/cost_management/openshift_node.json
    • Added a JSON file for OpenShift node reporter.
  • dev/kessel/resource-schemas/openshift_project/common_representation.json
    • Added a common representation JSON file for OpenShift project resource schema.
  • dev/kessel/resource-schemas/openshift_project/config.yaml
    • Added a configuration file for OpenShift project resource type.
  • dev/kessel/resource-schemas/openshift_project/reporters/cost_management/config.yaml
    • Added a configuration file for OpenShift project reporter.
  • dev/kessel/resource-schemas/openshift_project/reporters/cost_management/openshift_project.json
    • Added a JSON file for OpenShift project reporter.
  • dev/kessel/resource-schemas/settings/common_representation.json
    • Added a common representation JSON file for settings resource schema.
  • dev/kessel/resource-schemas/settings/config.yaml
    • Added a configuration file for settings resource type.
  • dev/kessel/resource-schemas/settings/reporters/cost_management/config.yaml
    • Added a configuration file for settings reporter.
  • dev/kessel/resource-schemas/settings/reporters/cost_management/settings.json
    • Added a JSON file for settings reporter.
  • dev/kessel/schema.zed
    • Added a ZED schema file for Cost Management.
  • dev/kessel/seed-roles.yaml
    • Added a seed-roles YAML file.
  • dev/scripts/load_test_customer_data.sh
    • Added standard org_id for local development and updated ingest URL with org_id parameter.
  • dev/scripts/trino_query.py
    • Updated to use get_report_db_accessor for database connections.
  • docker-compose.yml
    • Added ONPREM environment variable to several services.
    • Updated volume configurations for postgresql, unleash, and minio.
    • Updated unleash image version.
    • Added kafka-zookeeper, kafka, and init-kafka services with 'onprem' profile.
  • docs/architecture/archive/insights-rbac-kessel-onprem-feasibility.md
    • Added an insights-rbac + Kessel On-Prem Feasibility Analysis document.
  • docs/architecture/feature-flags.md
    • Added a Feature Flags Architecture document.
  • docs/architecture/kessel-integration/FLPATH-3319-description.md
    • Added a description document.
  • docs/architecture/kessel-integration/kessel-authorization-delegation-dd.md
    • Added a Kessel authorization delegation strategy design document.
  • docs/architecture/kessel-integration/kessel-development-guide.md
    • Added a Kessel development guide.
  • docs/architecture/kessel-integration/kessel-hld-gaps-and-updates.md
    • Added a Kessel HLD gaps and updates document.
  • docs/architecture/kessel-integration/kessel-ocp-detailed-design.md
    • Added a Kessel OCP detailed design document.
  • docs/architecture/kessel-integration/kessel-ocp-integration.md
    • Added a Kessel OCP integration document.
  • docs/architecture/kessel-integration/kessel-ocp-test-plan-retired.md
    • Added a Kessel OCP test plan retired document.
  • docs/architecture/kessel-integration/onprem-workspace-management-adr.md
    • Added an onprem workspace management ADR document.
  • docs/architecture/kessel-integration/zed-schema-upstream-delta.md
    • Added a ZED schema upstream delta tracking document.
  • docs/architecture/koku-vs-ros-rebac-comparison.md
    • Added a Koku vs ROS ReBAC comparison document.
  • docs/architecture/onprem-authorization-backend.md
    • Added an onprem authorization backend document.
  • docs/architecture/rbac-config-reuse-for-onprem.md
    • Added a rbac-config reuse for onprem document.
  • docs/install.md
    • Added on-premise deployment configuration instructions for Unleash feature flags.
  • docs/onprem_data_flow.md
    • Added an onprem data flow document.
  • docs/specs/openapi.json
    • Simplified Status schema in openapi.json to return only 'status: OK'.
  • koku/api/common/permissions/ingress_access.py
    • Added IngressAccessPermission class to control access to ingress data.
  • koku/api/common/permissions/sources_access.py
    • Added SourcesAccessPermission class for on-prem deployments, leveraging Kessel integration resources.
  • koku/api/common/permissions/test/test_ingress_access.py
    • Added tests for IngressAccessPermission, covering grace period, read/write access, and admin bypass.
  • koku/api/common/permissions/test/test_settings_access.py
    • Updated admin bypass logic and added tests for read/write access in SettingsAccessPermission tests.
  • koku/api/common/permissions/test/test_sources_access.py
    • Added tests for SourcesAccessPermission, covering admin bypass, read/write access, and integration resource access.
  • koku/api/common/test_throttling.py
    • Added tests for TagQueryThrottle, covering rate parsing, cache key generation, and date range calculation.
  • koku/api/common/throttling.py
    • Added TagQueryThrottle class to limit large date range tag queries for flagged customers.
  • koku/api/iam/models.py
    • Added is_authenticated property to the User model, required by DRF's IsAuthenticated permission class.
  • koku/api/ingress/reports/view.py
    • Updated IngressReports views to use IngressAccessPermission, enforce schema scoping, and refine error responses.
  • koku/api/ingress/test/reports/test_views.py
    • Added source data setup, updated test cases for invalid UUIDs, non-existent sources, and permission checks in ingress reports views tests.
  • koku/api/metrics/constants.py
    • Updated get_cost_model_metrics_map to use is_feature_flag_enabled_by_schema for GPU Unleash flag evaluation.
  • koku/api/metrics/test/test_views.py
    • Updated GPU metric tests to use is_feature_flag_enabled_by_schema for Unleash flag evaluation.
  • koku/api/metrics/views.py
    • Updated metrics view to use is_feature_flag_enabled_by_schema for feature flag evaluation.
  • koku/api/migrations/0039_create_hive_db.py
    • Added a check for ONPREM environment variable to skip hive database creation for on-premises deployments.
  • koku/api/provider/provider_builder.py
    • Added methods to report OCP clusters and integrations to Kessel, and integrated them into create_provider_from_source.
  • koku/api/report/all/openshift/provider_map.py
    • Added default=Value([]) to ArrayAgg for clusters and source_uuid in OCPAll provider maps.
  • koku/api/report/all/openshift/view.py
    • Added TagQueryThrottle to OCP views and updated OCPGpuView to use is_feature_flag_enabled_by_schema for GPU feature flag evaluation.
  • koku/api/report/aws/openshift/provider_map.py
    • Added default=Value([]) to ArrayAgg for clusters and source_uuid in OCPAWS provider maps.
  • koku/api/report/aws/provider_map.py
    • Added default=Value([]) to ArrayAgg for source_uuid in AWS provider maps.
  • koku/api/report/azure/openshift/provider_map.py
    • Added default=Value([]) to ArrayAgg for clusters and source_uuid in OCPAzure provider maps.
  • koku/api/report/azure/provider_map.py
    • Added default=Value([]) to ArrayAgg for source_uuid in Azure provider maps.
  • koku/api/report/gcp/openshift/provider_map.py
    • Added default=Value([]) to ArrayAgg for clusters and source_uuid in OCPGCP provider maps.
  • koku/api/report/gcp/provider_map.py
    • Added default=Value([]) to ArrayAgg for source_uuid in GCP provider maps.
  • koku/api/report/ocp/provider_map.py
    • Added default=Value([]) to ArrayAgg for various fields and Coalesce for node capacity counts in OCP provider maps.
  • koku/api/report/ocp/serializers.py
    • Added logic to OCPGpuQueryParamSerializer to drop tag-related keys from filter/exclude/group_by parameters.
  • koku/api/report/ocp/view.py
    • Added TagQueryThrottle to OCP views and updated OCPGpuView to use is_feature_flag_enabled_by_schema for GPU feature flag evaluation.
  • koku/api/report/test/ocp/test_serializers.py
    • Added a test case to verify that tag filters are dropped from OCP GPU query parameters.
  • koku/api/report/test/ocp/view/test_gpu_view.py
    • Updated GPU view tests to use is_feature_flag_enabled_by_schema and added a test for GPU endpoint accepting tag filters.
  • koku/api/report/test/util/model_bakery_loader.py
    • Updated populate_ui_summary_tables call to use SummaryRangeConfig.
  • koku/api/resource_types/openshift_clusters/view.py
    • Added cloud provider filtering to OCPClustersView, allowing filtering by AWS, Azure, GCP, or all cloud providers.
  • koku/api/resource_types/openshift_nodes/view.py
    • Added cloud provider filtering to OCPNodesView, allowing filtering by AWS, Azure, GCP, or all cloud providers.
  • koku/api/resource_types/openshift_projects/view.py
    • Added cloud provider filtering to OCPProjectsView, allowing filtering by AWS, Azure, GCP, or all cloud providers.
  • koku/api/resource_types/test/openshift_clusters/test_views.py
    • Added tests for cloud provider filtering in OCPClustersView, including AWS, Azure, GCP, and all cloud providers.
  • koku/api/resource_types/test/openshift_nodes/test_views.py
    • Added tests for cloud provider filtering in OCPNodesView, including AWS, Azure, GCP, and all cloud providers.
  • koku/api/resource_types/test/openshift_projects/test_views.py
    • Added tests for cloud provider filtering in OCPProjectsView, including AWS, Azure, GCP, and all cloud providers.
  • koku/api/settings/cost_groups/query_handler.py
    • Added default=Value([]) to ArrayAgg for clusters in cost groups query handler.
  • koku/api/settings/views.py
    • Updated AccountSettings permission classes to use IsAuthenticated for ONPREM, and added a permission check for PUT requests.
  • koku/api/status/test_status.py
    • Simplified status endpoint test to expect only 'status: OK' response.
  • koku/api/status/views.py
    • Simplified StatusView to return only 'status: OK' response.
  • koku/api/urls.py
    • Added sources-compatible endpoints (source_types, application_types, applications) and included a router without trailing slash for compatibility.
  • koku/cost_models/serializers.py
    • Updated metric_map to use is_feature_flag_enabled_by_schema and enhanced validate_source_uuids to check customer schema and handle errors.
  • koku/cost_models/test/test_serializers.py
    • Updated get_metric_display_data to use is_feature_flag_enabled_by_schema and added comprehensive tests for validate_source_uuids.
  • koku/cost_models/view.py
    • Overrode perform_create to report new cost models to Kessel and removed noqa: C901 from get_queryset.
  • koku/gunicorn_conf.py
    • Included worker PID in the log message for worker abort events.
  • koku/koku/feature_flags.py
    • Introduced MockUnleashClient to disable Unleash functionality when ONPREM is enabled.
  • koku/koku/middleware.py
    • Updated IdentityHeaderMiddleware to use get_access_provider, handle KesselConnectionError, and added on_resource_created hook for settings sentinel.
  • koku/koku/reportdb_accessor.py
    • Added ReportDBAccessor abstract base class with methods for database connection and SQL generation.
  • koku/koku/reportdb_accessor_postgres.py
    • Added PostgresReportDBAccessor for PostgreSQL-specific SQL generation and Django connection handling.
  • koku/koku/reportdb_accessor_trino.py
    • Added TrinoReportDBAccessor for Trino-specific SQL generation and connection handling.
  • koku/koku/settings.py
    • Added ONPREM setting, Kessel Inventory and Relations API configurations, and updated CacheEnum to include 'kessel' cache.
  • koku/koku/test_feature_flags.py
    • Added tests for DisabledUnleashClient, covering its no-op behavior and fallback functions.
  • koku/koku/test_middleware_kessel.py
    • Added tests for Kessel middleware integration, covering access provider dispatch, cache selection, and error handling.
  • koku/koku/test_settings_lite.py
    • Added test_settings_lite.py for lightweight Django testing without a full database.
  • koku/koku/test_trino_db_utils.py
    • Added unittest.skipIf decorator to Trino-specific tests to skip them when ONPREM is enabled.
  • koku/koku/trino_database.py
    • Updated connect to use get_report_db_accessor and added error handling for PostgreSQL ProgrammingError in executescript.
  • koku/koku/urls.py
    • Included koku_rebac application URLs in the main Koku URL configuration.
  • koku/koku_rebac/init.py
    • Added __init__.py for the koku_rebac Django application.
  • koku/koku_rebac/access_provider.py
    • Added KesselAccessProvider and RBACAccessProvider classes for authorization backend abstraction, querying Kessel Inventory API.
  • koku/koku_rebac/apps.py
    • Added KokuRebacConfig for Django application configuration.
  • koku/koku_rebac/client.py
    • Added KesselClient as a thread-safe singleton gRPC client for Kessel Inventory API v1beta2.
  • koku/koku_rebac/config.py
    • Added resolve_authorization_backend function to determine the active authorization backend based on ONPREM setting.
  • koku/koku_rebac/exceptions.py
    • Added custom exception classes KesselError and KesselConnectionError for Kessel-related issues.
  • koku/koku_rebac/management/init.py
    • Added __init__.py for the koku_rebac.management module.
  • koku/koku_rebac/management/commands/init.py
    • Added __init__.py for the koku_rebac.management.commands module.
  • koku/koku_rebac/migrations/0001_initial.py
    • Added initial migration to create KesselSyncedResource model.
  • koku/koku_rebac/models.py
    • Added KesselSyncedResource model to track resources reported to Kessel Inventory.
  • koku/koku_rebac/resource_reporter.py
    • Added on_resource_created and on_resource_deleted functions for transparent resource reporting to Kessel Inventory and SpiceDB.
  • koku/koku_rebac/test/init.py
    • Added __init__.py for the koku_rebac.test module.
  • koku/koku_rebac/test/kessel_fixture.py
    • Added KesselFixture helper class for seeding and cleaning up SpiceDB tuples in E2E tests.
  • koku/koku_rebac/test/test_access_provider.py
    • Added tests for AccessProvider abstraction, RBACAccessProvider, and KesselAccessProvider implementations.
  • koku/koku_rebac/test/test_client.py
    • Added tests for KesselClient singleton, stub existence, and channel building.
  • koku/koku_rebac/test/test_config.py
    • Added tests for authorization backend resolution, CacheEnum, and Kessel configuration settings.
  • koku/koku_rebac/test/test_contract.py
    • Added contract tests for Kessel Inventory API v1beta2, validating Check and DeleteResource calls against a live Kessel stack.
  • koku/koku_rebac/test/test_e2e_regression.py
    • Added E2E regression tests for Kessel integration, covering various API endpoints and permission scenarios.
  • koku/koku_rebac/test/test_hooks.py
    • Added tests for Kessel resource reporting hooks in ProviderBuilder, OCPReportDBAccessor, and CostModelViewSet.
  • koku/koku_rebac/test/test_middleware_rebac.py
    • Added tests for middleware integration with Kessel ReBAC, covering access provider dispatch, cache selection, and error handling.
  • koku/koku_rebac/test/test_models.py
    • Added tests for KesselSyncedResource model, covering creation, uniqueness, and string representation.
  • koku/koku_rebac/test/test_resource_reporter.py
    • Added tests for on_resource_created, on_resource_deleted, and create_structural_tuple functions, covering resource reporting and cleanup.
  • koku/koku_rebac/test/test_urls.py
    • Added tests for Kessel-related URL patterns, ensuring they are not exposed in RBAC deployments.
  • koku/koku_rebac/test/test_workspace.py
    • Added tests for ShimResolver and RbacV2Resolver in Kessel workspace resolution.
  • koku/koku_rebac/urls.py
    • Added URL patterns for the koku_rebac application.
  • koku/koku_rebac/workspace.py
    • Added ShimResolver and RbacV2Resolver classes for resolving workspace IDs based on deployment type.
  • koku/masu/database/gcp_report_db_accessor.py
    • Added on_resource_created hook to populate_gcp_topology_table for reporting GCP resources to Kessel.
  • koku/masu/database/ocp_report_db_accessor.py
    • Added on_resource_created hooks for OCP nodes and projects, and create_structural_tuple for has_project relationships.
  • koku/masu/processor/_tasks/remove_expired.py
    • Added cleanup_orphaned_kessel_resources hook to purge_expired_report_data for cleaning up Kessel resources.
  • koku/masu/processor/accounts/hierarchy/aws/aws_org_unit_crawler.py
    • Added on_resource_created hook to process_org_unit for reporting AWS organizational units to Kessel.
  • koku/masu/processor/azure/azure_report_parquet_summary_updater.py
    • Added on_resource_created hook to update_summary_tables for reporting Azure subscriptions to Kessel.
  • koku/masu/util/aws/common.py
    • Added on_resource_created hook to get_account_ids for reporting AWS accounts to Kessel.
  • koku/sources/api/application_type_views.py
    • Added ApplicationTypesView for listing Sources application types.
  • koku/sources/api/application_views.py
    • Added ApplicationsView for listing Sources applications.
  • koku/sources/api/kafka_publisher.py
    • Added publish_application_destroy_event function to publish source deletion events to Kafka.
  • koku/sources/api/serializers.py
    • Added AdminSourcesSerializer for on-premise Sources API, including source_type_id and source_ref fields.
  • koku/sources/api/source_type_mapping.py
    • Added SOURCE_TYPE_MAP for mapping provider types to Sources API source types.
  • koku/sources/api/source_type_views.py
    • Added SourceTypesView for listing Sources source types.
  • koku/sources/api/view.py
    • Added CreateModelMixin, UpdateModelMixin, DestroySourceMixin for ONPREM, and on_resource_deleted hook for source deletion.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/ci.yml
    • .github/workflows/pre-release.yaml
    • .github/workflows/weekly-pipfile-lock.yml
Activity
  • This pull request introduces Kessel ReBAC authorization for on-prem Koku deployments.
  • It includes a new Django app, SpiceDB schema, middleware, and API changes to integrate Kessel with Koku.
  • The changes aim to remove the dependency on the SaaS RBAC service for on-prem deployments and enable workspace-based access control.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces significant changes to integrate Kessel (ReBAC) authorization for on-premise deployments, marked by a major Django version upgrade to 5.2.0 and the addition of kessel-sdk and sqlalchemy dependencies. Key changes include the introduction of an ONPREM environment variable across various ClowdApp and Kustomize configurations to toggle Kessel functionality, alongside comprehensive documentation and Docker Compose setups for local Kessel development. Worker scaling configurations in clowdapp.yaml and related patches were updated to use autoScaler with Prometheus triggers. The /status API endpoint was simplified to return {"status": "OK"}, which is a breaking change for clients expecting detailed information. Additionally, a JVM setting related to GC locker retry allocation was removed from the Trino configuration, and trino_query.py was refactored to use a centralized report database accessor. The removal of the JVM setting is concerning as it was previously noted to mitigate a JDK bug, and its reintroduction of performance or stability issues should be verified.

Note: Security Review did not run due to the size of the PR.

I am having trouble creating individual review comments. Click here to see my feedback.

dev/containers/trino/etc/jvm.config (22-23)

high

The removal of -XX:GCLockerRetryAllocationCount=8 is a bit concerning. The original comment indicated it was added to mitigate a specific JDK bug related to thread starvation. Removing this setting might reintroduce performance or stability issues unless the underlying bug has been fixed by a JVM upgrade. Could you please provide some context for this removal or confirm that it's safe to do so?

docs/specs/openapi.json (11514-11573)

high

The response schema for the /status endpoint has been significantly simplified. This is a breaking change for any clients that were parsing the previous detailed response (which included api_version, commit, platform_info, etc.). While the new {"status": "OK"} response is simpler for basic health checks, this change should be clearly communicated as a breaking API change in the release notes.

@jordigilh jordigilh force-pushed the FLPATH-3294/kessel-rebac-integration branch from 4708a4c to 6d22155 Compare March 5, 2026 01:14
jordigilh added a commit to jordigilh/koku that referenced this pull request Mar 5, 2026
Remove 4 ephemeral/working documents from kessel-integration/:
- kessel-handover-session-2.md (handoff session notes)
- FLPATH-3319-description.md (Jira ticket body copy)
- kessel-ocp-test-plan-retired.md (dead retired test scenarios)
- kessel-hld-gaps-and-updates.md (working notes, all applied to HLD)

Fix broken links:
- Redirect 6 kessel-ocp-implementation-guide.md links in HLD to
  kessel-ocp-detailed-design.md (which supersedes the impl guide)
- Remove stale kessel-hld-gaps-and-updates.md references from HLD
  and detailed design
- Replace kessel-ocp-test-plan-retired.md links in test plan with
  inline notes

Closes PR project-koku#5887 which is fully superseded by PR project-koku#5933.

Made-with: Cursor
@jordigilh
Copy link
Copy Markdown
Contributor Author

@lcouzens @myersCody PTAL

jordigilh added a commit to jordigilh/koku that referenced this pull request Mar 5, 2026
Remove 4 ephemeral/working documents from kessel-integration/:
- kessel-handover-session-2.md (handoff session notes)
- FLPATH-3319-description.md (Jira ticket body copy)
- kessel-ocp-test-plan-retired.md (dead retired test scenarios)
- kessel-hld-gaps-and-updates.md (working notes, all applied to HLD)

Fix broken links:
- Redirect 6 kessel-ocp-implementation-guide.md links in HLD to
  kessel-ocp-detailed-design.md (which supersedes the impl guide)
- Remove stale kessel-hld-gaps-and-updates.md references from HLD
  and detailed design
- Replace kessel-ocp-test-plan-retired.md links in test plan with
  inline notes

Closes PR project-koku#5887 which is fully superseded by PR project-koku#5933.

Made-with: Cursor
@jordigilh jordigilh force-pushed the FLPATH-3294/kessel-rebac-integration branch from f7ef99c to 8a8083b Compare March 5, 2026 16:35
jordigilh added a commit to jordigilh/koku that referenced this pull request Mar 5, 2026
Remove 4 ephemeral/working documents from kessel-integration/:
- kessel-handover-session-2.md (handoff session notes)
- FLPATH-3319-description.md (Jira ticket body copy)
- kessel-ocp-test-plan-retired.md (dead retired test scenarios)
- kessel-hld-gaps-and-updates.md (working notes, all applied to HLD)

Fix broken links:
- Redirect 6 kessel-ocp-implementation-guide.md links in HLD to
  kessel-ocp-detailed-design.md (which supersedes the impl guide)
- Remove stale kessel-hld-gaps-and-updates.md references from HLD
  and detailed design
- Replace kessel-ocp-test-plan-retired.md links in test plan with
  inline notes

Closes PR project-koku#5887 which is fully superseded by PR project-koku#5933.

Made-with: Cursor
@jordigilh jordigilh force-pushed the FLPATH-3294/kessel-rebac-integration branch from d2019d2 to b93275d Compare March 5, 2026 20:08
@jordigilh
Copy link
Copy Markdown
Contributor Author

Cross-references for the Kessel ReBAC integration:

Repo PR Scope
koku #5933 (this PR) KesselAccessProvider, middleware, ZED schema, architecture docs
ros-ocp-backend RedHatInsights/ros-ocp-backend#590 KesselMiddleware, LookupResources, 103 test scenarios
ros-helm-chart insights-onprem/cost-onprem-chart#121 Helm chart, deployment scripts, E2E/UI tests, management docs

@jordigilh
Copy link
Copy Markdown
Contributor Author

Upstream schema PRs created (companion to this integration):

  • rbac-config: RedHatInsights/rbac-config#737 — wires 23 cost_management permissions through rbac/role_binding, rbac/tenant, and rbac/workspace in the production schema.zed
  • inventory-api: project-kessel/inventory-api#1243 — registers 11 cost_management resource type schemas so the Inventory API accepts ReportResource calls from Koku

Both PRs upstream changes that were validated end-to-end using local copies bundled in the Helm chart.

@myersCody
Copy link
Copy Markdown
Contributor

There is a meeting internally to discuss this one, so we will hold reviewing until after the meeting has happened.

@jordigilh
Copy link
Copy Markdown
Contributor Author

There is a meeting internally to discuss this one, so we will hold reviewing until after the meeting has happened.

Hey Cody, when is that meeting happening so that I know when the review will resume?

@jordigilh jordigilh force-pushed the FLPATH-3294/kessel-rebac-integration branch 2 times, most recently from 449e764 to d94d70c Compare March 16, 2026 18:24
Copy link
Copy Markdown

@upadhyeammit upadhyeammit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I think we need to define SpiceDB loss vs Postgres loss? restore order for same?

PermClass->>AuthAdapter: has_permission(<br/>user="alice",<br/>resource_type="openshift.cluster",<br/>action="read")
activate AuthAdapter

Note over AuthAdapter: Check cache (30s TTL)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do see the TTL has mentioned inconsistently, 30 seconds to 300 seconds. HLD diagrams/Open Questions mention 30s in places; DD and KESSEL_CACHE_TIMEOUT use 300s. Which is authoritative for operators, and can Appendix D (KESSEL_CACHE_TTL default 30) be aligned or removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, thank you. I aligned the docs to the implemented behavior in this branch: cache uses KESSEL_CACHE_TIMEOUT with a default of 300 seconds (from settings.py), and I removed stale KESSEL_CACHE_TTL/30s guidance from the HLD sections and appendix.

Comment on lines +1736 to +1745
```bash
# Resync all OCP providers
python manage.py kessel_sync_resources --provider-type ocp

# Resync specific provider
python manage.py kessel_sync_resources --provider-id 123

# Dry-run mode (show what would be synced)
python manage.py kessel_sync_resources --dry-run
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where these commands would be implemented? I dont see these on the same branch at least.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are absolutely right. Those manage.py kessel_* command examples were not implemented in this PR branch. I updated the docs to avoid presenting them as shipped behavior, clarified the current operational tooling, and removed command-based runbook steps that implied implementation in this branch.

- `cost-management-inventory` — used by the Inventory API pod for its outbound Relations API (gRPC) calls
- **Relations API** enables JWT validation via `ENABLEAUTH=true` + `JWKSURL` pointing to Keycloak's JWKS endpoint
- **Inventory API** switches from `allow-unauthenticated: true` to an OIDC authenticator chain, and enables `enable-oidc-auth: true` for its outbound Relations API calls with SA credentials
- **Koku** uses a thread-safe `TokenProvider` ([`koku_rebac/kessel_auth.py`](../../../koku/koku_rebac/kessel_auth.py)) that acquires tokens via client_credentials grant and caches them until 30s before expiry
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. how the operational rotation of Kessel Credentials would be handled?

Better explanation of situation using AI:

Access tokens (JWTs) — Koku gets them with OAuth2 client_credentials, caches them, and refreshes them in memory before they expire. That is automatic while the app runs; the workspace ADR describes this.

Client secrets — The Keycloak client secret (and similar mounted env vars) is read when the process starts. Rotating it in Keycloak/Kubernetes does not hot-reload inside a running pod; you normally update the Secret and roll the deployment so processes pick up the new value.

So: “token refresh” in the docs means short-lived JWT rotation, not rotating the OAuth client secret without a restart. A full operational runbook for secret rotation (order of updates, restarts, checks) is not spelled out in those architecture docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, and thanks for the clear breakdown. I added an explicit credential-rotation runbook in the ADR that separates token refresh (automatic in-process) from client-secret rotation (Secret update plus rollout/restart plus verification plus old-secret revocation). This now documents the operational order explicitly.

Comment on lines +43 to +48
| Environment | Authorization backend | How selected |
|-------------|-----------------------|------------------------------------------------------------------|
| On-prem | ReBAC (Kessel) | `ONPREM=true` forces `AUTHORIZATION_BACKEND=rebac` at startup |
| SaaS | RBAC (default) | `AUTHORIZATION_BACKEND=rbac` (default, no env var needed) |
| SaaS future | ReBAC (Kessel) | Unleash flag overrides to `rebac` per org (documented hook only) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we define Koku x Kessel x SpiceDB (or OCP) compatibility, I dont see thats mentioned anywhere? This also brings more questions about how we would flag out incompatible versions and force the upgrade?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I added a dedicated compatibility/upgrade guardrails section in the DD covering Koku to Inventory API, Koku to Relations API, and Relations to SpiceDB contracts, plus operator actions on incompatibility. I also documented that this branch does not add a hard startup version gate in Koku; enforcement remains deployment-layer.

@jordigilh
Copy link
Copy Markdown
Contributor Author

jordigilh commented Apr 6, 2026

@upadhyeammit Thanks for the additional review note on SpiceDB vs Postgres loss/restore ordering. I addressed this in the HLD by adding an explicit failure-mode recovery matrix and ordered restore steps for: (1) Kessel/SpiceDB lost with Postgres intact, (2) Postgres lost with Kessel intact, and (3) both lost, plus a consistency-validation checklist.\n\nAlso pushed a doc-only follow-up commit with all review-driven updates: c2e0313.

@jordigilh
Copy link
Copy Markdown
Contributor Author

@upadhyeammit @myersCody Pushed a doc-only follow-up (c2e0313) addressing all review comments from today:

  • Cache TTL: aligned all docs to KESSEL_CACHE_TIMEOUT default 300s; removed stale 30s/KESSEL_CACHE_TTL references and fixed Appendix D env vars to match settings.py
  • Management commands: removed non-shipped command examples from HLD; clarified current operational tooling
  • Credential rotation: added explicit runbook in workspace ADR (token refresh vs client-secret rotation + rollout order)
  • Compatibility: added guardrails section in DD with API-contract matrix and operator response guidance
  • Backup/recovery: added failure-mode restore-order matrix (Kessel lost, Postgres lost, both lost) + consistency checklist

PTAL when you get a chance.

…emas

Add kessel-relations-client-python and kessel-inventory-client-python
SDK packages. Add dev/kessel/ stack with docker-compose, SpiceDB schema,
seed-roles.yaml, inventory config, and resource schemas for all
Cost Management resource types.

Made-with: Cursor
Add koku_rebac package: KesselAccessProvider, client, config,
resource_reporter, workspace management, and exception handling.
Add integration resource as first-class Kessel type with sources
access permissions. Add comprehensive unit, integration, contract,
and E2E tests. Includes fixes for SQL tuple extraction, cache
variance on identity header, User.is_authenticated for DRF,
resource tuple cleanup, schema pre-provisioning, and workspace-level
Check preference over StreamedListObjects.

Made-with: Cursor
…ream

Add JWT/OIDC authentication for Kessel API calls with configurable
token endpoint. Add connection failure detection and exponential
backoff retry for gRPC calls. Sync seed-roles.yaml with
ros-helm-chart and add integration:read permission. Fix ZED schema
to make cost_management_all_read/write computed permissions. Fix
resource reporting to use real cluster_id instead of provider UUID.

Made-with: Cursor
Add architecture documents: HLD (kessel-ocp-integration.md), DD
(kessel-ocp-detailed-design.md), test plan, and authorization
delegation DD. Add ADRs for on-prem authorization backend selection,
workspace management, and rbac-config reuse. Add insights-rbac
feasibility analysis, ZED schema upstream delta tracker, and Kessel
development guide. Consolidate all docs into kessel-integration/
directory with consistent cross-references.

Made-with: Cursor
Add rebac-bridge-design.md: Go microservice exposing insights-rbac v1
compatible REST endpoints backed by Kessel/SpiceDB, with workspace
abstraction, group-level resource assignment, and UI extraction
strategy. Add IEEE 829 test plan (rebac-bridge-test-plan.md). Includes
auth/authz hardening, pseudocode replacement with validated source,
and ADR updates for pure Kessel architecture.

Made-with: Cursor
Add README.md index with reading paths for architects, developers,
and the Kessel team. Add Kafka-based resource reporting detailed
design. Update kessel-ocp-detailed-design.md status to Implemented.

Made-with: Cursor
- Fix wrong org_id derivation in cost model creation (use customer.org_id)
- Add missing on_resource_deleted call when cost models are destroyed
- Guard against None access dict crash in cost model queryset
- Remove spurious on_resource_created("settings") from middleware
  (no cost_management/settings definition exists in schema.zed)
- Fix sources/api/view.py gating: use AUTHORIZATION_BACKEND == "rebac"
  instead of ONPREM for on_resource_deleted and integration access filter

Made-with: Cursor
- Add auth headers to Relations API POST calls in _create_resource_tuples
  and create_structural_tuple (parity with existing DELETE path)
- Add provider_uuid field to KesselSyncedResource model (folded into
  0001_initial migration since it hasn't shipped upstream yet)
- Thread provider_uuid through on_resource_created and _track_synced_resource
- Update all call sites (provider_builder, ocp/aws/gcp/azure report
  accessors, aws_org_unit_crawler) to pass provider_uuid
- Scope cleanup_orphaned_kessel_resources to filter by provider_uuid,
  preventing accidental deletion of resources from other providers
- Replace fragile org_id extraction from schema_name in remove_expired.py
  with a proper Customer model lookup

Made-with: Cursor
- Guard user.customer being None in KesselAccessProvider
- Add token expiry tracking and refresh to RbacV2Resolver (was cached
  forever, mirroring the pattern already used in kessel_auth.py)
- Validate token URL in kessel_auth.py and workspace.py to fail fast
  when KESSEL_AUTH_OIDC_ISSUER is unconfigured
- Handle missing CA file in client.py with fallback to system roots
- Add debug logging to _reset_client exception handler

Made-with: Cursor
- Change relations-api depends_on from service_started to service_healthy
  so it waits for SpiceDB to be actually ready
- Add HTTP healthchecks to relations-api and inventory-api services
- Update inventory-api depends_on relations-api to use service_healthy
- Add dev-only comment to inventory-config.yaml allow-unauthenticated
- Add integration to resource types list in README (was missing)

Made-with: Cursor
Resolve reviewer concerns by aligning cache and env-var docs with implemented settings, removing references to non-shipped management commands, adding Postgres↔Kessel recovery ordering guidance, documenting credential rotation runbook, and clarifying compatibility guardrails.

Made-with: Cursor
@jordigilh jordigilh force-pushed the FLPATH-3294/kessel-rebac-integration branch from 3bfa133 to 883ada0 Compare April 13, 2026 22:25
- Reformat all koku_rebac/ files with black
- Reorder python imports across affected modules
- Remove unused imports (F401): RbacService, time, caches, log_json,
  PropertyMock, MagicMock, patch, settings, override_settings
- Fix JSON formatting in kessel resource schemas
- Fix trailing whitespace in docs

Made-with: Cursor
@esebesto esebesto added the smokes-required Label to show that smokes tests should be run against these changes. label Apr 14, 2026
@jordigilh
Copy link
Copy Markdown
Contributor Author

Closing for now — will reopen after resolving test failures from rebase.

@jordigilh jordigilh closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked flightpath-pr Issues being worked on by the flight path team on-hold smokes-required Label to show that smokes tests should be run against these changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants