Added GET /api/cloud/connections/{id}/config to expose non-secret WebDAV connection fields (server_url, connection_username) for the edit modal — password never included
CloudCredentialModal rewritten with full edit-mode support: existing prop, getConnectionConfig() call, showAdvanced/customEndpoint for Nextcloud custom paths
Updated test_connect_google_drive to expect 200 JSON (was 302 redirect) — regression fix following oauth_initiate behavior change
duration
completed
tasks_completed
files_modified
~20 minutes
2026-05-30T09:30:26Z
2
6
Phase 05 Plan 10: Cloud UI Gap Closure — OAuth Initiate + Edit Fixes Summary
Fixed four cloud settings UI gaps: OAuth initiate 401, Nextcloud custom endpoint lost on edit, missing Edit button on ERROR rows, and confirmation text overflow.
GET /api/cloud/oauth/initiate/{provider} now returns 200 JSON {"url": authorization_url} instead of 302 RedirectResponse. The Bearer-authenticated frontend can now read the URL and navigate with window.location.href = data.url — closing the 401 gap caused by the browser not sending auth headers on bare navigation.
GET /api/cloud/connections/{connection_id}/config — new endpoint returning non-secret WebDAV/Nextcloud connection fields (server_url, connection_username, never the password) for the edit modal pre-population flow.
Frontend changes:
client.js: Added initiateOAuth(provider) using request() (injects Bearer header, handles 401 → refresh). Added getConnectionConfig(connectionId) for edit modal.
SettingsCloudTab.vue: handleConnect for OAuth providers now uses await initiateOAuth() + window.location.href = data.url with error display. Added handleEdit() function. Added Edit buttons to ACTIVE and ERROR blocks (non-OAuth providers only). Wrapped all ConfirmBlock instances in div.w-full.overflow-hidden.
CloudCredentialModal.vue: Full rewrite with edit-mode support — existing prop, getConnectionConfig() call on open, serverBase/username/showAdvanced/customEndpoint refs, computed autoServerUrl/resolvedServerUrl. Nextcloud watch handler detects when stored server_url differs from auto-constructed URL and opens Advanced section with the custom endpoint pre-filled.
ConfirmBlock.vue: Added break-words class to message paragraph.
Test Results
All 25 tests in test_cloud.py pass:
2 new tests: test_oauth_initiate_returns_json_url, test_oauth_initiate_requires_auth
test_connect_google_drive updated to expect 200 JSON (was 302 — stale after behavioral change)
Frontend build: zero errors (1 pre-existing dynamic import warning)
Deviations from Plan
Auto-added Missing Critical Functionality
1. [Rule 2 - Missing] Added GET /api/cloud/connections/{id}/config backend endpoint
Found during: Task 2 — CloudCredentialModal needs existing server_url to pre-populate edit form
Issue: The plan described existing.server_url and existing.connection_username as available from the existing prop passed from SettingsCloudTab, but CloudConnectionOut (the whitelist model) only exposes id, provider, display_name, status, connected_at — no decrypted credential fields
Fix: Added a dedicated /config endpoint that decrypts just the non-secret fields (server_url, username — never password). Added getConnectionConfig() to client.js. Modal calls this endpoint when existing prop is set.
4. [Rule 2 - Missing] Rewrote CloudCredentialModal with full edit-mode support
Found during: Task 2 — Plan described fixing a watch handler with specific logic (serverBase, customEndpoint, showAdvanced) that didn't exist yet in the modal
Fix: Added all missing reactive state, the advanced section UI, and the full watch handler with Nextcloud custom endpoint detection
None — all functionality is fully wired. The edit modal requires the user to re-enter their password (backend connect_webdav always requires password for health-check). A future enhancement could add a PATCH endpoint that accepts partial credential updates (password optional on edit).
Threat Flags
Flag
File
Description
threat_flag: new-endpoint
backend/api/cloud.py
GET /api/cloud/connections/{id}/config — new endpoint decrypting partial credentials. Mitigations: get_regular_user enforced, 404 on wrong-owner (ID enumeration prevention), password field excluded, only applicable to VALID_WEBDAV_PROVIDERS