Repository navigation
feat: rewrite workflow execution using Cloud Components (#42) - #56
AnonymousXC wants to merge 29 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's GuideData structuresDefine the TES and WES registry service and service-info structures consumed by stores, routes, and UI components.
APIAdd server-side Cloud Registry discovery and WES service-info endpoints, including validation, health probing, and caching.
Expose LS Login callback, login, logout, refresh, token, and user-info endpoints for the dashboard session.
Uses of the APIConnect WES client components to the selected server and retrieve the session token for authenticated requests.
Use the discovery APIs and TES/WES stores to select services, display capabilities, and provide service information and workflow validation.
ImplementationConfigure the shared Axios client and implement browser-side token refresh and user-info state hooks.
UIBuild TES task and WES workflow dashboard pages with Cloud Component execution clients and service selectors.
Present WES service information and authentication feedback through dashboard UI components and pages.
Create the dashboard shell, navigation, responsive sidebar, theme controls, and shared UI primitives.
Remove the legacy Vite application, components, assets, and configuration replaced by the Next.js dashboard.
ConfigurationSwitch CI and production deployment workflows to Bun-based lint/build checks and a serialized OpenShift Docker deployment.
Configure the Bun-based Next.js application, TypeScript aliases, styling, and multi-stage runtime container.
Update repository ignore rules, Docker build exclusions, and environment-variable examples for the new app and deployment.
Remove obsolete Yarn, Husky, and Vite TypeScript configuration files as the project moves to Bun and Next.js.
DocumentationDocument Bun development setup, OIDC and Cloud Registry environment configuration, supported APIs, and deployment guidance.
Add TES and WES example payloads, workflow definitions, input patterns, and workflow design guidance.
Update repository issue templates and license content alongside the app rewrite.
Other changesFiles not grouped.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 23 issues
Fixed security issues:
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="42" />
<code_context>
+ return { status: "invalid", reason: "malformed url" };
+ }
+
+ if (url.protocol !== "https:") {
+ return { status: "invalid", reason: "url is not https" };
+ }
</code_context>
<issue_to_address>
**Internal services are exposed**
When a registry entry targets a loopback, private-network, or otherwise restricted HTTPS address, `probeWesService` and the service-info route validate the URL scheme or path but not its host or resolved address, then make server-side requests and return service data to callers, exposing internal services.
Reject loopback, private-network, and otherwise restricted destinations in both routes before making any server-side request.
Also at `src/app/api/workflows/get-service-info/route.ts:57-71`, `src/app/api/workflows/get-wes-servers/route.ts:47-48`.
</issue_to_address>
### Comment 2
<location path="src/hooks/use-wes-provider.ts" line_range="19" />
<code_context>
+ const token = this.getToken();
+
+ if (token) {
+ headers.set("Authorization", `Bearer ${token}`);
+ }
+
</code_context>
<issue_to_address>
**Selected services receive bearer tokens**
When a registry contributor registers an attacker-controlled HTTPS WES endpoint and a logged-in user selects it, `TokenWesProvider.fetch` attaches the user's access token to requests made to the selected server URL. A malicious registry entry can provide an attacker-controlled HTTPS WES endpoint, which receives the bearer token—and any submitted workflow data—when a user selects it.
Only send bearer tokens to explicitly trusted WES hosts, and bind tokens to approved service audiences rather than arbitrary registry URLs.
Also at `src/app/dashboard/workflows/_components/wes-server-list.tsx:121`.
</issue_to_address>
### Comment 3
<location path="src/app/auth/api/callback/route.ts" line_range="77" />
<code_context>
+ : 60 * 60 * 1000) -
+ 5 * 60 * 1000;
+
+ responseRedirect.cookies.set("access_token", access_token, {
+ ...cookieOptions,
+ maxAge:
</code_context>
<issue_to_address>
**Scripts can steal access tokens**
When an attacker can execute script on the application origin, the callback and refresh routes set `access_token` without `httpOnly`, so browser scripts can read and exfiltrate the bearer token for use against the user's WES or TES services.
Set the access-token cookie as `httpOnly` in both routes and avoid exposing its value to browser scripts.
Also at `src/app/auth/api/refresh/route.ts:85`.
</issue_to_address>
### Comment 4
<location path=".github/workflows/checks.yml" line_range="62" />
<code_context>
+ with:
+ openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
+ openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+
+ - name: Switch to project Krini
</code_context>
<issue_to_address>
**OpenShift token sent without TLS verification**
When an attacker can intercept the deployment runner's connection to the OpenShift server, `oc-login` skips server certificate verification while sending `OPENSHIFT_TOKEN`, so an on-path attacker can impersonate the cluster and capture deployment credentials.
Use the configured certificate authority data and remove the TLS verification bypass.
</issue_to_address>
### Comment 5
<location path="src/app/auth/api/refresh/route.ts" line_range="66-69" />
<code_context>
+ path: "/",
+ };
+
+ const cookieStoreAfter = await cookies();
+ const logoutMarkerAfter = cookieStoreAfter.get("logout_marker")?.value;
+
+ if (logoutMarkerAfter) {
+ return NextResponse.json(
+ { error: "Session terminated" },
</code_context>
<issue_to_address>
**Logout can restore sessions**
When a logout response races with a refresh or callback already in progress, the refresh route rereads the incoming request's cookie snapshot, which cannot contain a marker set by a concurrent logout, and the callback clears the marker before exchanging the code; a late auth response therefore sets session cookies after logout and leaves the user signed in.
Make logout invalidate in-flight refresh and callback exchanges so they cannot issue usable session cookies afterward.
Also at `src/app/auth/api/callback/route.ts:77`, `src/app/auth/api/logout/route.ts:35-46`, `src/app/auth/api/user-info/route.ts:8-11`, `src/hooks/use-wes-provider.ts:30-31`.
</issue_to_address>
### Comment 6
<location path="src/app/auth/api/refresh/route.ts" line_range="28" />
<code_context>
+ try {
+ const baseUrl = `${process.env.LS_LOGIN_URL}/oidc/token`;
+ const response = await axiosBase.post(
+ baseUrl,
+ new URLSearchParams({
+ grant_type: "authorization_code",
</code_context>
<issue_to_address>
**Concurrent refresh logs users out**
When two tabs refresh the same rotating refresh token and the failed response arrives after the successful one, both requests send the old token to the identity provider; when one fails after the other rotates it, its 401 response deletes the session cookies, including replacement tokens from the successful response, and logs the user out.
Coordinate refresh-token rotation so a stale concurrent failure cannot delete cookies issued by a successful refresh.
Also at `src/app/auth/api/refresh/route.ts:99`, `src/app/auth/api/refresh/route.ts:137-143`, `src/hooks/use-token-refresh.ts:24-25`.
</issue_to_address>
### Comment 7
<location path="src/app/auth/api/refresh/route.ts" line_range="99-104" />
<code_context>
+ maxAge: 60 * 60,
+ });
+
+ if (typeof new_refresh_token === "string") {
+ jsonResponse.cookies.set("refresh_token", new_refresh_token, {
+ ...cookieOptions,
+ httpOnly: true,
+ maxAge: 30 * 24 * 60 * 60,
+ });
+ }
+
</code_context>
<issue_to_address>
**Lost refresh responses force re-login**
When the provider rotates the refresh token but the application response carrying the replacement cookie is lost, the identity provider can rotate and invalidate the old refresh token before the application delivers the replacement cookie. If the refresh response is lost after that exchange, the browser retains only the invalid old token, so its next refresh fails and the user must sign in again.
Use durable server-side refresh-token storage or provider-supported rotation grace/idempotency so a lost response does not strand the session.
</issue_to_address>
### Comment 8
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="47" />
<code_context>
+ }
+
+ try {
+ const response = await axiosBase.get(
+ `${url.origin}${url.pathname.replace(/\/$/, "")}/service-info`,
+ {
</code_context>
<issue_to_address>
**Authenticated WES services disappear**
When a registered WES service requires the JWT access token for its service-info endpoint, the probe sends no access token and classifies 401/403 responses as invalid, so the server-list handler filters the service out and users cannot select it; the service-info request also fails without the token.
Send the user's access token with both the probe and service-info requests, and do not classify authentication failures as invalid services.
Also at `src/app/api/workflows/get-wes-servers/route.ts:75`, `src/app/api/workflows/get-wes-servers/route.ts:164`, `src/app/api/workflows/get-service-info/route.ts:70`.
</issue_to_address>
### Comment 9
<location path=".github/workflows/checks.yml" line_range="5-6" />
<code_context>
on:
- pull_request:
- branches: ['dev']
+ push:
+ branches: ['master']
jobs:
</code_context>
<issue_to_address>
**Pull requests skip lint checks**
When a pull request targets `dev`, the checks workflow runs only on pushes to `master`, so its lint job does not run before the pull request merges and invalid changes can merge without that validation.
Restore the `pull_request` trigger for the `dev` branch while retaining the required push checks.
</issue_to_address>
### Comment 10
<location path="Dockerfile" line_range="20" />
<code_context>
-EXPOSE 8081
+COPY --from=build /app/package.json ./package.json
+COPY --from=build /app/node_modules ./node_modules
+COPY --from=build /app/.next ./.next
+COPY --from=build /app/public ./public
</code_context>
<issue_to_address>
**Image optimization fails**
When a client requests the optimized login image in the runtime container, including when OpenShift assigns an arbitrary UID, the runtime image copies root-owned `.next` files and does not make `.next/cache` writable by the server user or OpenShift's assigned UID, so Next.js cannot write optimized image cache files and the request fails.
Make `.next/cache` writable by the runtime user and by OpenShift-assigned UIDs.
Also at `Dockerfile:24`.
</issue_to_address>
### Comment 11
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="182" />
<code_context>
+ (s) => s.health.status === "unreachable",
+ ).length;
+
+ cache = { data: servers, timestamp: now };
+
+ return NextResponse.json(servers, {
</code_context>
<issue_to_address>
**Older registry data replaces cache**
When two requests miss the cache and the earlier request completes last, the earlier registry request assigns its older server and health data to `cache` after the later request has completed, so subsequent callers receive stale data for the remaining cache lifetime.
Only update the cache when the completing request is not older than the data already cached.
</issue_to_address>
### Comment 12
<location path="src/app/dashboard/workflows/_components/workflow-validator.tsx" line_range="121" />
<code_context>
+ </div>
+ </header>
+ <main className="relative px-4 md:px-8 py-4 h-full overflow-y-auto">
+ {children}
+ </main>
+ </SidebarInset>
</code_context>
<issue_to_address>
**Unsupported workflows can be submitted**
When a user submits a workflow type or version absent from the selected server's reported capabilities, `WorkflowValidator` displays the supported types and versions but renders the submission form without checking or blocking incompatible choices, so users submit workflows the selected server does not support.
Validate the selected workflow type and version against the server's reported capabilities and block incompatible submissions.
</issue_to_address>
### Comment 13
<location path="src/components/shared/app-sidebar/app-topbar-actions.tsx" line_range="21" />
<code_context>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Link href="/dashboard/service-info">
+ <Info className="h-4 w-4" />
+ </Link>
</code_context>
<issue_to_address>
**Service Info link returns 404**
When a user clicks the top-bar Service Info icon, the top-bar link points to `/dashboard/service-info`, but the added page is at `/dashboard/workflows/service-info` and requires a server ID, so the link opens a 404.
Link the icon to the implemented service-info route with the required server ID.
</issue_to_address>
### Comment 14
<location path="README.md" line_range="92" />
<code_context>
+!.env.example
+*.pem
+*.key
+
+# VCS and local junk
.git
</code_context>
<issue_to_address>
**Deployment guide link is broken**
When a user follows the deployment guide link on a case-sensitive host, the README links to `docs/DEPLOYMENT.md`, but the added file is named `docs/deployment.md`, so the guide cannot be found.
Change the README link to match the added file's casing.
Also at `README.md:91`, `docs/deployment.md:1`.
</issue_to_address>
### Comment 15
<location path="src/app/dashboard/tasks/_components/tes-server-list.tsx" line_range="73" />
<code_context>
+ return () => {
+ cancelled = true;
+ };
+ }, [serversLoaded, setServers]);
+
+ if (loading) {
</code_context>
<issue_to_address>
**Server lists stay empty after an outage**
When the registry request fails temporarily during the list's initial load, a failed registry fetch leaves `serversLoaded` false but sets loading to false; because the effect depends only on `serversLoaded` and `setServers`, it does not retry when the registry recovers. The TES or WES list stays empty until the user remounts the page or reloads.
Provide a retry action or bounded automatic retries that run after a failed initial fetch.
Also at `src/app/dashboard/workflows/_components/wes-server-list.tsx:72`.
</issue_to_address>
### Comment 16
<location path="src/app/dashboard/workflows/_components/wes-server-list.tsx" line_range="32" />
<code_context>
+ const [loading, setLoading] = useState(!serversLoaded);
+
+ useEffect(() => {
+ if (serversLoaded) {
+ setLoading(false);
+ return;
</code_context>
<issue_to_address>
**Server lists stay stale**
When the registry or a WES service’s health changes after the dashboard has loaded, both selectors stop fetching once `serversLoaded` is true, and their Zustand stores never expire or reset that flag. The lists therefore retain the first registry response for the lifetime of the open app, so newly added or removed services and changed WES health remain unreflected until a full reload.
Give the client server lists an expiry or revalidation trigger, such as on focus or after a bounded interval, and update the stores with the refreshed data.
Also at `src/app/dashboard/tasks/_components/tes-server-list.tsx:27`.
</issue_to_address>
### Comment 17
<location path="src/app/auth/api/refresh/route.ts" line_range="132-135" />
<code_context>
+ const shouldClearCookies =
+ axios.isAxiosError(err) && err.response?.status === 401;
+
+ const response = NextResponse.json(
+ { error: "Failed to refresh token" },
+ { status: 401 },
+ );
+
+ if (shouldClearCookies) {
</code_context>
<issue_to_address>
**Temporary identity outage logs users out**
When the identity provider is temporarily unreachable or returns a transient error during token refresh, the refresh route returns 401 for network errors and all other token-endpoint failures, so `useTokenRefresh` treats a temporary identity-provider outage as an expired session and redirects users to log in again.
Return a retryable status for transient upstream failures and make the client retry with backoff, redirecting only when the refresh token is definitively invalid.
Also at `src/hooks/use-token-refresh.ts:46`.
</issue_to_address>
### Comment 18
<location path="src/app/auth/api/callback/route.ts" line_range="30" />
<code_context>
+ cookieStore.delete("logout_marker");
+
+ try {
+ const baseUrl = `${process.env.LS_LOGIN_URL}/oidc/token`;
+ const response = await axiosBase.post(
+ baseUrl,
</code_context>
<issue_to_address>
**Trailing slash breaks identity endpoints**
When `LS_LOGIN_URL` is configured with a trailing slash, the endpoint URLs gain a doubled slash when `LS_LOGIN_URL` ends in `/`; identity providers that do not normalize the path then reject token exchange, refresh, and user-info requests, disrupting login and authenticated sessions.
Normalize `LS_LOGIN_URL` once or construct all identity endpoint URLs with `new URL`.
Also at `src/app/auth/api/refresh/route.ts:26`, `src/app/auth/api/user-info/route.ts:15`.
</issue_to_address>
### Comment 19
<location path="src/app/dashboard/tasks/_components/ecc-tes-run-wrapper.tsx" line_range="31" />
<code_context>
+ );
+ }
+
+ const baseURL = `${selectedServer.replace(/\/+$/, "")}/ga4gh/tes/v1`;
+
+ return <ECCClientGa4ghTesCreateRuns baseURL={baseURL} />;
</code_context>
<issue_to_address>
**TES requests duplicate the service path**
When a TES registry entry's URL already ends in `/ga4gh/tes/v1`, both wrappers append `/ga4gh/tes/v1` to `selectedServer` without checking whether the registry URL already contains that API path. The resulting base URL has the path twice, so task listing and submission requests go to invalid endpoints.
Use the registry URL as the TES base URL when it already includes the API path, and append the path only when it does not.
Also at `src/app/dashboard/tasks/_components/ecc-tes-create-run-wrapper.tsx:31`.
</issue_to_address>
### Comment 20
<location path="next.config.ts" line_range="19" />
<code_context>
+ return [
+ {
+ source: "/tes-api/:path*",
+ destination: "https://csc-tesk-noauth.rahtiapp.fi/:path*",
+ },
+ ];
</code_context>
<issue_to_address>
**Test server is exposed in production**
When the production app is deployed with this configuration, the rewrite proxies `/tes-api` to a no-auth test service, and the TES selector always offers that endpoint. Production users can therefore submit tasks to a test-only service, despite the config comment identifying it as for testing purposes.
Remove the test endpoint from production builds or gate both the rewrite and selector option behind a development-only setting.
Also at `src/app/dashboard/tasks/_components/tes-server-list.tsx:109`.
</issue_to_address>
### Comment 21
<location path="src/app/dashboard/page.tsx" line_range="2" />
<code_context>
+function DashboardPage() {
+ return <div>WIP</div>;
+}
+
</code_context>
<issue_to_address>
**Dashboard entry point remains a stub**
When a user opens the app root or navigates to the dashboard, the root page redirects users to `/dashboard`, whose page renders only `WIP`. Users entering the app or returning via the Krini link land on a placeholder instead of a useful dashboard.
Implement the dashboard content or redirect the entry point to a completed task or workflow page.
Also at `src/app/page.tsx:4`.
</issue_to_address>
### Comment 22
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="164" />
<code_context>
+ );
+
+ const servers: CachedWESServer[] = results
+ .filter(({ probe }) => probe.status !== "invalid")
+ .map(({ item: service, probe }) => ({
+ ...service,
</code_context>
<issue_to_address>
**Hide unreachable services**
The issue asks the selector to show only services with a reachable `/service-info`. The API filters out invalid probes but retains unreachable services, which the selector displays as disabled entries.
</issue_to_address>
### Comment 23
<location path="src/app/dashboard/tasks/_components/ecc-tes-run-wrapper.tsx" line_range="35" />
<code_context>
+
+ const res = await axiosBase.get(
+ `${registryUrl.replace(/\/+$/, "")}/services`,
+ );
+ if (
+ !res.data ||
</code_context>
<issue_to_address>
**TES requests omit bearer token**
When a TES service requires the JWT access token as documented, the TES components receive only a base URL, so their cross-origin requests do not include the user's bearer token. TES services configured as documented reject task listings and submissions as unauthorized, leaving both TES screens unusable.
Provide the user's access token to the TES client and attach it as a bearer token to its requests.
Also at `src/app/dashboard/tasks/_components/ecc-tes-create-run-wrapper.tsx:33`.
</issue_to_address>Linked issues
#42 feat: run WES workflows with the Cloud Components · 3 of 7 met · 1 to check by hand
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Add a registry-backed selector for verified HTTPS WES services, with no hard-coded WES URL. | 🟡 Partly met | The selector uses registry services and HTTPS probes rather than a hard-coded WES URL, but unreachable services are still included in the selector as disabled options. |
| 2 | Show each service's supported workflow types and versions from its /service-info. |
✅ Met | The server probe fetches service information and the selector displays reported workflow types and versions. |
| 3 | Check the user's chosen workflow type and version against the service before submission. | ❌ Not addressed | The create page displays the supported types and versions, but the validator only presents guidance and does not inspect or block submission based on the user's workflow. |
| 4 | Use the v2 provider pattern to add the user's token per request. | ✅ Met | The WES provider subclasses RestWesProvider and adds the bearer token in its fetch method. |
| 5 | Provide example workflows known to run on each listed backend, with their inputs. | ❌ Not addressed | The change adds the workflow submission form but no example workflows or backend-specific inputs. |
| 6 | Document WES CORS requirements and do not proxy WES requests through Krini. | ✅ Met | The deployment guide documents CORS, and the WES provider sends requests directly to the selected service. |
| 7 | A logged-in user with compute access can submit an example workflow to each listed service and follow it to completion. | 👀 Check by hand (runtime) | Run an example workflow with a logged-in compute-enabled account against each deployed WES service and verify it completes. |
Sourcery assessment
Needs a human reviewer. 22 findings to address first, and the new OIDC callback stores the access token in a JavaScript-readable cookie, so browser-side code can read it; if that token is exposed, reverting will not revoke copies already obtained. The rewritten workflow also pushes a latest image and triggers a production rollout, so reverting the repository change does not undo effects of a deployment that already ran.
Blocking findings: src/app/api/workflows/get-wes-servers/route.ts:42, src/hooks/use-wes-provider.ts:19, src/app/auth/api/callback/route.ts:77, .github/workflows/checks.yml:62, src/app/auth/api/refresh/route.ts:69, and 17 more
|
@sourcery-ai resolve |
There was a problem hiding this comment.
Linked issues
#42 feat: run WES workflows with the Cloud Components · 6 of 10 met · 1 to check by hand
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Populate the WES selector from registry-listed HTTPS WES services. | ✅ Met | The server route filters registry entries to WES and WES-gateway artifacts, probes HTTPS service-info endpoints, and the selector uses those results. |
| 2 | Show each service's supported workflow types and versions. | ✅ Met | The selector tooltip and workflow creation page display the selected service's reported types and versions. |
| 3 | Check the user's workflow choice against service capabilities before submission. | 🟡 Partly met | The page displays supported types and versions, but the validator does not compare the submitted workflow's type or version against them. |
| 4 | Use a WES provider that adds the user's token per request, with no auth logic in the component. | ✅ Met | A RestWesProvider subclass adds the bearer token, and the WES components receive the provider. |
| 5 | Provide known-to-run example workflows, with inputs, for each listed backend. | ❌ Not addressed | No backend-specific workflow examples or inputs are added to the docs or test data. |
| 6 | Document that WES services must allow Krini's origin through CORS. | ✅ Met | The deployment guide documents the required CORS headers and configuration examples. |
| 7 | If a WES gateway is added, apply the same gateway tag rules as for TES. | ✅ Met | Registry filtering includes the WES-gateway artifact tag. |
| 8 | Show only verified WES services with reachable service-info in the selector. | 🟡 Partly met | Unreachable services remain visible in the selector, although they are disabled. |
| 9 | Do not hard-code a WES URL. | ✅ Met | The WES provider uses the selected registry service URL; no fixed WES endpoint is used. |
| 10 | Allow a logged-in user with compute access to submit an example workflow to each listed service and follow it to completion. | 👀 Check by hand (runtime) | Test end-to-end submission and completion against each live listed WES service using an account with compute access. |
There was a problem hiding this comment.
Linked issues
#42 feat: run WES workflows with the Cloud Components · 4 of 8 met · 1 to check by hand
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Select WES services from the registry that use HTTPS and have a reachable service-info endpoint. | 🟡 Partly met | The endpoint probes HTTPS services and excludes invalid responses, but the selector still displays unreachable services as disabled options. |
| 2 | Show each service's supported workflow types and versions. | ✅ Met | The selector tooltip and service information view display reported workflow types and versions. |
| 3 | Check the user's workflow type and version against service capabilities before submission. | ❌ Not addressed | The create page only displays guidance to match the selected service's capabilities; it does not prevent submission of an unsupported type or version. |
| 4 | Use the WES v2 provider pattern to add the user's token per request, without putting auth logic in the component. | ✅ Met | The custom RestWesProvider subclass adds the bearer token in its fetch method and is passed to the component. |
| 5 | Provide examples with inputs that are known to run on each listed WES backend. | 🟡 Partly met | The docs include workflow examples and request inputs, but do not identify which listed backends support or have run each example. |
| 6 | Document the WES CORS requirement and do not proxy WES requests through Krini. | ✅ Met | The deployment guide documents CORS, and the WES client uses the service provider directly. |
| 7 | Allow a logged-in user with compute access to submit an example workflow to each listed WES service and follow it to completion. | 👀 Check by hand (runtime) | Test submission and run tracking with an appropriately authorized user against every listed WES service. |
| 8 | Do not hard-code a WES URL. | ✅ Met | WES endpoints are obtained from the registry. |
uniqueg
left a comment
There was a problem hiding this comment.
Thanks, @AnonymousXC. I can't reasonably review this (way too big), but if you manage to fix the Vercel deployment so that I can play with it, I'd love to do that. I could also ask Claude to have a look and give either a review report or fixes or both. Just say the word. However, neither I nor it can see the build report and errors, so you'd need to post them.
|
Thanks for the feedback, @uniqueg ! I'll work on fixing the Vercel deployment so you can try it out. I'll also share the build report and deployment errors here so you can take a look. A review report or fixes would be greatly appreciated. I'll let you know once the preview is ready. |
There was a problem hiding this comment.
Linked issues
#42 feat: run WES workflows with the Cloud Components · 2 of 7 met · 1 to check by hand
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Select verified HTTPS WES services with reachable service-info, without hard-coded WES URLs. | 🟡 Partly met | Discovery probes HTTPS service-info endpoints and the code contains no hard-coded WES URL, but unreachable services are still returned and shown in the selector as disabled entries. |
| 2 | Show supported workflow types and versions, and check the user's choice against them before submission. | 🟡 Partly met | The create page displays reported types and versions, but it still renders the submission form without enforcing compatibility. |
| 3 | Use a WES v2 provider that adds the user's token per request. | ✅ Met | The WES wrappers pass a provider, and the custom RestWesProvider subclass adds the bearer token in fetch. |
| 4 | Provide example workflows known to run on each listed WES backend, with their inputs and engine versions. | 🟡 Partly met | Workflow examples are documented, but they are generic and are not mapped or verified against each listed backend's engines and versions. |
| 5 | Document WES CORS requirements and do not proxy WES through Krini. | 🟡 Partly met | The deployment guide documents CORS and workflow requests use the provider directly, but the service-info API route fetches WES metadata server-side and returns it to the client. |
| 6 | Apply the TES gateway tag rules if a WES gateway is added. | ✅ Met | Service discovery includes entries tagged with the WES gateway artifact. |
| 7 | Allow a logged-in user with compute access to submit an example to each listed WES service and follow it to completion. | 👀 Check by hand (runtime) | Test authenticated submission and completion against each actual listed WES service using the documented examples. |
|
Review of this PR at What ran: locally, Blocking
Should fix
Small
What's goodThe token is read per request, there's no hard-coded WES URL, |
|
Thanks, Chitransh, and thanks for the offer to share the build report! It isn't urgent any more: the code builds and lints fine locally, and your preview deploys, so don't spend time on it unless you also want the org Vercel project fixed. The review above looks like a lot, but most of it is small. Two things from you would help most:
I think once those are in, we can merge and use smaller PRs from here on out :) |
|
Thanks, @uniqueg. It’s going to be quite a busy week for me. It would be very helpful if u can ask claude for a pr for all the fixes. I'll review it and merge into this branch. For, the preview i have created a temporary deployed, which can be available here . It currently, points to this feat branch. I'll keep things manual from my side unless we migrate to cloudflare pages or find an alternative for deployment. Also, for context - Krini fetches the registry from - https://elixir-on.cloud/ga4gh/registry/v1/services, for now(It has no services listed in it which renders the WES server selector as empty). |
|
Reopened this, because I think it was probably closed by accident and we need it to file PRs against for fixes as per #56 (comment). Please let me know if it was intentional @AnonymousXC |
Linked issuesChecked at commit a1e8a2e #42 feat: run WES workflows with the Cloud Components · 4 of 9 met · 2 to check by hand
|
There was a problem hiding this comment.
Hey - I've found 20 issues
Fixed security issues:
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="42" />
<code_context>
+ return { status: "invalid", reason: "malformed url" };
+ }
+
+ if (url.protocol !== "https:") {
+ return { status: "invalid", reason: "url is not https" };
+ }
</code_context>
<issue_to_address>
**Internal services are reachable**
When the Cloud Registry supplies a WES URL resolving to a private, loopback, or otherwise internal HTTPS host, `probeWesService` and the service-info route accept the URL and issue server-side requests to it, exposing service-info data or reachability through the unauthenticated APIs.
Reject WES URLs that resolve to private, loopback, or otherwise internal addresses before making server-side requests.
Also at `src/app/api/workflows/get-service-info/route.ts:56-71`, `src/app/api/workflows/get-wes-servers/route.ts:48`.
</issue_to_address>
### Comment 2
<location path="src/hooks/use-wes-provider.ts" line_range="18" />
<code_context>
+ const token = await this.getToken();
+
+ if (token) {
+ headers.set("Authorization", `Bearer ${token}`);
+ }
+
</code_context>
<issue_to_address>
**Access tokens reach attacker servers**
When an attacker can publish a convincing WES entry in the configured registry and a user selects it, a malicious WES entry from the Cloud Registry can pass the health probe and be selected; `TokenWesProvider.fetch` then attaches the user’s bearer token to requests for that entry’s URL. The attacker receives the token and can use it against services that accept the client’s credentials.
Restrict authenticated requests to verified service origins, or require a clear origin-trust confirmation before sending the user’s bearer token.
</issue_to_address>
### Comment 3
<location path="src/app/auth/api/refresh/route.ts" line_range="68" />
<code_context>
+ };
+
+ const cookieStoreAfter = await cookies();
+ const logoutMarkerAfter = cookieStoreAfter.get("logout_marker")?.value;
+
+ if (logoutMarkerAfter) {
</code_context>
<issue_to_address>
**Logout sessions are restored**
When a refresh overlaps with logout and its response is applied after the logout response, `cookies()` rereads the refresh request’s incoming cookies, so the refresh handler cannot see the concurrent logout marker and can return fresh authentication cookies; token and user-info routes accept those cookies, leaving the user authenticated after logout.
Make logout invalidation prevent in-flight refresh responses from restoring credentials, and have authentication routes reject sessions marked as logged out.
Also at `src/app/auth/api/refresh/route.ts:86`, `src/app/auth/api/logout/route.ts:35-41`, `src/app/auth/api/token/route.ts:6`.
</issue_to_address>
### Comment 4
<location path="src/app/auth/api/refresh/route.ts" line_range="131-138" />
<code_context>
+ }
+
+ const shouldClearCookies =
+ axios.isAxiosError(err) && err.response?.status === 401;
+
+ const response = NextResponse.json(
+ { error: "Failed to refresh token" },
+ { status: 401 },
+ );
+
+ if (shouldClearCookies) {
+ response.cookies.delete("logout_marker");
+ response.cookies.delete("access_token");
</code_context>
<issue_to_address>
**Successful refresh logs users out**
When multiple tabs refresh the same rotating token and the stale request’s response arrives last, the failed refresh response deletes token cookies even after another request has rotated the token and set a valid session, leaving the browser logged out.
Coordinate refreshes across tabs or avoid deleting session cookies when a failed request may be stale.
Also at `src/hooks/use-token-refresh.ts:24-25`, `src/app/auth/api/refresh/route.ts:31`, `src/app/auth/api/refresh/route.ts:140`.
</issue_to_address>
### Comment 5
<location path="src/app/auth/api/refresh/route.ts" line_range="135" />
<code_context>
+ if (!refreshToken) {
+ return NextResponse.json(
+ { error: "No refresh token available" },
+ { status: 401 },
+ );
+ }
</code_context>
<issue_to_address>
**Transient errors force login**
When the network or identity provider fails temporarily during token refresh, the refresh route returns 401 for transient failures, and `useTokenRefresh` redirects on every rejected refresh request, sending users to login instead of allowing a retry.
Distinguish transient refresh failures from invalid sessions and avoid redirecting users for failures they can retry.
Also at `src/hooks/use-token-refresh.ts:46-47`.
</issue_to_address>
### Comment 6
<location path="Dockerfile" line_range="18-25" />
<code_context>
+!.env.example
+*.pem
+*.key
+
+# VCS and local junk
.git
</code_context>
<issue_to_address>
**OpenShift traffic targets old port**
When the existing OpenShift service or deployment still targets port 8081, the image changes the application port from the previous Nginx port 8081 to Next.js port 3000, while the deployment workflow only rolls out the existing `krini` deployment and changes no service or deployment port configuration. If that configuration still targets 8081, requests reach no listener and the deployment is unavailable.
Update the OpenShift target/container port to 3000 as part of deployment, or configure the application to keep listening on 8081.
</issue_to_address>
### Comment 7
<location path="src/app/auth/api/callback/route.ts" line_range="91" />
<code_context>
+ maxAge: 60 * 60,
+ });
+
+ if (typeof refresh_token === "string") {
+ responseRedirect.cookies.set("refresh_token", refresh_token, {
+ ...cookieOptions,
</code_context>
<issue_to_address>
**Old refresh token survives re-login**
When a user re-authenticates while an old refresh-token cookie exists and the identity provider does not issue a refresh token in the new response, the callback replaces the access and ID tokens but leaves any existing refresh-token cookie untouched when the new token response omits `refresh_token`. Later refreshes then use the previous grant, potentially switching the session back to the previous account or clearing the newly authenticated session.
Clear the existing refresh-token cookie when starting a new authorization flow or when the successful callback response contains no replacement refresh token.
</issue_to_address>
### Comment 8
<location path="src/app/dashboard/tasks/_components/ecc-tes-create-run-wrapper.tsx" line_range="33" />
<code_context>
+
+ const baseURL = `${selectedServer.replace(/\/+$/, "")}/ga4gh/tes/v1`;
+
+ return <ECCClientGa4ghTesCreateRuns baseURL={baseURL} />;
+}
</code_context>
<issue_to_address>
**Secured TES requests fail**
When a selected TES service requires the documented bearer-token authentication, the TES wrappers pass only `baseURL`, so the TES components send requests without an access token and secured services reject task listing and submission.
Provide the TES components with authenticated requests that include the access token.
Also at `src/app/dashboard/tasks/_components/ecc-tes-run-wrapper.tsx:31-34`, `src/app/dashboard/tasks/_components/ecc-tes-create-run-wrapper.tsx:31`.
</issue_to_address>
### Comment 9
<location path="src/app/dashboard/tasks/_components/tes-server-list.tsx" line_range="108" />
<code_context>
+ className="min-w-87.5 max-w-[min(90vw,480px)]"
+ >
+ <SelectGroup>
+ <SelectItem value="/tes-api">TEST SERVER</SelectItem>
+
+ {servers.map((server) => (
</code_context>
<issue_to_address>
**Test server requests return 404**
When a user selects the built-in `TEST SERVER` option, the selector sets the server URL to `/tes-api`, and the wrappers append `/ga4gh/tes/v1`; because the app has no matching route or rewrite, task requests return 404.
Point the built-in option at a TES service route that exists or add the matching route or rewrite.
Also at `src/app/dashboard/tasks/_components/ecc-tes-create-run-wrapper.tsx:31`, `src/app/dashboard/tasks/_components/ecc-tes-run-wrapper.tsx:31`.
</issue_to_address>
### Comment 10
<location path="src/components/shared/app-sidebar/app-topbar-actions.tsx" line_range="22" />
<code_context>
+ <Link
+ href={`/dashboard/workflows/service-info?id=${getWESSelectedServerID(selectedWESServer)}`}
+ >
+ <Info className="h-4 w-4" />
+ </Link>
+ }
</code_context>
<issue_to_address>
**Service Info link opens 404**
When a user clicks the top-bar Service Info control, the link navigates to `/dashboard/service-info`, but the service-info page is under `/dashboard/workflows/service-info`, so the user reaches a missing route.
Change the link to the service-info page’s actual route.
Also at `src/components/shared/app-sidebar/app-topbar-actions.tsx:21`, `src/components/shared/app-sidebar/app-topbar-actions.tsx:23`.
</issue_to_address>
### Comment 11
<location path="src/app/dashboard/workflows/_components/workflow-validator.tsx" line_range="121" />
<code_context>
+ </div>
+ </header>
+ <main className="relative px-4 md:px-8 py-4 h-full overflow-y-auto">
+ {children}
+ </main>
+ </SidebarInset>
</code_context>
<issue_to_address>
**Unsupported workflows can submit**
When a user selects or submits a workflow type or version not supported by the selected WES, `WorkflowValidator` displays the service capabilities but renders the submission form without checking its selected type or version, so the service rejects unsupported workflows only after submission.
Check the form’s selected workflow type and version against the selected service’s capabilities and prevent unsupported submissions.
Also at `src/app/dashboard/workflows/create/page.tsx:35-39`.
</issue_to_address>
### Comment 12
<location path="src/stores/wes.ts" line_range="20" />
<code_context>
+
+ servers: [],
+ serversLoaded: false,
+ setServers: (servers) => set({ servers, serversLoaded: true }),
+}));
</code_context>
<issue_to_address>
**Unavailable WES remains selected**
When a WES refresh removes the selected service or marks it unreachable, `setServers` replaces the discovered list without reconciling `selectedServer`, and the provider and workflow form continue using the stale URL, allowing submissions to a removed or unreachable server.
Reconcile the selected server with refreshed results and prevent submissions when it is no longer available.
Also at `src/app/dashboard/workflows/_components/wes-server-list.tsx:53`, `src/app/dashboard/workflows/_components/wes-server-list.tsx:173`, `src/hooks/use-wes-provider.ts:59-60`, `src/app/dashboard/workflows/_components/workflow-validator.tsx:32-53`.
</issue_to_address>
### Comment 13
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="142-145" />
<code_context>
+ throw new Error("Cloud Registry URL is not configured.");
+ }
+
+ const res = await axiosBase.get(
+ `${registryUrl.replace(/\/+$/, "")}/services`,
+ );
+ if (
+ !res.data ||
</code_context>
<issue_to_address>
**Registry outage disables WES selection**
When the Cloud Registry is unavailable after the one-minute cache TTL expires, after the cache expires, the handler must fetch the registry before returning any servers. If that request fails, the catch returns 502 instead of serving the cached server list, so a registry outage lasting over a minute makes WES discovery unavailable even when the WES services remain healthy.
Serve the last known server list on registry errors, marking it stale or reporting the registry failure separately.
</issue_to_address>
### Comment 14
<location path="Dockerfile" line_range="21-24" />
<code_context>
-EXPOSE 8081
+COPY --from=build /app/package.json ./package.json
+COPY --from=build /app/node_modules ./node_modules
+COPY --from=build /app/.next ./.next
+COPY --from=build /app/public ./public
-# Set user in the final stage (more secure)
-USER nginx:root
+USER bun
+EXPOSE 3000
</code_context>
<issue_to_address>
**Image cache is unwritable at runtime**
When a container request triggers Next.js image optimization, the image copies `.next` into the runtime image without changing ownership, then runs as `bun`. Next.js image optimization writes its cache under `.next/cache`; the non-root process cannot write there, so optimized images can fail in the container.
Make the runtime image's `.next/cache` writable by `bun`, or configure image delivery to avoid runtime cache writes.
</issue_to_address>
### Comment 15
<location path="src/app/dashboard/tasks/_components/ecc-tes-run-wrapper.tsx" line_range="31" />
<code_context>
+ );
+ }
+
+ const baseURL = `${selectedServer.replace(/\/+$/, "")}/ga4gh/tes/v1`;
+
+ return <ECCClientGa4ghTesCreateRuns baseURL={baseURL} />;
</code_context>
<issue_to_address>
**TES endpoint path is duplicated**
When a TES registry URL already ends with `/ga4gh/tes/v1`, the TES wrappers append `/ga4gh/tes/v1` again, so task requests go to a duplicated endpoint path and fail.
Normalize registry URLs so the TES API path is appended only when it is not already present.
Also at `src/app/dashboard/tasks/_components/ecc-tes-create-run-wrapper.tsx:31`.
</issue_to_address>
### Comment 16
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="183-184" />
<code_context>
+ ).length;
+
+ const completionTime = Date.now();
+ if (!cache || completionTime > cache.timestamp) {
+ cache = { data: servers, timestamp: completionTime };
+ }
+
</code_context>
<issue_to_address>
**Older WES data replaces newer cache**
When overlapping cache misses finish probing in an order different from when they started, the cache compares completion times, so an earlier request with an older registry snapshot can finish last and replace newer data for the cache TTL.
Prevent an older registry snapshot from replacing a cache entry created by a newer request.
</issue_to_address>
### Comment 17
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="164" />
<code_context>
+ );
+
+ const servers: CachedWESServer[] = results
+ .filter(({ probe }) => probe.status !== "invalid")
+ .map(({ item: service, probe }) => ({
+ ...service,
</code_context>
<issue_to_address>
**Hide unreachable services**
The issue asks the selector to show only verified services with a reachable `/service-info`. This filter keeps unreachable probes in the response, and the selector displays them as disabled entries.
</issue_to_address>
### Comment 18
<location path="src/app/api/tasks/get-tes-servers/route.ts" line_range="24" />
<code_context>
+ throw new Error("Invalid JSON response");
+ }
+
+ const tesServices = res.data.filter(
+ (service) =>
+ service?.type?.artifact === "tes" ||
</code_context>
<issue_to_address>
**Unreachable TES instances stay selectable**
When the registry contains a TES endpoint that is unavailable, the TES registry route filters only by service artifact and returns matching entries without probing their endpoints or reporting health. The selector then presents them as ordinary choices, so an unavailable TES instance is offered for task execution despite the claimed service-health discovery.
Probe TES endpoints and expose health to the selector so unreachable instances can be identified or disabled.
</issue_to_address>
### Comment 19
<location path="src/app/dashboard/page.tsx" line_range="2" />
<code_context>
+function DashboardPage() {
+ return <div>WIP</div>;
+}
+
</code_context>
<issue_to_address>
**Login lands on a WIP screen**
When a user completes LS Login successfully, the successful OIDC callback redirects to `/dashboard`, whose page renders only `WIP`. Newly authenticated users therefore land on an unfinished screen rather than a usable dashboard.
Implement the dashboard landing page or redirect successful logins to a completed dashboard section.
</issue_to_address>
### Comment 20
<location path="docs/workflow-examples.md" line_range="3" />
<code_context>
+# Workflow Examples
+
+This document provides example workflows known to run on TES and WES backends, including their inputs and configurations.
+
+## TES (Task Execution Service) Examples
</code_context>
<issue_to_address>
**Verify examples per service**
The docs provide workflow examples and inputs, but do not map them to the listed WES services or their engine versions. They therefore do not establish that an example is known to run on each service.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 20 findings to address first, and the new WES health probe makes server-side requests to registry-provided HTTPS URLs without restricting the destination host or port, so a compromised registry entry could reach internal services; the new OAuth and workflow paths also enable token-backed execution on external services. Reverting stops future requests, but cannot undo access or workflow jobs that already occurred.
Blocking findings: src/app/api/workflows/get-wes-servers/route.ts:42, src/hooks/use-wes-provider.ts:18, src/app/auth/api/refresh/route.ts:68, src/app/auth/api/refresh/route.ts:138, src/app/auth/api/refresh/route.ts:135, and 15 more
| return { status: "invalid", reason: "malformed url" }; | ||
| } | ||
|
|
||
| if (url.protocol !== "https:") { |
There was a problem hiding this comment.
🟠 High · Internal services are reachable
When the Cloud Registry supplies a WES URL resolving to a private, loopback, or otherwise internal HTTPS host, probeWesService and the service-info route accept the URL and issue server-side requests to it, exposing service-info data or reachability through the unauthenticated APIs.
Reject WES URLs that resolve to private, loopback, or otherwise internal addresses before making server-side requests.
Also at src/app/api/workflows/get-service-info/route.ts:56-71, src/app/api/workflows/get-wes-servers/route.ts:48.
Prompt for AI agents
In `src/app/api/workflows/get-wes-servers/route.ts` at line 42:
**Internal services are reachable**
When the Cloud Registry supplies a WES URL resolving to a private, loopback, or otherwise internal HTTPS host, `probeWesService` and the service-info route accept the URL and issue server-side requests to it, exposing service-info data or reachability through the unauthenticated APIs.
Reject WES URLs that resolve to private, loopback, or otherwise internal addresses before making server-side requests.
Also at `src/app/api/workflows/get-service-info/route.ts:56-71`, `src/app/api/workflows/get-wes-servers/route.ts:48`.| const token = await this.getToken(); | ||
|
|
||
| if (token) { | ||
| headers.set("Authorization", `Bearer ${token}`); |
There was a problem hiding this comment.
🟠 High · Access tokens reach attacker servers
When an attacker can publish a convincing WES entry in the configured registry and a user selects it, a malicious WES entry from the Cloud Registry can pass the health probe and be selected; TokenWesProvider.fetch then attaches the user’s bearer token to requests for that entry’s URL. The attacker receives the token and can use it against services that accept the client’s credentials.
Restrict authenticated requests to verified service origins, or require a clear origin-trust confirmation before sending the user’s bearer token.
Prompt for AI agents
In `src/hooks/use-wes-provider.ts` at line 18:
**Access tokens reach attacker servers**
When an attacker can publish a convincing WES entry in the configured registry and a user selects it, a malicious WES entry from the Cloud Registry can pass the health probe and be selected; `TokenWesProvider.fetch` then attaches the user’s bearer token to requests for that entry’s URL. The attacker receives the token and can use it against services that accept the client’s credentials.
Restrict authenticated requests to verified service origins, or require a clear origin-trust confirmation before sending the user’s bearer token.| }; | ||
|
|
||
| const cookieStoreAfter = await cookies(); | ||
| const logoutMarkerAfter = cookieStoreAfter.get("logout_marker")?.value; |
There was a problem hiding this comment.
🟠 High · Logout sessions are restored
When a refresh overlaps with logout and its response is applied after the logout response, cookies() rereads the refresh request’s incoming cookies, so the refresh handler cannot see the concurrent logout marker and can return fresh authentication cookies; token and user-info routes accept those cookies, leaving the user authenticated after logout.
Make logout invalidation prevent in-flight refresh responses from restoring credentials, and have authentication routes reject sessions marked as logged out.
Also at src/app/auth/api/refresh/route.ts:86, src/app/auth/api/logout/route.ts:35-41, src/app/auth/api/token/route.ts:6.
Prompt for AI agents
In `src/app/auth/api/refresh/route.ts` at line 68:
**Logout sessions are restored**
When a refresh overlaps with logout and its response is applied after the logout response, `cookies()` rereads the refresh request’s incoming cookies, so the refresh handler cannot see the concurrent logout marker and can return fresh authentication cookies; token and user-info routes accept those cookies, leaving the user authenticated after logout.
Make logout invalidation prevent in-flight refresh responses from restoring credentials, and have authentication routes reject sessions marked as logged out.
Also at `src/app/auth/api/refresh/route.ts:86`, `src/app/auth/api/logout/route.ts:35-41`, `src/app/auth/api/token/route.ts:6`.| axios.isAxiosError(err) && err.response?.status === 401; | ||
|
|
||
| const response = NextResponse.json( | ||
| { error: "Failed to refresh token" }, | ||
| { status: 401 }, | ||
| ); | ||
|
|
||
| if (shouldClearCookies) { |
There was a problem hiding this comment.
🟡 Medium · Successful refresh logs users out
When multiple tabs refresh the same rotating token and the stale request’s response arrives last, the failed refresh response deletes token cookies even after another request has rotated the token and set a valid session, leaving the browser logged out.
Coordinate refreshes across tabs or avoid deleting session cookies when a failed request may be stale.
Also at src/hooks/use-token-refresh.ts:24-25, src/app/auth/api/refresh/route.ts:31, src/app/auth/api/refresh/route.ts:140.
Prompt for AI agents
In `src/app/auth/api/refresh/route.ts` at lines 131-138:
**Successful refresh logs users out**
When multiple tabs refresh the same rotating token and the stale request’s response arrives last, the failed refresh response deletes token cookies even after another request has rotated the token and set a valid session, leaving the browser logged out.
Coordinate refreshes across tabs or avoid deleting session cookies when a failed request may be stale.
Also at `src/hooks/use-token-refresh.ts:24-25`, `src/app/auth/api/refresh/route.ts:31`, `src/app/auth/api/refresh/route.ts:140`.|
|
||
| const response = NextResponse.json( | ||
| { error: "Failed to refresh token" }, | ||
| { status: 401 }, |
There was a problem hiding this comment.
🟡 Medium · Transient errors force login
When the network or identity provider fails temporarily during token refresh, the refresh route returns 401 for transient failures, and useTokenRefresh redirects on every rejected refresh request, sending users to login instead of allowing a retry.
Distinguish transient refresh failures from invalid sessions and avoid redirecting users for failures they can retry.
Also at src/hooks/use-token-refresh.ts:46-47.
Prompt for AI agents
In `src/app/auth/api/refresh/route.ts` at line 135:
**Transient errors force login**
When the network or identity provider fails temporarily during token refresh, the refresh route returns 401 for transient failures, and `useTokenRefresh` redirects on every rejected refresh request, sending users to login instead of allowing a retry.
Distinguish transient refresh failures from invalid sessions and avoid redirecting users for failures they can retry.
Also at `src/hooks/use-token-refresh.ts:46-47`.| if (!cache || completionTime > cache.timestamp) { | ||
| cache = { data: servers, timestamp: completionTime }; |
There was a problem hiding this comment.
🟡 Medium · Older WES data replaces newer cache
When overlapping cache misses finish probing in an order different from when they started, the cache compares completion times, so an earlier request with an older registry snapshot can finish last and replace newer data for the cache TTL.
Prevent an older registry snapshot from replacing a cache entry created by a newer request.
Prompt for AI agents
In `src/app/api/workflows/get-wes-servers/route.ts` at lines 183-184:
**Older WES data replaces newer cache**
When overlapping cache misses finish probing in an order different from when they started, the cache compares completion times, so an earlier request with an older registry snapshot can finish last and replace newer data for the cache TTL.
Prevent an older registry snapshot from replacing a cache entry created by a newer request.| ); | ||
|
|
||
| const servers: CachedWESServer[] = results | ||
| .filter(({ probe }) => probe.status !== "invalid") |
There was a problem hiding this comment.
🟡 Medium · Hide unreachable services
The issue asks the selector to show only verified services with a reachable /service-info. This filter keeps unreachable probes in the response, and the selector displays them as disabled entries.
Prompt for AI agents
In `src/app/api/workflows/get-wes-servers/route.ts` at line 164:
**Hide unreachable services**
The issue asks the selector to show only verified services with a reachable `/service-info`. This filter keeps unreachable probes in the response, and the selector displays them as disabled entries.From #42:
Add a WES selector populated with verified HTTPS services from the registry.| throw new Error("Invalid JSON response"); | ||
| } | ||
|
|
||
| const tesServices = res.data.filter( |
There was a problem hiding this comment.
🟡 Medium · Unreachable TES instances stay selectable
When the registry contains a TES endpoint that is unavailable, the TES registry route filters only by service artifact and returns matching entries without probing their endpoints or reporting health. The selector then presents them as ordinary choices, so an unavailable TES instance is offered for task execution despite the claimed service-health discovery.
Probe TES endpoints and expose health to the selector so unreachable instances can be identified or disabled.
Prompt for AI agents
In `src/app/api/tasks/get-tes-servers/route.ts` at line 24:
**Unreachable TES instances stay selectable**
When the registry contains a TES endpoint that is unavailable, the TES registry route filters only by service artifact and returns matching entries without probing their endpoints or reporting health. The selector then presents them as ordinary choices, so an unavailable TES instance is offered for task execution despite the claimed service-health discovery.
Probe TES endpoints and expose health to the selector so unreachable instances can be identified or disabled.| @@ -0,0 +1,5 @@ | |||
| function DashboardPage() { | |||
| return <div>WIP</div>; | |||
There was a problem hiding this comment.
🟡 Medium · Login lands on a WIP screen
When a user completes LS Login successfully, the successful OIDC callback redirects to /dashboard, whose page renders only WIP. Newly authenticated users therefore land on an unfinished screen rather than a usable dashboard.
Implement the dashboard landing page or redirect successful logins to a completed dashboard section.
Prompt for AI agents
In `src/app/dashboard/page.tsx` at line 2:
**Login lands on a WIP screen**
When a user completes LS Login successfully, the successful OIDC callback redirects to `/dashboard`, whose page renders only `WIP`. Newly authenticated users therefore land on an unfinished screen rather than a usable dashboard.
Implement the dashboard landing page or redirect successful logins to a completed dashboard section.| @@ -0,0 +1,466 @@ | |||
| # Workflow Examples | |||
|
|
|||
| This document provides example workflows known to run on TES and WES backends, including their inputs and configurations. | |||
There was a problem hiding this comment.
🟡 Medium · Verify examples per service
The docs provide workflow examples and inputs, but do not map them to the listed WES services or their engine versions. They therefore do not establish that an example is known to run on each service.
Prompt for AI agents
In `docs/workflow-examples.md` at line 3:
**Verify examples per service**
The docs provide workflow examples and inputs, but do not map them to the listed WES services or their engine versions. They therefore do not establish that an example is known to run on each service.From #42:
Provide example workflows known to run on each listed WES service, with their inputs.|
Closing again: this branch already went into |
Closing issues
Closes #42
Summary by Sourcery
Replace the legacy workflow application with a Next.js Cloud Components dashboard for authenticated TES and WES discovery, execution, and monitoring.
New Features:
Enhancements:
Build:
CI:
Deployment:
Documentation:
Chores: