Skip to content

feat: improved pluginContext - #2806

Open
RohitKushvaha01 wants to merge 3 commits into
Acode-Foundation:mainfrom
RohitKushvaha01:feat/plugin-context-secrets
Open

feat: improved pluginContext#2806
RohitKushvaha01 wants to merge 3 commits into
Acode-Foundation:mainfrom
RohitKushvaha01:feat/plugin-context-secrets

Conversation

@RohitKushvaha01

@RohitKushvaha01 RohitKushvaha01 commented Aug 25, 2026

Copy link
Copy Markdown
Member

Closes #2804

TOKEN_ALREADY_ISSUED will no longer happen and a valid context is always asigned to plugins regardless of the plugin state

@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR replaces the globally exposed plugin-context module with an app-owned context generator backed by a trusted native session.

  • Establishes the native session before loading plugin scripts.
  • Adds secure token generation, validation, invalidation, and secret-deletion operations.
  • Restores the existing empty-string default for missing secrets.
  • Removes the Cordova JavaScript clobber and updates the dependency lockfile.

Confidence Score: 5/5

The PR appears safe to merge because the previously reported missing-secret regression is fixed and no blocking failure remains.

No blocking failure remains; getSecret now defaults absent values to an empty string rather than passing null through the native bridge.

Important Files Changed

Filename Overview
src/lib/loadPlugin.js Establishes the trusted native connection before loading plugin code and generates the context through the new app-owned module.
src/lib/pluginContext.js Implements plugin context operations and preserves an empty-string default when a requested secret is absent.
src/plugins/pluginContext/src/android/Tee.java Adds session-gated token issuance, cryptographically generated secrets, token invalidation, and secret deletion operations.
src/plugins/pluginContext/plugin.xml Removes the globally clobbered JavaScript plugin-context API.
package-lock.json Refreshes the resolved dependency graph without changing the plugin-context runtime contract.

Sequence Diagram

sequenceDiagram
  participant Loader as Plugin loader
  participant Tee as Native Tee service
  participant Script as Plugin script
  Loader->>Tee: establishConnection
  Tee-->>Loader: trusted session
  Loader->>Script: load main.js
  Loader->>Tee: requestToken(session, pluginId, manifest)
  Tee-->>Loader: plugin-scoped token
  Loader-->>Script: initialize with PluginContext
Loading

Reviews (2): Last reviewed commit: "format" | Re-trigger Greptile

Comment thread src/lib/pluginContext.js Outdated
RohitKushvaha01 and others added 2 commits August 25, 2026 12:23
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@RohitKushvaha01

Copy link
Copy Markdown
Member Author

@greptileai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Fix: Token already issued error

1 participant