Skip to content

feat(storage): Admin UI for GCS JSON credentials and File.uri - #320

Open
ChrisPdgn wants to merge 3 commits into
ui-rewritefrom
cursor/storage-gcs-json-and-file-uri-6a2d
Open

feat(storage): Admin UI for GCS JSON credentials and File.uri#320
ChrisPdgn wants to merge 3 commits into
ui-rewritefrom
cursor/storage-gcs-json-and-file-uri-6a2d

Conversation

@ChrisPdgn

@ChrisPdgn ChrisPdgn commented Sep 4, 2026

Copy link
Copy Markdown

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

The PR fulfills these requirements:

  • It's submitted to the master branch
  • Targets ui-rewrite (current Admin rewrite base)
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx, where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature

Why

Admin UI counterpart to backend Conduit #1509 (feat(storage): add GCS parity and public file URI semantics).

Mapping to Conduit #1509

Backend Admin UI
google.serviceAccountKeyJson — inline service account JSON New Google settings field (password input). Path field kept.
ADC when both path and JSON are empty Both Zod fields optional / empty-string; helper copy documents ADC.
File.uri — stable Conduit-relative path (/storage/getFileUrl/:id) File details sheet shows Conduit URI with copy-to-clipboard.
File.url / sourceUrl — direct provider/CDN URLs only when container and file are public Typed as optional on ConduitFile. Actionable download/open/preview still uses getFileUrl(fileId), not file.url.

Leave both Google credential fields empty to use Application Default Credentials. Do not set JSON if a key path is provided.

Zod note: fields use .optional().or(z.literal('')).default('') so an omitted backend serviceAccountKeyJson becomes '' and stays assignable to StorageSettings on save (no change to settings.tsx).

Test plan

  • Storage settings → provider Google: path field still present; JSON field appears with helper text.
  • Save with both credentials empty (ADC). Form validates.
  • Save with only path, or only JSON. Form validates.
  • Switching away from Google shows the cog if either path or JSON is set.
  • Settings still load if the backend omits serviceAccountKeyJson (empty-string fallback).
  • File details: when file.uri is present, Conduit URI renders above the existing URL block; copy button toasts URI copied to clipboard.
  • File details: download / open / preview / URL copy still use getFileUrl and are unchanged when uri is absent.
  • AWS / Azure / Aliyun / Local fields and provider list are unchanged.

Local verification

  • pnpm exec tsc --noEmit passes
  • pnpm exec eslint on the five files: no errors (pre-existing @next/next/no-img-element warning in FileDetailsSheet)
  • FormSchema cases: ADC omitted/empty, path-only, JSON-only succeed; AWS min(5) unchanged

Live Storage settings / File details against a Conduit instance running #1509 was not available in this environment.

Scope

Only these files:

  • src/lib/models/storage/settings.ts
  • src/components/storage/settings/zod.ts
  • src/components/storage/settings/settingsForm.tsx
  • src/lib/models/storage/schemas.ts
  • src/components/storage/browse/FileDetailsSheet.tsx

Draft until backend #1509 lands and this is manually verified against a live storage module.

Open in Web Open in Cursor 

Christina Papadogianni and others added 2 commits September 10, 2026 16:18
Add Google serviceAccountKeyJson alongside key path (ADC when both empty)
and display File.uri in the file details sheet.

Co-authored-by: Christina Papadogianni <ChrisPdgn@users.noreply.github.com>
Keep ADC optional fields while preserving StorageSettings string types
for settings submit.
@ChrisPdgn
ChrisPdgn force-pushed the cursor/storage-gcs-json-and-file-uri-6a2d branch from d26c3bd to a4fc7d9 Compare September 10, 2026 13:18
Load FileDetailsSheet with Promise.allSettled so a URL fetch error
still shows metadata and Conduit URI; download/open stay URL-gated.
@ChrisPdgn
ChrisPdgn marked this pull request as ready for review September 10, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant