Draft
Conversation
Contributor
Greptile SummaryAdds a secrets API that allows plugins to securely store and retrieve encrypted key-value pairs using Critical Issues Found:
Confidence Score: 1/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Plugin as Plugin Code
participant PC as PluginContext.js
participant Cordova as Cordova Bridge
participant Tee as Tee.java
participant EPM as EncryptedPreferenceManager
Note over Plugin,EPM: Set Secret Flow
Plugin->>PC: setSecret(token, key, value)
PC->>Cordova: exec("Tee", "set_secret", [token, key, value])
Cordova->>Tee: execute("set_secret", args)
Tee->>Tee: getPluginIdFromToken(token)
Tee->>EPM: new EncryptedPreferenceManager(context, pluginId)
Tee->>EPM: setString(key, value)
EPM-->>Tee: encrypted and stored
Tee-->>Cordova: success callback
Cordova-->>PC: resolve()
PC-->>Plugin: Promise resolved
Note over Plugin,EPM: Get Secret Flow
Plugin->>PC: getSecret(token, key, defaultValue)
PC->>Cordova: exec("Tee", "get_secret", [token, key, defaultValue])
Cordova->>Tee: execute("get_secret", args)
Tee->>Tee: getPluginIdFromToken(token)
Tee->>EPM: new EncryptedPreferenceManager(context, pluginId)
Tee->>EPM: getString(key, defaultValue)
EPM-->>Tee: decrypted value
Tee-->>Cordova: success callback with value
Cordova-->>PC: resolve(value)
PC-->>Plugin: Promise resolved with value
Last reviewed commit: a51e038 |
|
|
||
|
|
||
|
|
||
| private Context context; |
Contributor
There was a problem hiding this comment.
missing import for Context
Suggested change
| private Context context; | |
| import android.content.Context; | |
| import org.apache.cordova.CordovaInterface; | |
| import org.apache.cordova.CordovaWebView; |
Add these imports after line 16 (after the java.util imports)
Comment on lines
+38
to
+48
| getSecret(token, key, defaultValue = "") { | ||
| return new Promise((resolve, reject) => { | ||
| exec( | ||
| resolve, | ||
| reject, | ||
| "Tee", | ||
| "get_secret", | ||
| [token, key, defaultValue] | ||
| ); | ||
| }); | ||
| } |
Contributor
There was a problem hiding this comment.
token parameter is redundant - should use this.uuid like other methods
Suggested change
| getSecret(token, key, defaultValue = "") { | |
| return new Promise((resolve, reject) => { | |
| exec( | |
| resolve, | |
| reject, | |
| "Tee", | |
| "get_secret", | |
| [token, key, defaultValue] | |
| ); | |
| }); | |
| } | |
| getSecret(key, defaultValue = "") { | |
| return new Promise((resolve, reject) => { | |
| exec( | |
| resolve, | |
| reject, | |
| "Tee", | |
| "get_secret", | |
| [this.uuid, key, defaultValue] | |
| ); | |
| }); | |
| } |
Comment on lines
+51
to
+61
| setSecret(token, key, value) { | ||
| return new Promise((resolve, reject) => { | ||
| exec( | ||
| resolve, | ||
| reject, | ||
| "Tee", | ||
| "set_secret", | ||
| [token, key, value] | ||
| ); | ||
| }); | ||
| } |
Contributor
There was a problem hiding this comment.
token parameter is redundant - should use this.uuid like other methods
Suggested change
| setSecret(token, key, value) { | |
| return new Promise((resolve, reject) => { | |
| exec( | |
| resolve, | |
| reject, | |
| "Tee", | |
| "set_secret", | |
| [token, key, value] | |
| ); | |
| }); | |
| } | |
| setSecret(key, value) { | |
| return new Promise((resolve, reject) => { | |
| exec( | |
| resolve, | |
| reject, | |
| "Tee", | |
| "set_secret", | |
| [this.uuid, key, value] | |
| ); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.