Skip to content

feat: improved pluginContext - #2806

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

feat: improved pluginContext#2806
RohitKushvaha01 wants to merge 6 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 moves plugin-context creation into a private application module and establishes a trusted native session before plugin scripts execute.

  • Gates token issuance on a securely generated loader session.
  • Adds token invalidation and plugin-scoped secret deletion and clearing.
  • Restores the omitted getSecret default to an empty string, resolving the previously reported "null" result.
  • Removes the globally clobbered Cordova plugin-context module.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/lib/pluginContext.js Encapsulates the trusted session and plugin token while restoring the empty-string default for missing secrets.
src/lib/loadPlugin.js Establishes the trusted session before loading plugin scripts and supplies the generated context during initialization.
src/plugins/pluginContext/src/android/Tee.java Gates token issuance by session, strengthens token generation and comparison, and adds scoped secret-management operations.
src/plugins/pluginContext/plugin.xml Removes the global JavaScript clobber now that plugin-context access is application-internal.
src/plugins/pluginContext/www/PluginContext.js Deletes the formerly global bridge wrapper in favor of the internal module.
package-lock.json Regenerates the dependency lockfile without establishing a blocking dependency regression.

Sequence Diagram

sequenceDiagram
  participant Loader as Plugin loader
  participant Bridge as Cordova bridge
  participant Native as Tee native service
  participant Plugin as Plugin script
  Loader->>Native: establishConnection()
  Native-->>Loader: trusted session
  Loader->>Native: requestToken(session, pluginId, manifest)
  Native-->>Loader: plugin-scoped token
  Loader->>Plugin: initialize with PluginContext
  Plugin->>Native: secret/permission action(token)
  Native-->>Plugin: scoped result
Loading

Reviews (3): Last reviewed commit: "." | 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

@RohitKushvaha01

Copy link
Copy Markdown
Member Author

@greptile

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