{
  "repo": "tidbcloud/internal-portal",
  "binary": "server",
  "binary_path": "cmd/server/main.go",
  "dependencies": {
    "PortalHealthAPI.Ping": {
      "infrastructure": {},
      "services": []
    },
    "PortalHealthAPI.Healthz": {
      "infrastructure": {},
      "services": []
    },
    "UserAlertWebhook.FireAlert": {
      "infrastructure": {
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Read alert subscription and project metadata",
              "trigger": "Process incoming alert webhooks",
              "implementation": "db.InitializeWithoutMigrate(...) and downstream central service lookups"
            }
          ]
        }
      },
      "services": [
        {
          "name": "core-svc",
          "target_interface": "gRPC cluster queries",
          "operation_type": "grpc_client",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Load cluster context for alert fanout",
              "trigger": "Resolve cluster and project ownership",
              "implementation": "temporary/grpcli.GetCluster(...) via CoreSvcAddr"
            }
          ]
        },
        {
          "name": "account-provider",
          "target_interface": "gRPC user and project APIs",
          "operation_type": "grpc_client",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Resolve project and user recipients and send mail",
              "trigger": "Build recipient list and email payload",
              "implementation": "temporary/grpcli.GetProjectByID/GetUserByID/SendEmail(...) via AccountProviderSvcAddr"
            }
          ]
        }
      ]
    },
    "UserDebugAPI.GetFeatures": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate access token",
              "trigger": "Route is protected by a.Auth middleware",
              "implementation": "auth.InitAuth(...) and grpUserDebugV1.Use(a.Auth, rbac.Useadapter())"
            }
          ]
        }
      },
      "services": []
    },
    "UserDebugAPI.ListAuthorizations": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate access token",
              "trigger": "Route is protected by a.Auth middleware",
              "implementation": "auth.InitAuth(...) and grpUserDebugV1.Use(a.Auth, rbac.Useadapter())"
            }
          ]
        }
      },
      "services": []
    },
    "UserDebugAPI.GetAuthorizationDetail": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate access token",
              "trigger": "Route is protected by a.Auth middleware",
              "implementation": "auth.InitAuth(...) and grpUserDebugV1.Use(a.Auth, rbac.Useadapter())"
            }
          ]
        }
      },
      "services": []
    },
    "UserDebugAPI.GetAuthorizationCode": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate access token",
              "trigger": "Route is protected by a.Auth middleware",
              "implementation": "auth.InitAuth(...) and grpUserDebugV1.Use(a.Auth, rbac.Useadapter())"
            }
          ]
        }
      },
      "services": []
    },
    "UserDebugAPI.CreateAuthorization": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate access token",
              "trigger": "Route is protected by a.Auth middleware",
              "implementation": "auth.InitAuth(...) and grpUserDebugV1.Use(a.Auth, rbac.Useadapter())"
            }
          ]
        },
        "kubernetes": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Issue debug access through infra API clients",
              "trigger": "Create a new cluster authorization",
              "implementation": "auth.InitAuth(..., infraAPI.GetK8sCli()) and postUserDebugAuth(tlsConfig)"
            }
          ]
        }
      },
      "services": []
    },
    "UserDebugAPI.DeleteAuthorization": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate access token",
              "trigger": "Route is protected by a.Auth middleware",
              "implementation": "auth.InitAuth(...) and grpUserDebugV1.Use(a.Auth, rbac.Useadapter())"
            }
          ]
        }
      },
      "services": []
    },
    "UserDebugAPI.ListAuthorizationRecords": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate access token",
              "trigger": "Route is protected by a.Auth middleware",
              "implementation": "auth.InitAuth(...) and grpUserDebugV1.Use(a.Auth, rbac.Useadapter())"
            }
          ]
        }
      },
      "services": []
    },
    "UserDebugAPI.GetAuthorizationRecord": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate access token",
              "trigger": "Route is protected by a.Auth middleware",
              "implementation": "auth.InitAuth(...) and grpUserDebugV1.Use(a.Auth, rbac.Useadapter())"
            }
          ]
        }
      },
      "services": []
    },
    "CentralGatewayHTTP.Healthz": {
      "infrastructure": {},
      "services": []
    },
    "CentralGatewayHTTP.Version": {
      "infrastructure": {
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Expose schema version metadata",
              "trigger": "Render version response",
              "implementation": "migrate.GetInternalDBVersion()"
            }
          ]
        }
      },
      "services": []
    },
    "CentralGatewayHTTP.GetUserAlertList": {
      "infrastructure": {},
      "services": [
        {
          "name": "internal-portal-central-grpc",
          "target_interface": "UserAlertService.GetUserAlertList",
          "operation_type": "grpc_gateway",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Bridge HTTP to local gRPC server",
              "trigger": "grpc-gateway serves the user alert REST route",
              "implementation": "grpchttp.ServeHTTPGateway(..., registerUserAlertServiceHandler)"
            }
          ]
        }
      ]
    },
    "CentralGatewayHTTP.SubscribeUserAlert": {
      "infrastructure": {},
      "services": [
        {
          "name": "internal-portal-central-grpc",
          "target_interface": "UserAlertService.SubscribeUserAlert",
          "operation_type": "grpc_gateway",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Bridge HTTP to local gRPC server",
              "trigger": "grpc-gateway serves the user alert REST route",
              "implementation": "grpchttp.ServeHTTPGateway(..., registerUserAlertServiceHandler)"
            }
          ]
        }
      ]
    },
    "CentralGatewayHTTP.UnsubscribeUserAlert": {
      "infrastructure": {},
      "services": [
        {
          "name": "internal-portal-central-grpc",
          "target_interface": "UserAlertService.UnsubscribeUserAlert",
          "operation_type": "grpc_gateway",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Bridge HTTP to local gRPC server",
              "trigger": "grpc-gateway serves the user alert REST route",
              "implementation": "grpchttp.ServeHTTPGateway(..., registerUserAlertServiceHandler)"
            }
          ]
        }
      ]
    },
    "AdminHTTPAPI.ReplaceNodeAndSKUByYaml": {
      "infrastructure": {},
      "services": [
        {
          "name": "core-svc",
          "target_interface": "gRPC admin and profile operations",
          "operation_type": "grpc_client",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Update tenant profile data",
              "trigger": "External profile replacement API",
              "implementation": "core-portal/admin/api + grpcli/core client usage"
            }
          ]
        }
      ]
    },
    "AdminHTTPAPI.ListTenantClusters": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        }
      },
      "services": [
        {
          "name": "core-svc",
          "target_interface": "gRPC cluster APIs",
          "operation_type": "grpc_client",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "List clusters for the target org",
              "trigger": "Admin cluster inspection and mutation routes",
              "implementation": "grpcli.ListClusters/CountClusters via CoreSvcAddr"
            }
          ]
        },
        {
          "name": "account-provider",
          "target_interface": "gRPC org and project APIs",
          "operation_type": "grpc_client",
          "conditions": [
            "Sometimes"
          ],
          "operations": [
            {
              "operation": "Resolve tenant and project metadata",
              "trigger": "Admin data enrichment paths",
              "implementation": "grpcli account-provider helpers via AccountProviderSvcAddr"
            }
          ]
        }
      ]
    },
    "AdminHTTPAPI.DeleteTenantCluster": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        }
      },
      "services": [
        {
          "name": "core-svc",
          "target_interface": "gRPC cluster mutation APIs",
          "operation_type": "grpc_client",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Delete or mutate tenant clusters",
              "trigger": "Admin cluster mutation routes",
              "implementation": "grpcli cluster service calls via CoreSvcAddr"
            }
          ]
        }
      ]
    },
    "AdminHTTPAPI.ScaleTenantCluster": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        }
      },
      "services": [
        {
          "name": "core-svc",
          "target_interface": "ScaleCluster",
          "operation_type": "grpc_client",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Scale tenant cluster components",
              "trigger": "Admin scale route",
              "implementation": "grpcli.ScaleCluster(...) via CoreSvcAddr"
            }
          ]
        }
      ]
    },
    "AdminHTTPAPI.PauseTenantCluster": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        }
      },
      "services": [
        {
          "name": "core-svc",
          "target_interface": "PauseCluster",
          "operation_type": "grpc_client",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Pause a tenant cluster",
              "trigger": "Admin pause route",
              "implementation": "grpcli pause or lifecycle helpers via CoreSvcAddr"
            }
          ]
        }
      ]
    },
    "AdminHTTPAPI.ResumeTenantCluster": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        }
      },
      "services": [
        {
          "name": "core-svc",
          "target_interface": "ResumeCluster",
          "operation_type": "grpc_client",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Resume a paused tenant cluster",
              "trigger": "Admin resume route",
              "implementation": "grpcli resume or lifecycle helpers via CoreSvcAddr"
            }
          ]
        }
      ]
    },
    "AdminHTTPAPI.GetDashboardLinks": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        }
      },
      "services": [
        {
          "name": "grafana",
          "target_interface": "Configured dashboard base URL",
          "operation_type": "external_http",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Build dashboard links",
              "trigger": "Admin dashboard-link route",
              "implementation": "GrafanaConfig.Server and admin dashboard link helpers"
            }
          ]
        }
      ]
    },
    "AdminHTTPAPI.ListTenantClusterLifeCycle": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        }
      },
      "services": []
    },
    "AdminHTTPAPI.AddProvider": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        }
      },
      "services": []
    },
    "AdminHTTPAPI.ListProviders": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        }
      },
      "services": []
    },
    "AdminHTTPAPI.AddRegion": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        },
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Persist provider region metadata",
              "trigger": "Admin region mutation routes",
              "implementation": "models.InitAdminModel() and admin region data access"
            }
          ]
        }
      },
      "services": []
    },
    "AdminHTTPAPI.UpdateRegion": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        },
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Persist provider region metadata",
              "trigger": "Admin region mutation routes",
              "implementation": "models.InitAdminModel() and admin region data access"
            }
          ]
        }
      },
      "services": []
    },
    "AdminHTTPAPI.ListRegions": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        }
      },
      "services": []
    },
    "AdminHTTPAPI.GetRegionByID": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        }
      },
      "services": []
    },
    "AdminHTTPAPI.CalcNodeProfiles": {
      "infrastructure": {
        "auth0": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Validate management portal JWT and admin permissions",
              "trigger": "Route is protected by MustHaveAdminPermissions()",
              "implementation": "core-portal/admin/api/InitTokenValidator and MustHaveAdminPermissions"
            }
          ]
        }
      },
      "services": [
        {
          "name": "core-svc",
          "target_interface": "gRPC node profile calculation",
          "operation_type": "grpc_client",
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Query node profile recommendations",
              "trigger": "Admin profile calculation route",
              "implementation": "newCoreCnn() dials CoreSvcAddr and CalcNodeProfiles uses grpcli helpers"
            }
          ]
        }
      ]
    },
    "UserAlertService.GetUserAlertList": {
      "infrastructure": {
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Read user alert subscription state",
              "trigger": "List project subscriptions",
              "implementation": "central service models initialized after db.InitializeWithoutMigrate(...)"
            }
          ]
        }
      },
      "services": [
        {
          "name": "core-svc",
          "target_interface": "Cluster and project gRPC APIs",
          "operation_type": "grpc_client",
          "conditions": [
            "Sometimes"
          ],
          "operations": [
            {
              "operation": "Enrich subscription context",
              "trigger": "Central service handlers delegate to cluster model and service layer",
              "implementation": "centralsvc.NewService(centralService, clusterModel)"
            }
          ]
        }
      ]
    },
    "UserAlertService.SubscribeUserAlert": {
      "infrastructure": {
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Persist user alert subscription state",
              "trigger": "Create project subscriptions",
              "implementation": "central service models initialized after db.InitializeWithoutMigrate(...)"
            }
          ]
        }
      },
      "services": [
        {
          "name": "core-svc",
          "target_interface": "Cluster and project gRPC APIs",
          "operation_type": "grpc_client",
          "conditions": [
            "Sometimes"
          ],
          "operations": [
            {
              "operation": "Validate or enrich subscription context",
              "trigger": "Central service handlers delegate to cluster model and service layer",
              "implementation": "centralsvc.NewService(centralService, clusterModel)"
            }
          ]
        }
      ]
    },
    "UserAlertService.UnsubscribeUserAlert": {
      "infrastructure": {
        "mysql": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Delete user alert subscription state",
              "trigger": "Remove project subscriptions",
              "implementation": "central service models initialized after db.InitializeWithoutMigrate(...)"
            }
          ]
        }
      },
      "services": [
        {
          "name": "core-svc",
          "target_interface": "Cluster and project gRPC APIs",
          "operation_type": "grpc_client",
          "conditions": [
            "Sometimes"
          ],
          "operations": [
            {
              "operation": "Validate or enrich subscription context",
              "trigger": "Central service handlers delegate to cluster model and service layer",
              "implementation": "centralsvc.NewService(centralService, clusterModel)"
            }
          ]
        }
      ]
    }
  }
}
