extension_host: Add capability for downloading files (#35141)
This PR adds a new capability for downloading files in extensions. Currently all file downloads are allowed. Release Notes: - N/A
This commit is contained in:
parent
d7b403e981
commit
6a9a539b10
6 changed files with 165 additions and 12 deletions
|
@ -7,9 +7,9 @@ use async_trait::async_trait;
|
|||
use dap::{DebugRequest, StartDebuggingRequestArgumentsRequest};
|
||||
use extension::{
|
||||
CodeLabel, Command, Completion, ContextServerConfiguration, DebugAdapterBinary,
|
||||
DebugTaskDefinition, ExtensionCapability, ExtensionHostProxy, KeyValueStoreDelegate,
|
||||
ProcessExecCapability, ProjectDelegate, SlashCommand, SlashCommandArgumentCompletion,
|
||||
SlashCommandOutput, Symbol, WorktreeDelegate,
|
||||
DebugTaskDefinition, DownloadFileCapability, ExtensionCapability, ExtensionHostProxy,
|
||||
KeyValueStoreDelegate, ProcessExecCapability, ProjectDelegate, SlashCommand,
|
||||
SlashCommandArgumentCompletion, SlashCommandOutput, Symbol, WorktreeDelegate,
|
||||
};
|
||||
use fs::{Fs, normalize_path};
|
||||
use futures::future::LocalBoxFuture;
|
||||
|
@ -576,10 +576,16 @@ impl WasmHost {
|
|||
node_runtime,
|
||||
proxy,
|
||||
release_channel: ReleaseChannel::global(cx),
|
||||
granted_capabilities: vec![ExtensionCapability::ProcessExec(ProcessExecCapability {
|
||||
command: "*".to_string(),
|
||||
args: vec!["**".to_string()],
|
||||
})],
|
||||
granted_capabilities: vec![
|
||||
ExtensionCapability::ProcessExec(ProcessExecCapability {
|
||||
command: "*".to_string(),
|
||||
args: vec!["**".to_string()],
|
||||
}),
|
||||
ExtensionCapability::DownloadFile(DownloadFileCapability {
|
||||
host: "*".to_string(),
|
||||
path: vec!["**".to_string()],
|
||||
}),
|
||||
],
|
||||
_main_thread_message_task: task,
|
||||
main_thread_message_tx: tx,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue