@opengeni/api-router 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/http/auth.ts CHANGED
@@ -46,6 +46,12 @@ function isAuthExempt(c: Context, settings: Settings): boolean {
46
46
  ) {
47
47
  return true;
48
48
  }
49
+ if (
50
+ path === "/v1/integrations/oauth/callback" ||
51
+ path === "/v1/integrations/oauth/client-metadata.json"
52
+ ) {
53
+ return true;
54
+ }
49
55
  // Browser entry for MCP-issued GitHub install links: opened in a browser
50
56
  // that holds no API credentials, like the callbacks above. The route itself
51
57
  // verifies the signed workspace-bound state before doing anything.
@@ -58,7 +64,7 @@ function isAuthExempt(c: Context, settings: Settings): boolean {
58
64
  if (installExactPaths.has(path) || isInstallRedirectPath(path)) {
59
65
  return true;
60
66
  }
61
- if (settings.authAllowHealth && path === "/healthz") {
67
+ if (settings.authAllowHealth && (path === "/healthz" || path === "/readyz")) {
62
68
  return true;
63
69
  }
64
70
  if (settings.authAllowMetrics && path === "/metrics") {
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ import { createObservability, logStartupDependencyRetry } from "@opengeni/observ
6
6
  import { Connection, Client as TemporalClient, ScheduleNotFoundError, ScheduleOverlapPolicy, WorkflowExecutionAlreadyStartedError } from "@temporalio/client";
7
7
  import type { ScheduleOptions, ScheduleSpec, ScheduleUpdateOptions } from "@temporalio/client";
8
8
  import { createApp, type DocumentIndexClient, type SessionWorkflowClient } from "./app";
9
+ import { observabilityEventLogger } from "./observability";
9
10
  import { startAuthCalloutResponder } from "./sandbox/auth-callout";
10
11
  import { startHelloIngestion, startMetricsIngestion } from "./sandbox/metrics-ingestion";
11
12
 
@@ -92,7 +93,7 @@ export async function createTemporalWorkflowClient(settings: ReturnType<typeof g
92
93
  deleteScheduledTaskSchedule: async ({ temporalScheduleId }) => {
93
94
  await temporal.schedule.getHandle(temporalScheduleId).delete().catch(() => undefined);
94
95
  },
95
- triggerScheduledTask: async ({ task, agentRunUsageIdempotencyKey, triggerWorkflowId }) => {
96
+ triggerScheduledTask: async ({ task, agentRunUsageIdempotencyKey, triggerWorkflowId }) => {
96
97
  // Deterministic workflowId (derived from the trigger token by the
97
98
  // caller) + REJECT_DUPLICATE makes a retried manual trigger idempotent:
98
99
  // the second start collides on the id and is rejected instead of
@@ -117,9 +118,12 @@ export async function createTemporalWorkflowClient(settings: ReturnType<typeof g
117
118
  if (isWorkflowAlreadyStarted(error)) {
118
119
  return;
119
120
  }
120
- throw error;
121
- }
122
- },
121
+ throw error;
122
+ }
123
+ },
124
+ check: async () => {
125
+ await connection.workflowService.getSystemInfo({});
126
+ },
123
127
  };
124
128
  const documentIndexer: DocumentIndexClient = {
125
129
  indexDocument: async ({ accountId, workspaceId, documentId }) => {
@@ -166,6 +170,7 @@ export async function startApi() {
166
170
  createNatsEventBus(
167
171
  settings.natsUrl,
168
172
  controlPlaneAuth ? { user: controlPlaneAuth.user, pass: controlPlaneAuth.password } : undefined,
173
+ { logger: observabilityEventLogger(observability) },
169
174
  ),
170
175
  {
171
176
  ...retryOptions,