1103 lines
35 KiB
TypeScript
1103 lines
35 KiB
TypeScript
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
import { ApplicationConfig, inject, provideAppInitializer } from '@angular/core';
|
|
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
|
import { provideRouter, TitleStrategy, withComponentInputBinding } from '@angular/router';
|
|
import { PageTitleStrategy } from './core/navigation/page-title.strategy';
|
|
|
|
import { routes } from './app.routes';
|
|
import { CONCELIER_EXPORTER_API_BASE_URL } from './core/api/concelier-exporter.client';
|
|
import {
|
|
AUTHORITY_CONSOLE_API,
|
|
AUTHORITY_CONSOLE_API_BASE_URL,
|
|
AuthorityConsoleApiHttpClient,
|
|
} from './core/api/authority-console.client';
|
|
import {
|
|
CONSOLE_API_BASE_URL,
|
|
DEFAULT_EVENT_SOURCE_FACTORY,
|
|
EVENT_SOURCE_FACTORY,
|
|
} from './core/api/console-status.client';
|
|
import {
|
|
NOTIFY_API,
|
|
NOTIFY_API_BASE_URL,
|
|
NOTIFY_TENANT_ID,
|
|
NotifyApiHttpClient,
|
|
MockNotifyClient,
|
|
} from './core/api/notify.client';
|
|
import {
|
|
EXCEPTION_API,
|
|
EXCEPTION_API_BASE_URL,
|
|
ExceptionApiHttpClient,
|
|
MockExceptionApiService,
|
|
} from './core/api/exception.client';
|
|
import { VULNERABILITY_API, MockVulnerabilityApiService } from './core/api/vulnerability.client';
|
|
import { VULNERABILITY_API_BASE_URL, VulnerabilityHttpClient } from './core/api/vulnerability-http.client';
|
|
import { RISK_API, MockRiskApi } from './core/api/risk.client';
|
|
import { RISK_API_BASE_URL, RiskHttpClient } from './core/api/risk-http.client';
|
|
import { AppConfigService } from './core/config/app-config.service';
|
|
import { I18nService } from './core/i18n';
|
|
import { DoctorTrendService } from './core/doctor/doctor-trend.service';
|
|
import { DoctorNotificationService } from './core/doctor/doctor-notification.service';
|
|
import { BackendProbeService } from './core/config/backend-probe.service';
|
|
import { AuthHttpInterceptor } from './core/auth/auth-http.interceptor';
|
|
import { AuthSessionStore } from './core/auth/auth-session.store';
|
|
import { TenantActivationService } from './core/auth/tenant-activation.service';
|
|
import { OperatorMetadataInterceptor } from './core/orchestrator/operator-metadata.interceptor';
|
|
import { TenantHttpInterceptor } from './core/auth/tenant-http.interceptor';
|
|
import { GlobalContextHttpInterceptor } from './core/context/global-context-http.interceptor';
|
|
import { seedAuthSession, type StubAuthSession } from './testing';
|
|
import { CVSS_API_BASE_URL } from './core/api/cvss.client';
|
|
import { AUTH_SERVICE } from './core/auth';
|
|
import { AuthorityAuthService } from './core/auth/authority-auth.service';
|
|
import { AuthorityAuthAdapterService } from './core/auth/authority-auth-adapter.service';
|
|
import {
|
|
ADVISORY_AI_API,
|
|
ADVISORY_AI_API_BASE_URL,
|
|
AdvisoryAiApiHttpClient,
|
|
MockAdvisoryAiClient,
|
|
} from './core/api/advisory-ai.client';
|
|
import {
|
|
ADVISORY_API,
|
|
ADVISORY_API_BASE_URL,
|
|
AdvisoryApiHttpClient,
|
|
MockAdvisoryApiService,
|
|
} from './core/api/advisories.client';
|
|
import {
|
|
VEX_EVIDENCE_API,
|
|
VEX_EVIDENCE_API_BASE_URL,
|
|
VexEvidenceHttpClient,
|
|
MockVexEvidenceClient,
|
|
} from './core/api/vex-evidence.client';
|
|
import {
|
|
VEX_DECISIONS_API,
|
|
VEX_DECISIONS_API_BASE_URL,
|
|
VexDecisionsHttpClient,
|
|
MockVexDecisionsClient,
|
|
} from './core/api/vex-decisions.client';
|
|
import { VEX_HUB_API, VEX_HUB_API_BASE_URL, VEX_LENS_API_BASE_URL, VexHubApiHttpClient, MockVexHubClient } from './core/api/vex-hub.client';
|
|
import {
|
|
AUDIT_BUNDLES_API,
|
|
AUDIT_BUNDLES_API_BASE_URL,
|
|
AuditBundlesHttpClient,
|
|
MockAuditBundlesClient,
|
|
} from './core/api/audit-bundles.client';
|
|
import {
|
|
POLICY_EXCEPTIONS_API,
|
|
POLICY_EXCEPTIONS_API_BASE_URL,
|
|
PolicyExceptionsHttpClient,
|
|
MockPolicyExceptionsApiService,
|
|
} from './core/api/policy-exceptions.client';
|
|
import {
|
|
POLICY_EVIDENCE_API,
|
|
PolicyEvidenceCompositeClient,
|
|
} from './core/api/policy-evidence.client';
|
|
import {
|
|
ORCHESTRATOR_API,
|
|
ORCHESTRATOR_API_BASE_URL,
|
|
OrchestratorHttpClient,
|
|
MockOrchestratorClient,
|
|
} from './core/api/orchestrator.client';
|
|
import {
|
|
ORCHESTRATOR_CONTROL_API,
|
|
OrchestratorControlHttpClient,
|
|
MockOrchestratorControlClient,
|
|
} from './core/api/orchestrator-control.client';
|
|
import {
|
|
FIRST_SIGNAL_API,
|
|
FirstSignalHttpClient,
|
|
MockFirstSignalClient,
|
|
} from './core/api/first-signal.client';
|
|
import {
|
|
EXCEPTION_EVENTS_API,
|
|
EXCEPTION_EVENTS_API_BASE_URL,
|
|
ExceptionEventsHttpClient,
|
|
MockExceptionEventsApiService,
|
|
} from './core/api/exception-events.client';
|
|
import {
|
|
EVIDENCE_PACK_API,
|
|
EVIDENCE_PACK_API_BASE_URL,
|
|
EvidencePackHttpClient,
|
|
MockEvidencePackClient,
|
|
} from './core/api/evidence-pack.client';
|
|
import {
|
|
AI_RUNS_API,
|
|
AI_RUNS_API_BASE_URL,
|
|
AiRunsHttpClient,
|
|
MockAiRunsClient,
|
|
} from './core/api/ai-runs.client';
|
|
import {
|
|
RELEASE_DASHBOARD_API,
|
|
RELEASE_DASHBOARD_API_BASE_URL,
|
|
ReleaseDashboardHttpClient,
|
|
} from './core/api/release-dashboard.client';
|
|
import {
|
|
RELEASE_ENVIRONMENT_API,
|
|
RELEASE_ENVIRONMENT_API_BASE_URL,
|
|
ReleaseEnvironmentHttpClient,
|
|
} from './core/api/release-environment.client';
|
|
import {
|
|
RELEASE_MANAGEMENT_API,
|
|
ReleaseManagementHttpClient,
|
|
} from './core/api/release-management.client';
|
|
import {
|
|
WORKFLOW_API,
|
|
WorkflowHttpClient,
|
|
} from './core/api/workflow.client';
|
|
import {
|
|
APPROVAL_API,
|
|
ApprovalHttpClient,
|
|
} from './core/api/approval.client';
|
|
import {
|
|
DEPLOYMENT_API,
|
|
DeploymentHttpClient,
|
|
} from './core/api/deployment.client';
|
|
import {
|
|
RELEASE_EVIDENCE_API,
|
|
ReleaseEvidenceHttpClient,
|
|
} from './core/api/release-evidence.client';
|
|
import {
|
|
DOCTOR_API,
|
|
HttpDoctorClient,
|
|
} from './features/doctor/services/doctor.client';
|
|
import {
|
|
WITNESS_API,
|
|
WitnessHttpClient,
|
|
} from './core/api/witness.client';
|
|
import {
|
|
NOTIFIER_API,
|
|
NOTIFIER_API_BASE_URL,
|
|
NotifierApiHttpClient,
|
|
MockNotifierClient,
|
|
} from './core/api/notifier.client';
|
|
import {
|
|
POLICY_ENGINE_API,
|
|
PolicyEngineHttpClient,
|
|
MockPolicyEngineApi,
|
|
} from './core/api/policy-engine.client';
|
|
import {
|
|
TRUST_API,
|
|
TrustHttpService,
|
|
MockTrustApiService,
|
|
} from './core/api/trust.client';
|
|
import {
|
|
VULN_ANNOTATION_API,
|
|
HttpVulnAnnotationClient,
|
|
} from './core/api/vuln-annotation.client';
|
|
import {
|
|
AUTHORITY_ADMIN_API,
|
|
AUTHORITY_ADMIN_API_BASE_URL,
|
|
AuthorityAdminHttpClient,
|
|
MockAuthorityAdminClient,
|
|
} from './core/api/authority-admin.client';
|
|
import {
|
|
SECURITY_FINDINGS_API,
|
|
SECURITY_FINDINGS_API_BASE_URL,
|
|
SecurityFindingsHttpClient,
|
|
MockSecurityFindingsClient,
|
|
} from './core/api/security-findings.client';
|
|
import {
|
|
SECURITY_OVERVIEW_API,
|
|
SecurityOverviewHttpClient,
|
|
MockSecurityOverviewClient,
|
|
} from './core/api/security-overview.client';
|
|
import {
|
|
CONSOLE_VULN_API,
|
|
ConsoleVulnHttpClient,
|
|
MockConsoleVulnClient,
|
|
} from './core/api/console-vuln.client';
|
|
import {
|
|
REACHABILITY_API,
|
|
ReachabilityClient,
|
|
MockReachabilityApi,
|
|
} from './core/api/reachability.client';
|
|
import {
|
|
SCHEDULER_API,
|
|
SCHEDULER_API_BASE_URL,
|
|
SchedulerHttpClient,
|
|
MockSchedulerClient,
|
|
} from './core/api/scheduler.client';
|
|
import { AnalyticsHttpClient, MockAnalyticsClient } from './core/api/analytics.client';
|
|
import { FEED_MIRROR_API, FEED_MIRROR_API_BASE_URL, FeedMirrorHttpClient } from './core/api/feed-mirror.client';
|
|
import { ATTESTATION_CHAIN_API, AttestationChainHttpClient } from './core/api/attestation-chain.client';
|
|
import { CONSOLE_SEARCH_API, ConsoleSearchHttpClient } from './core/api/console-search.client';
|
|
import { POLICY_GOVERNANCE_API, HttpPolicyGovernanceApi } from './core/api/policy-governance.client';
|
|
import {
|
|
POLICY_SIMULATION_API,
|
|
POLICY_SIMULATION_API_BASE_URL,
|
|
PolicySimulationHttpClient,
|
|
} from './core/api/policy-simulation.client';
|
|
import {
|
|
GRAPH_API_BASE_URL,
|
|
GRAPH_PLATFORM_API,
|
|
GraphPlatformHttpClient,
|
|
} from './core/api/graph-platform.client';
|
|
import { POLICY_GATES_API, POLICY_GATES_API_BASE_URL, PolicyGatesHttpClient } from './core/api/policy-gates.client';
|
|
import { RELEASE_API, ReleaseHttpClient } from './core/api/release.client';
|
|
import { TRIAGE_EVIDENCE_API, TriageEvidenceHttpClient } from './core/api/triage-evidence.client';
|
|
import { VERDICT_API, HttpVerdictClient } from './core/api/verdict.client';
|
|
import { WATCHLIST_API, WatchlistHttpClient } from './core/api/watchlist.client';
|
|
import { EVIDENCE_API, EVIDENCE_API_BASE_URL, EvidenceHttpClient } from './core/api/evidence.client';
|
|
import {
|
|
MANIFEST_API,
|
|
PROOF_BUNDLE_API,
|
|
SCORE_REPLAY_API,
|
|
ManifestClient,
|
|
ProofBundleClient,
|
|
ScoreReplayClient,
|
|
} from './core/api/proof.client';
|
|
import { SBOM_EVIDENCE_API, SbomEvidenceService } from './features/sbom/services/sbom-evidence.service';
|
|
import { HttpReplayClient } from './core/api/replay.client';
|
|
import { REPLAY_API } from './features/proofs/proof-replay-dashboard.component';
|
|
import { HttpScoreClient } from './core/api/score.client';
|
|
import { SCORE_API } from './features/scores/score-comparison.component';
|
|
import { AOC_API, AOC_API_BASE_URL, AOC_SOURCES_API_BASE_URL, AocHttpClient } from './core/api/aoc.client';
|
|
import { DELTA_VERDICT_API, HttpDeltaVerdictApi } from './core/services/delta-verdict.service';
|
|
import { RISK_BUDGET_API, HttpRiskBudgetApi } from './core/services/risk-budget.service';
|
|
import { FIX_VERIFICATION_API, FixVerificationApiClient } from './core/services/fix-verification.service';
|
|
import { SCORING_API, HttpScoringApi } from './core/services/scoring.service';
|
|
import { ABAC_OVERLAY_API, AbacOverlayHttpClient } from './core/api/abac-overlay.client';
|
|
import {
|
|
IDENTITY_PROVIDER_API,
|
|
IDENTITY_PROVIDER_API_BASE_URL,
|
|
IdentityProviderApiHttpClient,
|
|
MockIdentityProviderClient,
|
|
} from './core/api/identity-provider.client';
|
|
|
|
export const appConfig: ApplicationConfig = {
|
|
providers: [
|
|
provideRouter(routes, withComponentInputBinding()),
|
|
provideAnimationsAsync(),
|
|
{ provide: TitleStrategy, useClass: PageTitleStrategy },
|
|
provideHttpClient(withInterceptorsFromDi()),
|
|
provideAppInitializer(() => {
|
|
const initializerFn = ((configService: AppConfigService, probeService: BackendProbeService, i18nService: I18nService) => async () => {
|
|
await configService.load();
|
|
await i18nService.loadTranslations();
|
|
if (configService.isConfigured()) {
|
|
probeService.probe();
|
|
}
|
|
})(inject(AppConfigService), inject(BackendProbeService), inject(I18nService));
|
|
return initializerFn();
|
|
}),
|
|
{
|
|
provide: HTTP_INTERCEPTORS,
|
|
useClass: AuthHttpInterceptor,
|
|
multi: true,
|
|
},
|
|
{
|
|
provide: HTTP_INTERCEPTORS,
|
|
useClass: OperatorMetadataInterceptor,
|
|
multi: true,
|
|
},
|
|
{
|
|
provide: HTTP_INTERCEPTORS,
|
|
useClass: TenantHttpInterceptor,
|
|
multi: true,
|
|
},
|
|
{
|
|
provide: HTTP_INTERCEPTORS,
|
|
useClass: GlobalContextHttpInterceptor,
|
|
multi: true,
|
|
},
|
|
{
|
|
provide: CONCELIER_EXPORTER_API_BASE_URL,
|
|
useValue: '/api/v1/concelier/exporters/trivy-db',
|
|
},
|
|
{
|
|
provide: AUTHORITY_CONSOLE_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const authorityBase = config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/console', authorityBase).toString();
|
|
} catch {
|
|
const normalized = authorityBase.endsWith('/')
|
|
? authorityBase.slice(0, -1)
|
|
: authorityBase;
|
|
return `${normalized}/console`;
|
|
}
|
|
},
|
|
},
|
|
AuthorityConsoleApiHttpClient,
|
|
{
|
|
provide: AUTHORITY_CONSOLE_API,
|
|
useExisting: AuthorityConsoleApiHttpClient,
|
|
},
|
|
provideAppInitializer(() => {
|
|
const initializerFn = ((store: AuthSessionStore, tenantActivation: TenantActivationService) => () => {
|
|
if (typeof window === 'undefined') return;
|
|
const stub = (window as any).__stellaopsTestSession as StubAuthSession | undefined;
|
|
if (!stub) return;
|
|
try {
|
|
seedAuthSession(store, stub);
|
|
tenantActivation.activateTenant(stub.tenant);
|
|
} catch (err) {
|
|
console.warn('Failed to seed test session', err);
|
|
}
|
|
})(inject(AuthSessionStore), inject(TenantActivationService));
|
|
return initializerFn();
|
|
}),
|
|
{
|
|
provide: RISK_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const authorityBase = config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/risk', authorityBase).toString();
|
|
} catch {
|
|
const normalized = authorityBase.endsWith('/')
|
|
? authorityBase.slice(0, -1)
|
|
: authorityBase;
|
|
return `${normalized}/risk`;
|
|
}
|
|
},
|
|
},
|
|
{
|
|
provide: AUTH_SERVICE,
|
|
useExisting: AuthorityAuthAdapterService,
|
|
},
|
|
{
|
|
provide: CVSS_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const policyBase = config.config.apiBaseUrls.policy;
|
|
try {
|
|
return new URL('/api/cvss', policyBase).toString();
|
|
} catch {
|
|
const normalized = policyBase.endsWith('/') ? policyBase.slice(0, -1) : policyBase;
|
|
return `${normalized}/api/cvss`;
|
|
}
|
|
},
|
|
},
|
|
RiskHttpClient,
|
|
MockRiskApi,
|
|
{
|
|
provide: RISK_API,
|
|
useExisting: RiskHttpClient,
|
|
},
|
|
{
|
|
provide: VULNERABILITY_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const authorityBase = config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/vuln', authorityBase).toString();
|
|
} catch {
|
|
const normalized = authorityBase.endsWith('/')
|
|
? authorityBase.slice(0, -1)
|
|
: authorityBase;
|
|
return `${normalized}/vuln`;
|
|
}
|
|
},
|
|
},
|
|
VulnerabilityHttpClient,
|
|
MockVulnerabilityApiService,
|
|
{
|
|
provide: VULNERABILITY_API,
|
|
useExisting: VulnerabilityHttpClient,
|
|
},
|
|
{
|
|
provide: NOTIFY_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/v1/notify', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/v1/notify`;
|
|
}
|
|
},
|
|
},
|
|
{
|
|
provide: ADVISORY_AI_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/v1/advisory-ai', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/v1/advisory-ai`;
|
|
}
|
|
},
|
|
},
|
|
AdvisoryAiApiHttpClient,
|
|
MockAdvisoryAiClient,
|
|
{
|
|
provide: ADVISORY_AI_API,
|
|
useExisting: AdvisoryAiApiHttpClient,
|
|
},
|
|
{
|
|
provide: ADVISORY_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
return gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
},
|
|
},
|
|
AdvisoryApiHttpClient,
|
|
MockAdvisoryApiService,
|
|
{
|
|
provide: ADVISORY_API,
|
|
useExisting: AdvisoryApiHttpClient,
|
|
},
|
|
{
|
|
provide: VEX_EVIDENCE_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
return gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
},
|
|
},
|
|
{
|
|
provide: VEX_HUB_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/v1/vex', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/v1/vex`;
|
|
}
|
|
},
|
|
},
|
|
{
|
|
provide: VEX_LENS_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/v1/vexlens', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/v1/vexlens`;
|
|
}
|
|
},
|
|
},
|
|
VexHubApiHttpClient,
|
|
MockVexHubClient,
|
|
{
|
|
provide: VEX_HUB_API,
|
|
useExisting: VexHubApiHttpClient,
|
|
},
|
|
VexEvidenceHttpClient,
|
|
MockVexEvidenceClient,
|
|
{
|
|
provide: VEX_EVIDENCE_API,
|
|
useExisting: VexEvidenceHttpClient,
|
|
},
|
|
{
|
|
provide: VEX_DECISIONS_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
return gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
},
|
|
},
|
|
VexDecisionsHttpClient,
|
|
MockVexDecisionsClient,
|
|
{
|
|
provide: VEX_DECISIONS_API,
|
|
useExisting: VexDecisionsHttpClient,
|
|
},
|
|
{
|
|
provide: AUDIT_BUNDLES_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
return gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
},
|
|
},
|
|
AuditBundlesHttpClient,
|
|
MockAuditBundlesClient,
|
|
{
|
|
provide: AUDIT_BUNDLES_API,
|
|
useExisting: AuditBundlesHttpClient,
|
|
},
|
|
{
|
|
provide: POLICY_EXCEPTIONS_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
return gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
},
|
|
},
|
|
PolicyExceptionsHttpClient,
|
|
MockPolicyExceptionsApiService,
|
|
{
|
|
provide: POLICY_EXCEPTIONS_API,
|
|
useExisting: PolicyExceptionsHttpClient,
|
|
},
|
|
PolicyEvidenceCompositeClient,
|
|
{
|
|
provide: POLICY_EVIDENCE_API,
|
|
useExisting: PolicyEvidenceCompositeClient,
|
|
},
|
|
{
|
|
provide: ORCHESTRATOR_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
return gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
},
|
|
},
|
|
OrchestratorHttpClient,
|
|
MockOrchestratorClient,
|
|
{
|
|
provide: ORCHESTRATOR_API,
|
|
useExisting: OrchestratorHttpClient,
|
|
},
|
|
OrchestratorControlHttpClient,
|
|
MockOrchestratorControlClient,
|
|
{
|
|
provide: ORCHESTRATOR_CONTROL_API,
|
|
useExisting: OrchestratorControlHttpClient,
|
|
},
|
|
FirstSignalHttpClient,
|
|
MockFirstSignalClient,
|
|
{
|
|
provide: FIRST_SIGNAL_API,
|
|
useExisting: FirstSignalHttpClient,
|
|
},
|
|
{
|
|
provide: EXCEPTION_EVENTS_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
return gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
},
|
|
},
|
|
ExceptionEventsHttpClient,
|
|
MockExceptionEventsApiService,
|
|
{
|
|
provide: EXCEPTION_EVENTS_API,
|
|
useExisting: ExceptionEventsHttpClient,
|
|
},
|
|
{
|
|
provide: EXCEPTION_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/policy', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/policy`;
|
|
}
|
|
},
|
|
},
|
|
ExceptionApiHttpClient,
|
|
MockExceptionApiService,
|
|
{
|
|
provide: EXCEPTION_API,
|
|
useExisting: ExceptionApiHttpClient,
|
|
},
|
|
{
|
|
provide: EVIDENCE_PACK_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/v1/evidence-packs', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/v1/evidence-packs`;
|
|
}
|
|
},
|
|
},
|
|
EvidencePackHttpClient,
|
|
MockEvidencePackClient,
|
|
{
|
|
provide: EVIDENCE_PACK_API,
|
|
useExisting: EvidencePackHttpClient,
|
|
},
|
|
{
|
|
provide: AI_RUNS_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/v1/runs', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/v1/runs`;
|
|
}
|
|
},
|
|
},
|
|
AiRunsHttpClient,
|
|
MockAiRunsClient,
|
|
{
|
|
provide: AI_RUNS_API,
|
|
useExisting: AiRunsHttpClient,
|
|
},
|
|
{
|
|
provide: CONSOLE_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const authorityBase = config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/console', authorityBase).toString();
|
|
} catch {
|
|
const normalized = authorityBase.endsWith('/')
|
|
? authorityBase.slice(0, -1)
|
|
: authorityBase;
|
|
return `${normalized}/console`;
|
|
}
|
|
},
|
|
},
|
|
{
|
|
provide: EVENT_SOURCE_FACTORY,
|
|
useValue: DEFAULT_EVENT_SOURCE_FACTORY,
|
|
},
|
|
{
|
|
provide: NOTIFY_TENANT_ID,
|
|
useValue: 'tenant-dev',
|
|
},
|
|
NotifyApiHttpClient,
|
|
MockNotifyClient,
|
|
{
|
|
provide: NOTIFY_API,
|
|
useExisting: NotifyApiHttpClient,
|
|
},
|
|
// Release Dashboard API (runtime HTTP client)
|
|
{
|
|
provide: RELEASE_DASHBOARD_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/v1/release-orchestrator', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/v1/release-orchestrator`;
|
|
}
|
|
},
|
|
},
|
|
ReleaseDashboardHttpClient,
|
|
{
|
|
provide: RELEASE_DASHBOARD_API,
|
|
useExisting: ReleaseDashboardHttpClient,
|
|
},
|
|
// Release Environment API (Sprint 111_002)
|
|
{
|
|
provide: RELEASE_ENVIRONMENT_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/v1/release-orchestrator', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/v1/release-orchestrator`;
|
|
}
|
|
},
|
|
},
|
|
ReleaseEnvironmentHttpClient,
|
|
{
|
|
provide: RELEASE_ENVIRONMENT_API,
|
|
useExisting: ReleaseEnvironmentHttpClient,
|
|
},
|
|
// Release Management API (runtime HTTP client)
|
|
ReleaseManagementHttpClient,
|
|
{
|
|
provide: RELEASE_MANAGEMENT_API,
|
|
useExisting: ReleaseManagementHttpClient,
|
|
},
|
|
// Workflow API (runtime HTTP client)
|
|
WorkflowHttpClient,
|
|
{
|
|
provide: WORKFLOW_API,
|
|
useExisting: WorkflowHttpClient,
|
|
},
|
|
// Approval API (runtime HTTP client)
|
|
ApprovalHttpClient,
|
|
{
|
|
provide: APPROVAL_API,
|
|
useExisting: ApprovalHttpClient,
|
|
},
|
|
// Deployment API (runtime HTTP client)
|
|
DeploymentHttpClient,
|
|
{
|
|
provide: DEPLOYMENT_API,
|
|
useExisting: DeploymentHttpClient,
|
|
},
|
|
// Release Evidence API (runtime HTTP client)
|
|
ReleaseEvidenceHttpClient,
|
|
{
|
|
provide: RELEASE_EVIDENCE_API,
|
|
useExisting: ReleaseEvidenceHttpClient,
|
|
},
|
|
// Doctor API (runtime HTTP client)
|
|
HttpDoctorClient,
|
|
{
|
|
provide: DOCTOR_API,
|
|
useExisting: HttpDoctorClient,
|
|
},
|
|
// Witness API (Sprint 20260112_013_FE_witness_ui_wiring)
|
|
WitnessHttpClient,
|
|
{
|
|
provide: WITNESS_API,
|
|
useExisting: WitnessHttpClient,
|
|
},
|
|
// Notifier API (Bug fix: missing DI providers caused NG0201)
|
|
{
|
|
provide: NOTIFIER_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/v1/notifier', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/v1/notifier`;
|
|
}
|
|
},
|
|
},
|
|
NotifierApiHttpClient,
|
|
MockNotifierClient,
|
|
{
|
|
provide: NOTIFIER_API,
|
|
useExisting: NotifierApiHttpClient,
|
|
},
|
|
// Policy Engine API
|
|
PolicyEngineHttpClient,
|
|
MockPolicyEngineApi,
|
|
{
|
|
provide: POLICY_ENGINE_API,
|
|
useExisting: PolicyEngineHttpClient,
|
|
},
|
|
// Trust API
|
|
TrustHttpService,
|
|
MockTrustApiService,
|
|
{
|
|
provide: TRUST_API,
|
|
useExisting: TrustHttpService,
|
|
},
|
|
// ABAC overlay API
|
|
AbacOverlayHttpClient,
|
|
{
|
|
provide: ABAC_OVERLAY_API,
|
|
useExisting: AbacOverlayHttpClient,
|
|
},
|
|
// Vuln Annotation API (runtime HTTP client)
|
|
HttpVulnAnnotationClient,
|
|
{
|
|
provide: VULN_ANNOTATION_API,
|
|
useExisting: HttpVulnAnnotationClient,
|
|
},
|
|
// Authority Admin API (admin CRUD for users/roles/clients/tokens/tenants)
|
|
{
|
|
provide: AUTHORITY_ADMIN_API_BASE_URL,
|
|
useValue: '/console/admin',
|
|
},
|
|
AuthorityAdminHttpClient,
|
|
MockAuthorityAdminClient,
|
|
{
|
|
provide: AUTHORITY_ADMIN_API,
|
|
useExisting: AuthorityAdminHttpClient,
|
|
},
|
|
// Security Findings API (findings ledger via gateway)
|
|
{
|
|
provide: SECURITY_FINDINGS_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
return gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
},
|
|
},
|
|
SecurityFindingsHttpClient,
|
|
MockSecurityFindingsClient,
|
|
{
|
|
provide: SECURITY_FINDINGS_API,
|
|
useExisting: SecurityFindingsHttpClient,
|
|
},
|
|
// Security Overview API (aggregated security dashboard data)
|
|
SecurityOverviewHttpClient,
|
|
MockSecurityOverviewClient,
|
|
{
|
|
provide: SECURITY_OVERVIEW_API,
|
|
useExisting: SecurityOverviewHttpClient,
|
|
},
|
|
// Scheduler API (schedule CRUD)
|
|
{
|
|
provide: SCHEDULER_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/scheduler/api/v1/scheduler', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/scheduler/api/v1/scheduler`;
|
|
}
|
|
},
|
|
},
|
|
SchedulerHttpClient,
|
|
MockSchedulerClient,
|
|
{
|
|
provide: SCHEDULER_API,
|
|
useExisting: SchedulerHttpClient,
|
|
},
|
|
// Console Vuln API
|
|
ConsoleVulnHttpClient,
|
|
MockConsoleVulnClient,
|
|
{
|
|
provide: CONSOLE_VULN_API,
|
|
useExisting: ConsoleVulnHttpClient,
|
|
},
|
|
// Reachability API
|
|
ReachabilityClient,
|
|
MockReachabilityApi,
|
|
{
|
|
provide: REACHABILITY_API,
|
|
useExisting: ReachabilityClient,
|
|
},
|
|
// Analytics API
|
|
AnalyticsHttpClient,
|
|
// Feed Mirror API (Concelier backend via gateway)
|
|
{
|
|
provide: FEED_MIRROR_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/v1/concelier', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/v1/concelier`;
|
|
}
|
|
},
|
|
},
|
|
FeedMirrorHttpClient,
|
|
{
|
|
provide: FEED_MIRROR_API,
|
|
useExisting: FeedMirrorHttpClient,
|
|
},
|
|
// Attestation Chain API
|
|
AttestationChainHttpClient,
|
|
{
|
|
provide: ATTESTATION_CHAIN_API,
|
|
useExisting: AttestationChainHttpClient,
|
|
},
|
|
// Console Search API
|
|
ConsoleSearchHttpClient,
|
|
{
|
|
provide: CONSOLE_SEARCH_API,
|
|
useExisting: ConsoleSearchHttpClient,
|
|
},
|
|
// Policy Governance API
|
|
HttpPolicyGovernanceApi,
|
|
{
|
|
provide: POLICY_GOVERNANCE_API,
|
|
useExisting: HttpPolicyGovernanceApi,
|
|
},
|
|
// Policy Simulation API
|
|
{
|
|
provide: POLICY_SIMULATION_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const policyBase = config.config.apiBaseUrls.policy;
|
|
return policyBase.endsWith('/') ? policyBase.slice(0, -1) : policyBase;
|
|
},
|
|
},
|
|
PolicySimulationHttpClient,
|
|
{
|
|
provide: POLICY_SIMULATION_API,
|
|
useExisting: PolicySimulationHttpClient,
|
|
},
|
|
// Graph Platform API
|
|
{
|
|
provide: GRAPH_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/graph', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/graph`;
|
|
}
|
|
},
|
|
},
|
|
GraphPlatformHttpClient,
|
|
{
|
|
provide: GRAPH_PLATFORM_API,
|
|
useExisting: GraphPlatformHttpClient,
|
|
},
|
|
// Policy Gates API (Policy Gateway backend)
|
|
{
|
|
provide: POLICY_GATES_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/policy', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/policy`;
|
|
}
|
|
},
|
|
},
|
|
PolicyGatesHttpClient,
|
|
{
|
|
provide: POLICY_GATES_API,
|
|
useExisting: PolicyGatesHttpClient,
|
|
},
|
|
// Release API (Release Orchestrator backend)
|
|
ReleaseHttpClient,
|
|
{
|
|
provide: RELEASE_API,
|
|
useExisting: ReleaseHttpClient,
|
|
},
|
|
// Triage Evidence API
|
|
TriageEvidenceHttpClient,
|
|
{
|
|
provide: TRIAGE_EVIDENCE_API,
|
|
useExisting: TriageEvidenceHttpClient,
|
|
},
|
|
// Verdict API
|
|
HttpVerdictClient,
|
|
{
|
|
provide: VERDICT_API,
|
|
useExisting: HttpVerdictClient,
|
|
},
|
|
// Watchlist API
|
|
WatchlistHttpClient,
|
|
{
|
|
provide: WATCHLIST_API,
|
|
useExisting: WatchlistHttpClient,
|
|
},
|
|
// Evidence API (Evidence Locker backend via gateway)
|
|
{
|
|
provide: EVIDENCE_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/v1/evidence', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/v1/evidence`;
|
|
}
|
|
},
|
|
},
|
|
EvidenceHttpClient,
|
|
{
|
|
provide: EVIDENCE_API,
|
|
useExisting: EvidenceHttpClient,
|
|
},
|
|
// Proof APIs (Manifest, Bundle, Score Replay)
|
|
ManifestClient,
|
|
ProofBundleClient,
|
|
ScoreReplayClient,
|
|
{
|
|
provide: MANIFEST_API,
|
|
useExisting: ManifestClient,
|
|
},
|
|
{
|
|
provide: PROOF_BUNDLE_API,
|
|
useExisting: ProofBundleClient,
|
|
},
|
|
{
|
|
provide: SCORE_REPLAY_API,
|
|
useExisting: ScoreReplayClient,
|
|
},
|
|
// SBOM Evidence API
|
|
SbomEvidenceService,
|
|
{
|
|
provide: SBOM_EVIDENCE_API,
|
|
useExisting: SbomEvidenceService,
|
|
},
|
|
// Replay API
|
|
HttpReplayClient,
|
|
{
|
|
provide: REPLAY_API,
|
|
useExisting: HttpReplayClient,
|
|
},
|
|
// Score API
|
|
HttpScoreClient,
|
|
{
|
|
provide: SCORE_API,
|
|
useExisting: HttpScoreClient,
|
|
},
|
|
// Evidence-weighted scoring API
|
|
HttpScoringApi,
|
|
{
|
|
provide: SCORING_API,
|
|
useExisting: HttpScoringApi,
|
|
},
|
|
// Risk dashboard and fix verification stores
|
|
HttpDeltaVerdictApi,
|
|
{
|
|
provide: DELTA_VERDICT_API,
|
|
useExisting: HttpDeltaVerdictApi,
|
|
},
|
|
HttpRiskBudgetApi,
|
|
{
|
|
provide: RISK_BUDGET_API,
|
|
useExisting: HttpRiskBudgetApi,
|
|
},
|
|
FixVerificationApiClient,
|
|
{
|
|
provide: FIX_VERIFICATION_API,
|
|
useExisting: FixVerificationApiClient,
|
|
},
|
|
// AOC API (Attestor + Sources backend via gateway)
|
|
{
|
|
provide: AOC_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/v1/attestor', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/v1/attestor`;
|
|
}
|
|
},
|
|
},
|
|
{
|
|
provide: AOC_SOURCES_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/v1/sources', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/v1/sources`;
|
|
}
|
|
},
|
|
},
|
|
AocHttpClient,
|
|
{ provide: AOC_API, useExisting: AocHttpClient },
|
|
|
|
// Identity Provider API (Platform backend via gateway)
|
|
{
|
|
provide: IDENTITY_PROVIDER_API_BASE_URL,
|
|
deps: [AppConfigService],
|
|
useFactory: (config: AppConfigService) => {
|
|
const gatewayBase = config.config.apiBaseUrls.gateway ?? config.config.apiBaseUrls.authority;
|
|
try {
|
|
return new URL('/api/v1/platform/identity-providers', gatewayBase).toString();
|
|
} catch {
|
|
const normalized = gatewayBase.endsWith('/') ? gatewayBase.slice(0, -1) : gatewayBase;
|
|
return `${normalized}/api/v1/platform/identity-providers`;
|
|
}
|
|
},
|
|
},
|
|
IdentityProviderApiHttpClient,
|
|
MockIdentityProviderClient,
|
|
{
|
|
provide: IDENTITY_PROVIDER_API,
|
|
useExisting: IdentityProviderApiHttpClient,
|
|
},
|
|
|
|
// Doctor background services — started from AppComponent to avoid
|
|
// NG0200 circular DI during APP_INITIALIZER (Router not yet ready).
|
|
DoctorTrendService,
|
|
DoctorNotificationService,
|
|
],
|
|
};
|