Repository navigation
build: use Cloud Components 2.0.0-alpha.51 - #90
Conversation
Krini now sends the user's access token to the selected TES service, so the TES list keeps only registry entries with a valid https URL, as the WES list already does. Refs #44 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bump @elixir-cloud/tes from 1.0.1 to 2.0.0-alpha.51 and @elixir-cloud/wes from 2.0.0-alpha.49 to 2.0.0-alpha.51. The TES components now take a provider. Krini passes a TokenTesProvider, which, like the WES provider, adds the user's access token to every request; both now live in src/lib/service-providers.ts, with tests. The registry URL is the TES base URL, as for WES, so Krini no longer appends /ga4gh/tes/v1. The task list opens the new task details page, which shows the state and logs and can cancel the task. The TEST SERVER entry, which pointed to a path that nothing serves, is gone. Refs #41, #44 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The mock services get a TES service and an http TES entry. The journey tests check that anonymous visitors see only the https TES service, and that a member submits, views and cancels a task with their token. Drop the ignored Firefox page error of @elixir-cloud/design 2.0.0-alpha.49: alpha.51 has the fix (cloud-components#446). Refs #41, #44 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The user and operator guides no longer say that TES requests carry no token. They describe the https rule for TES services, the task details and cancel actions, and the new component versions. Refs #41, #44 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The details link now names the task's service by its registry ID, and the details page selects that service from the (https-only) registry list instead of offering a selector, so a task ID is never looked up on another service. Links without a service ask for one; links to services that aren't in the list show a hint and send no request. The e2e tests cover these cases and a reload of the details page, and the mock TES service records every request, including its service info. Refs #41, #44 Co-Authored-By: Claude Opus 5.5 <[email protected]>
useWESProvider now creates the provider with useMemo, as useTESProvider does, instead of an effect that rendered once without it. The unused setWesProvider is gone. Refs #44 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The operator guide says that registry URLs must be API base URLs, warns that Krini sends the token to every listed service, so only administrators may register services, and adds an upgrade note for TES entries that hold only the host. Refs #41, #44 Co-Authored-By: Claude Opus 5.5 <[email protected]>
A details link without a service uses the current selection; it now shows the selector, so the user can switch if the task is on another service. The mock records requests to the http TES entry too, so the e2e test can show that a link to it sends none. The user guide describes the details links. Refs #41, #44 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's GuideAPIFilter the TES registry API to return only TES services with valid HTTPS URLs, protecting token-bearing requests from insecure endpoints.
Add the task-details route and service-linked task view, including the query parameters that identify the task and its registry service.
Uses of the APIProvide TES and WES Cloud Components with token-bearing providers that fetch the current session token for each service request.
Adapt TES task creation and listing to the v2 provider API and route selected task links to details while preserving the originating service ID.
Resolve a task's linked TES service only from the HTTPS registry list, restore that service on reload, and display task details or appropriate selection hints.
UIAdd browser-level coverage for HTTPS-only TES discovery, token-bearing task submission, task details and cancellation, and invalid or unlinked service cases.
ConfigurationUpgrade the TES and WES dependencies to Cloud Components 2.0.0-alpha.51 and remove the obsolete TEST SERVER selector option.
DocumentationDocument token forwarding, HTTPS service requirements, task details and cancellation, trusted registry administration, API base URLs, and upgrade guidance.
TestsVerify that the token sources and TES/WES providers send the current bearer token on requests and handle missing tokens or failed token retrieval.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #90 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 19 20 +1
Lines 545 566 +21
Branches 157 161 +4
=========================================
+ Hits 545 566 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 5 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/app/api/tasks/get-tes-servers/route.ts" line_range="34-38" />
<code_context>
+ // the components send the user's token to the selected service:
+ // only TES services and gateways over https
const tesServices = res.data.filter(
(service) =>
- service?.type?.artifact === "tes" ||
- service?.type?.artifact === "tes-gateway",
+ (service?.type?.artifact === "tes" ||
+ service?.type?.artifact === "tes-gateway") &&
+ isHttps(service.url),
);
</code_context>
<issue_to_address>
**Registry entries can steal access tokens**
When the registry permits an untrusted user to register services and a member selects that user's HTTPS TES entry, a regular registry user can add an HTTPS TES entry, which passes `get-tes-servers`; when a member selects it, `TokenTesProvider` fetches the session token and attaches it to TES requests, exposing the bearer token to the attacker-controlled service.
Require a verified/allowlisted service before exposing it as selectable, or otherwise enforce the trusted-registry policy in Krini before sending tokens.
Also at `src/lib/service-providers.ts:72`.
</issue_to_address>
### Comment 2
<location path="src/app/api/tasks/get-tes-servers/route.ts" line_range="38" />
<code_context>
- service?.type?.artifact === "tes-gateway",
+ (service?.type?.artifact === "tes" ||
+ service?.type?.artifact === "tes-gateway") &&
+ isHttps(service.url),
);
</code_context>
<issue_to_address>
**Removed services keep receiving bearer tokens**
When the registry removes or changes a TES entry after a tab has loaded its service list, the cached server list and `selectedServer` remain unchanged, so `useTESProvider` continues sending the user's bearer token to the old service. The user sees requests go to a service no longer in the registry.
Refresh or revalidate the server list and selected service before sending requests with the user's token.
Also at `src/lib/service-providers.ts:52`.
</issue_to_address>
### Comment 3
<location path="src/lib/service-providers.ts" line_range="21-25" />
<code_context>
-
-async function getAccessToken(): Promise<string> {
- try {
- const response = await fetch("/auth/api/token", {
- method: "GET",
- credentials: "same-origin",
- cache: "no-store",
- });
-
- if (!response.ok) {
</code_context>
<issue_to_address>
**Token lookup can hang task actions**
When the same-origin token endpoint stalls without returning a response, `getAccessToken` awaits this fetch before `withToken` calls the TES provider, so a token endpoint that accepts but never completes a request leaves the TES action pending indefinitely. No timeout or cancellation handles the stalled lookup.
Bound the token lookup with a timeout and surface a timeout failure instead of leaving the TES operation pending indefinitely.
</issue_to_address>
### Comment 4
<location path="src/lib/service-providers.ts" line_range="27-34" />
<code_context>
- cache: "no-store",
- });
-
- if (!response.ok) {
- return "";
- }
-
</code_context>
<issue_to_address>
**Token failures become anonymous requests**
When the same-origin token request fails during a logged-in TES operation, `getAccessToken` returns an empty string for any non-OK response or fetch error, so `withToken` sends the TES request without authorization and the service rejects it. The caller sees a service failure rather than an indication that token retrieval failed.
Distinguish an absent session from a token-fetch failure and surface the latter instead of silently issuing an unauthenticated request.
</issue_to_address>
### Comment 5
<location path="src/app/api/tasks/get-tes-servers/route.ts" line_range="10" />
<code_context>
+ * @param url URL of a registry entry
+ */
+function isHttps(url: unknown): boolean {
+ return typeof url === "string" && URL.parse(url)?.protocol === "https:";
+}
+
</code_context>
<issue_to_address>
**Host-only TES URLs remain selectable**
When a registry entry still has a host-only HTTPS URL, as a TES entry could before this change, a host-only URL passes this check, so `useTESProvider` uses the host as the API base and the TES components send task requests to `/tasks` instead of `/ga4gh/tes/v1/tasks`; listing, creating, and viewing tasks fail.
Validate that each TES URL is an API base URL before returning it, for example by checking the expected path or probing its `service-info` endpoint.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 5 findings to address first, and the new TES provider attaches the user's bearer token to requests sent to the selected registry service; HTTPS protects the connection but does not make that service trustworthy. If an untrusted service is selectable, it can collect tokens, and reverting stops future sends but cannot recover tokens already exposed.
Blocking findings: src/app/api/tasks/get-tes-servers/route.ts:38, src/app/api/tasks/get-tes-servers/route.ts:38, src/lib/service-providers.ts:25, src/lib/service-providers.ts:34, src/app/api/tasks/get-tes-servers/route.ts:10
Linked issuesChecked at commit 64a5309 #91 build: use Cloud Components 2.0.0-alpha.51 · 6 of 6 met
|
Set date-released to 2026-11-19 and reorder the CITATION.cff authors by lines added on dev (without lock files, public/ and src/components/ui/, as in #74). Add everything merged since the first draft to the release notes: TES tasks with the user's token (#90), the WES run details (#100), the minimal dashboard (#108), the Helm chart (#92, #95), the image end-to-end tests (#99), the deployment docs (#101), the Next.js update (#102) and the fixes #109 and #110. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Moves Krini to Cloud Components 2.0.0-alpha.51, which is now on npm (
@elixir-cloud/tes1.0.1 → 2.0.0-alpha.51,@elixir-cloud/wes2.0.0-alpha.49 → 2.0.0-alpha.51). The TES components now use the v2 provider pattern (elixir-cloud-aai/cloud-components#443), so TES requests carry the user's token the same way WES requests do.Closes #91. Part of #41 and #44 (see "What's left" below). Supersedes the Dependabot PR #86.
TokenTesProvideraddsAuthorization: Bearer …to every request, with the token taken per request from/auth/api/token. It lives insrc/lib/service-providers.tsnext to the WES provider, which moved there from the hook. Both have unit tests./api/tasks/get-tes-serverskeeps only entries with a validhttpsURL, as the WES list already does./ga4gh/tes/v1.ecc-runs-selected. A new page/dashboard/tasks/details?id=…&service=<registry id>rendersECCClientGa4ghTesRun(state, logs, cancel). The service is resolved only from the https registry list, and a linked task can't be looked up on another service./tes-api, no rewrite serves it; feat: run TES tasks with the Cloud Components #41 point 2, also listed in fix: remove leftovers from the rewritten UI #67), and the e2e exemption for the Firefox:host-contexterror of design alpha.49, which alpha.51 fixes (feat: add surface, font and dark mode controls cloud-components#446).useWESProvidernow usesuseMemo, like the newuseTESProvider.Verification
All run locally on the branch head:
bun run lint: no findingsbunx next typegen && bunx tsc --noEmit: passednpm run test:coverage: 248 tests passed, 100% coverage (new:src/lib/service-providers.test.ts, https filter inget-tes-servers/route.test.ts)CI=1 bunx playwright test: 28 passed (Chromium and Firefox). New tests cover: anonymous users see only the https TES service; a member submits, lists, views (also after a reload) and cancels a task, and every TES request carries their token; the hints on the details page without an ID, without a service, and for a service that isn't in the list (no request is sent)mkdocs build --strict: passedCI: all checks passed (
CI passed, both end-to-end jobs, image build and scan, docs, CodeQL, Codecov). The statusVercel – kriniof theelixir-cloud-aaiVercel project fails, as it does on every open PR (#82, #84, #87). It isn't a required check, and thethearcanes-projectsdeployment of the same name passes on those PRs.What's left in #41 and #44
These need follow-ups and are not in this PR:
PREEMPTED/CANCELINGdisplay against proTES (the component has both states); the README component versions (they are in the operator guide).401,403handling, and a filter to verified services (feat: browse services from a registry #40). Until then, the docs tell operators to allow only administrators to register services.Declined review findings
TokenTesProviderandTokenWesProviderinto a mixin: the shared logic is already inwithToken. A mixin over two base classes with a protectedfetchadds typing complexity to save about 8 lines.src/liband the API routes), so the e2e tests cover them.🤖 Generated with Claude Code
Summary by Sourcery
Upgrade Krini to Cloud Components 2.0.0-alpha.51 and add authenticated TES task management with service-safe task details.
New Features:
Bug Fixes:
Enhancements:
Build:
Documentation:
Tests: