super-productivity/electron
oon arfiandwi 5ea0570f39
feat(plugins): generic OAuth hooks for issue-provider plugins (#8546)
* feat(plugins): enable OAuth-based issue-provider plugins

Generic, provider-agnostic plugin-framework hooks so an issue-provider plugin
that needs an exact OAuth redirect can work without any built-in code:

- OAuthFlowConfig.redirectUri: a plugin may declare an exact pre-registered
  callback; the host uses it for both the authorize request and token exchange.
- The Electron loopback honors a plugin-requested fixed port and rejects with a
  clear message when that port is already in use.
- Apply user-supplied clientId/clientSecret/redirectUri overrides onto a
  plugin's oauthConfig (bring-your-own OAuth app).
- Fix: merging a partial pluginConfig update no longer drops omitted keys and
  deep-merges nested objects (e.g. twoWaySync).

Split out of the Basecamp community-plugin work per PR #8507 feedback; contains
no provider-specific code.

* fix(plugins): address #8546 review

- validate OAuthFlowConfig.redirectUri per platform (loopback / same-origin /
  app scheme) and fail fast instead of hanging; restrict desktop loopback to 127.0.0.1
- warn when a client secret is dropped on web/native (bring-your-own credentials)
- validate the IPC loopback port to [1024,65535], register the error handler before
  listen(), and close the failed server
- merge pluginConfig via generic recursion instead of a hardcoded twoWaySync case
- nits: named token-store imports; fix stale prepareRedirectUri comment
- tests: redirectUri validation, the web client-secret warning, and generic merge

* fix(plugins): address #8546 round-2 review

- loopback error handler calls cleanupServer() so a post-listen runtime error
  doesn't leave the server ref / 5-min timer dangling
- share OAUTH_LOOPBACK_PORT_{MIN,MAX} between the renderer and Electron main so
  the bounds never drift; reject out-of-range (incl. 0/80/443) redirect ports early
- drop _getElectronLoopbackPort and parse the already-validated redirectUri once
- document that a bring-your-own clientSecret syncs via pluginConfig (override boundary)
- skip __proto__/constructor/prototype keys in the pluginConfig merge (defense-in-depth)
- test: prototype-pollution guard

* fix(plugins): address #8546 round-3 review

- reject native redirectUri overrides outright (closes CodeQL
  js/incomplete-url-scheme-check) via a pure, per-platform validateOAuthRedirectUri
  util (electron loopback / native reject / web same-origin)
- gate bring-your-own OAuth credentials to the desktop loopback flow and warn
  (instead of silently dropping clientId) when set on web/native
- namespace BYO under pluginConfig.oauthOverrides (was flat keys); document the
  convention on OAuthFlowConfig (public plugin API)
- shallow top-level pluginConfig merge: drop the deep recursion + proto guard;
  nested objects (e.g. twoWaySync) are replaced wholesale, matching callers
- pin the web redirect to /assets/oauth-callback.html via a shared constant so a
  same-origin wrong-path URI fails fast; note the desktop 127.0.0.1-only rule
- companion tests for each

* fix(plugins): strip desktop redirectUri on web/native OAuth flows

A plugin-declared redirectUri is the desktop loopback override; keeping it on
the web/native branches made a web/native-capable plugin throw at connect time
(the loopback URI fails web/native redirectUri validation). Strip it on those
branches so prepareRedirectUri falls through to the platform default. Document
redirectUri as desktop-only in the plugin API and fix a misleading test name.

* refactor(plugins): extract resolveEffectiveOAuthConfig and harden native fallthrough

Move the platform client/secret/redirectUri selection out of the bridge into a
pure, parameterized util so every branch is unit-testable (the IS_* platform
consts are module-level and cannot be mocked in karma). Also strip clientSecret
and redirectUri on the native fall-through — a native platform where the plugin
ships no matching client id — keeping both strictly desktop-only.

Optional hardening on top of the redirectUri fix; safe to drop independently.
2026-06-30 14:11:00 +02:00
..
assets/icons fix(electron): crisp, flicker-free Linux tray icon (#4905) (#8484) 2026-06-19 12:43:00 +02:00
ipc-handlers fix(keyboard): resolve macOS global shortcut layout mismatch (#8378) (#8381) 2026-06-17 12:57:47 +02:00
scripts refactor(electron): bundle preload script with esbuild to support sandbox mode 2026-03-22 19:38:21 +01:00
shared-with-frontend feat(plugins): generic OAuth hooks for issue-provider plugins (#8546) 2026-06-30 14:11:00 +02:00
task-widget Feat/task widget global shortcut (#7099) 2026-06-09 16:11:16 +02:00
wayland-idle-helper Add ext-idle-notify backend for Wayland idle detection (#7337) 2026-04-24 16:50:24 +02:00
app-control.test.cjs fix(electron): respect tray title settings #7823 (#8097) 2026-06-08 12:07:09 +02:00
backup.ts fix(electron): restrict loadBackupData IPC to the backup directory (#8206) 2026-06-09 15:29:06 +02:00
bundled-plugin-ids.test.cjs feat(plugins): allow uploaded nodeExecution behind consent gate (#8576) 2026-06-25 16:45:54 +02:00
clear-stale-idb-locks.ts Feat/to me it looks like there are lots of 60dd04 (#7280) 2026-04-20 12:04:38 +02:00
clipboard-image-handler.test.cjs fix(security): restrict renderer-supplied filesystem IPC paths (#8223) 2026-06-09 18:16:22 +02:00
clipboard-image-handler.ts fix(security): restrict renderer-supplied filesystem IPC paths (#8223) 2026-06-09 18:16:22 +02:00
common-const.test.cjs refactor(sync): remove unused error classes, dialog, and constructor-time logging (phase 1, #8325) (#8510) 2026-06-20 13:36:56 +02:00
common.const.ts fix(electron): restore custom title bar on GNOME-X11 (#8483) (#8485) 2026-06-19 12:42:44 +02:00
CONFIG.ts Increase ping interval and idle time in order to not waste CPU cycles. (#6227) 2026-01-28 15:37:50 +01:00
debug.ts refactor: rename overlay-indicator to task-widget 2026-03-30 22:00:47 +02:00
electronAPI.d.ts feat(plugins): generic OAuth hooks for issue-provider plugins (#8546) 2026-06-30 14:11:00 +02:00
error-handler-with-frontend-inform.ts fix(error-handling): prevent [object Object] from appearing in error messages 2026-01-02 15:40:14 +01:00
file-path-guard.test.cjs fix(security): restrict renderer-supplied filesystem IPC paths (#8223) 2026-06-09 18:16:22 +02:00
file-path-guard.ts fix(security): restrict renderer-supplied filesystem IPC paths (#8223) 2026-06-09 18:16:22 +02:00
full-screen-blocker.ts fix(security): harden XSS sinks and add Origin check (#7413) 2026-05-06 21:37:06 +02:00
gpu-startup-guard.ts fix(electron): add GPU startup guard for confined Linux packages 2026-04-20 18:35:31 +02:00
idle-time-handler.ts fix(electron): retry Wayland idle helper startup (#7527) 2026-05-10 22:35:33 +02:00
image-cache.test.cjs feat(electron): restore bmp/avif background image support 2026-06-10 17:04:26 +02:00
image-cache.ts feat(electron): restore bmp/avif background image support 2026-06-10 17:04:26 +02:00
indicator.test.cjs refactor(sync): remove unused error classes, dialog, and constructor-time logging (phase 1, #8325) (#8510) 2026-06-20 13:36:56 +02:00
indicator.ts fix(electron): crisp, flicker-free Linux tray icon (#4905) (#8484) 2026-06-19 12:43:00 +02:00
ipc-handler-wrapper.test.cjs fix(security): restrict renderer-supplied filesystem IPC paths (#8223) 2026-06-09 18:16:22 +02:00
ipc-handler-wrapper.ts fix(security): restrict renderer-supplied filesystem IPC paths (#8223) 2026-06-09 18:16:22 +02:00
ipc-handler.ts feat(electron): add Local REST API for desktop automation (#6981) 2026-03-28 13:35:04 +01:00
jira.ts fix(jira): honor no_proxy for electron requests #6324 (#8177) 2026-06-09 15:00:43 +02:00
local-file-sync.test.cjs Merge master and address PR review findings 2026-06-10 19:17:54 +02:00
local-file-sync.ts fix(electron): guard sync-folder cache against stale-load clobber 2026-06-10 20:35:00 +02:00
local-rest-api.ts fix(security): harden XSS sinks and add Origin check (#7413) 2026-05-06 21:37:06 +02:00
lockscreen.ts fix(electron): restore macOS lock screen by correcting osascript quoting 2026-04-16 19:47:52 +02:00
main-window.ts fix(electron): restore custom title bar on GNOME-X11 (#8483) (#8485) 2026-06-19 12:42:44 +02:00
main.ts fix(electron): improve protocol URL handling and register URL scheme on Linux 2026-03-05 16:45:05 +01:00
navigation-guard.test.cjs fix(electron): lock in-window navigation to the app's loaded origin (#8230) 2026-06-09 22:34:15 +02:00
navigation-guard.ts fix(electron): lock in-window navigation to the app's loaded origin (#8230) 2026-06-09 22:34:15 +02:00
plugin-node-consent-store.test.cjs feat(plugins): persist nodeExecution consent per plugin (#8512) (#8600) 2026-06-29 16:12:00 +02:00
plugin-node-consent-store.ts feat(plugins): persist nodeExecution consent per plugin (#8512) (#8600) 2026-06-29 16:12:00 +02:00
plugin-node-executor.test.cjs feat(plugins): persist nodeExecution consent per plugin (#8512) (#8600) 2026-06-29 16:12:00 +02:00
plugin-node-executor.ts feat(plugins): persist nodeExecution consent per plugin (#8512) (#8600) 2026-06-29 16:12:00 +02:00
plugin-oauth.ts feat(plugins): generic OAuth hooks for issue-provider plugins (#8546) 2026-06-30 14:11:00 +02:00
preload.ts feat(plugins): generic OAuth hooks for issue-provider plugins (#8546) 2026-06-30 14:11:00 +02:00
protocol-handler.ts feat(sync): add OneDrive sync provider with PKCE auth (#7523) 2026-05-26 15:31:06 +02:00
proxy-agent.test.cjs fix(jira): honor no_proxy for electron requests #6324 (#8177) 2026-06-09 15:00:43 +02:00
proxy-agent.ts fix(jira): honor no_proxy for electron requests #6324 (#8177) 2026-06-09 15:00:43 +02:00
shared-state.ts fix: refactor tray handling to use shared state for task and countdown visibility 2025-11-28 18:53:00 +01:00
simple-store.test.cjs fix(electron): harden simple store writes (#7297) 2026-04-21 15:03:30 +02:00
simple-store.ts fix(electron): harden simple store writes (#7297) 2026-04-21 15:03:30 +02:00
start-app.ts fix(electron): use display name for Linux notifications (#8640) 2026-06-30 14:01:01 +02:00
sync-path-resolver.test.cjs feat(electron): add sync-path-resolver for renderer-supplied paths 2026-06-09 22:23:47 +02:00
sync-path-resolver.ts feat(electron): add sync-path-resolver for renderer-supplied paths 2026-06-09 22:23:47 +02:00
task-widget.test.cjs Feat/task widget global shortcut (#7099) 2026-06-09 16:11:16 +02:00
tsconfig.electron.json fix(keyboard): resolve macOS global shortcut layout mismatch (#8378) (#8381) 2026-06-17 12:57:47 +02:00
various-shared.ts Feat/task widget global shortcut (#7099) 2026-06-09 16:11:16 +02:00