feat: harden secret unlock and deletion

This commit is contained in:
2026-06-29 21:42:10 +08:00
parent 63c2c1314f
commit 4bb9e84c35
7 changed files with 180 additions and 43 deletions
@@ -293,6 +293,15 @@ export function createPluginAPI(pluginId) {
return App.PluginSecretsWrite(pluginId, record || {});
});
},
delete: function(secretId) {
assertActive('secrets.delete(' + secretId + ')');
if (!secretId) {
throw new Error('secrets.delete requires a secret id');
}
return callBackendErrorString(pluginId, 'secrets.delete(' + secretId + ')', function() {
return App.PluginSecretsDelete(pluginId, secretId);
});
},
copyLink: function(secretId) {
assertActive('secrets.copyLink(' + secretId + ')');
if (!secretId) {