mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 09:08:32 +02:00
Fix secure() function editing
This commit is contained in:
@@ -30,7 +30,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"createUpdaterArtifacts": "v1Compatible",
|
"createUpdaterArtifacts": true,
|
||||||
"windows": {
|
"windows": {
|
||||||
"signCommand": "trusted-signing-cli -e https://eus.codesigning.azure.net/ -a Yaak -c yaakapp %1"
|
"signCommand": "trusted-signing-cli -e https://eus.codesigning.azure.net/ -a Yaak -c yaakapp %1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -503,10 +503,22 @@ impl PluginManager {
|
|||||||
.iter()
|
.iter()
|
||||||
.find(|r| r.functions.iter().any(|f| f.name == fn_name))
|
.find(|r| r.functions.iter().any(|f| f.name == fn_name))
|
||||||
.ok_or_else(|| PluginNotFoundErr(fn_name.into()))?;
|
.ok_or_else(|| PluginNotFoundErr(fn_name.into()))?;
|
||||||
let plugin = self
|
|
||||||
.get_plugin_by_ref_id(&r.plugin_ref_id)
|
let plugin = match self.get_plugin_by_ref_id(&r.plugin_ref_id).await {
|
||||||
.await
|
None => {
|
||||||
.ok_or_else(|| PluginNotFoundErr(r.plugin_ref_id.clone()))?;
|
// It's probably a native function, so just fallback to the summary
|
||||||
|
let function = r
|
||||||
|
.functions
|
||||||
|
.iter()
|
||||||
|
.find(|f| f.name == fn_name)
|
||||||
|
.ok_or_else(|| PluginNotFoundErr(fn_name.into()))?;
|
||||||
|
return Ok(GetTemplateFunctionConfigResponse {
|
||||||
|
function: function.clone(),
|
||||||
|
plugin_ref_id: r.plugin_ref_id.clone(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Some(v) => v,
|
||||||
|
};
|
||||||
|
|
||||||
let window_context = &PluginWindowContext::new(&window);
|
let window_context = &PluginWindowContext::new(&window);
|
||||||
let vars = &make_vars_hashmap(environment_chain);
|
let vars = &make_vars_hashmap(environment_chain);
|
||||||
|
|||||||
@@ -78,6 +78,10 @@ pub fn template_function_secure_run<R: Runtime>(
|
|||||||
_ => return Ok("".to_string()),
|
_ => return Ok("".to_string()),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if value.is_empty() {
|
||||||
|
return Ok("".to_string());
|
||||||
|
}
|
||||||
|
|
||||||
let value = match value.strip_prefix("YENC_") {
|
let value = match value.strip_prefix("YENC_") {
|
||||||
None => {
|
None => {
|
||||||
return Err(RenderError("Could not decrypt non-encrypted value".to_string()));
|
return Err(RenderError("Could not decrypt non-encrypted value".to_string()));
|
||||||
|
|||||||
Reference in New Issue
Block a user