#[non_exhaustive]pub enum UntrustedRefusal {
Show 19 variants
NotAllowed {
builtin: Option<BuiltinServer>,
},
WorkspaceExecutable {
executable: PathBuf,
},
UnresolvedExecutable {
command: ServerCommand,
},
AutoSelectionTarget {
executable: ServerCommand,
cause: InvalidAutoSelection,
},
WorkspaceHome {
variable: HomeVariable,
home: PathBuf,
},
EmptyHome {
variable: HomeVariable,
},
UnknownHome,
WorkspaceTsserver {
tsserver: PathBuf,
},
ProjectLauncher {
command: ServerCommand,
cause: LauncherRefusal,
},
WorkspaceExecutableArgument {
index: usize,
executable: PathBuf,
},
UnreadableWorkspaceArgument {
index: usize,
path: PathBuf,
},
UnresolvedWrappedProgram {
program: EchoedPath,
},
WrappedProgramPathContainsEquals {
program: EchoedPath,
},
UnpinnedTypescriptLauncher {
command: ServerCommand,
},
NonUtf8Path {
what: ResolvedItem,
path: PathBuf,
},
BlankResolvedPath {
what: ResolvedItem,
},
NulInResolvedPath {
what: ResolvedItem,
},
NoSafeWorkingDirectory,
EnvTooLarge {
error: EnvTooLarge,
},
}Expand description
Why untrusted-workspace mode refused to start a server.
§Examples
use mcpls_core::config::BuiltinServer;
use mcpls_core::error::UntrustedRefusal;
let refusal = UntrustedRefusal::NotAllowed {
builtin: Some(BuiltinServer::RustAnalyzer),
};
assert!(refusal.to_string().contains("Cargo build scripts"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotAllowed
The server was not named with --allow-server.
Fields
builtin: Option<BuiltinServer>The built-in server this is, whose workspace-code class is named
in the message; None for a custom server.
WorkspaceExecutable
The server’s executable lies inside the workspace. Naming the server does not consent to running a binary the workspace supplies.
UnresolvedExecutable
The executable was not found on a search path outside the workspace, so untrusted mode cannot tell what would run.
Fields
command: ServerCommandThe configured command.
AutoSelectionTarget
The auto-selected TypeScript command resolved to an executable that is
not typescript-language-server (a PATH entry symlinked to another
program), so it cannot be hardened without dropping the tsserver pin.
Fields
executable: ServerCommandThe resolved executable the command would have been replaced with.
cause: InvalidAutoSelectionWhy the selection cannot follow the resolved executable.
WorkspaceHome
The login home directory is unknown and the inherited HOME lies
inside the workspace, where rustup, cargo and npm would read their
configuration from.
Fields
variable: HomeVariableThe variable that names the home directory.
EmptyHome
The login home directory is unknown and a home variable is empty, so tools resolve it against the working directory, which is the checkout.
Fields
variable: HomeVariableThe variable that is empty.
UnknownHome
The login home directory is unknown and HOME is not set, so tools
would resolve ~ against the working directory, which is the
checkout.
WorkspaceTsserver
The tsserver the TypeScript server would use lies inside the workspace.
ProjectLauncher
The configured command is a launcher that chooses the server from files in the workspace (a package runner, task runner or toolchain wrapper), so what would run is under the workspace’s control.
Fields
command: ServerCommandThe configured command.
cause: LauncherRefusalWhat about the launch the analysis refused.
WorkspaceExecutableArgument
An argument of the configured command names an executable file inside the workspace, which whatever launcher precedes it would start.
Fields
UnreadableWorkspaceArgument
An argument of the configured command lies inside the workspace and cannot be read, so untrusted mode cannot tell whether it is an executable.
Fields
UnresolvedWrappedProgram
A program an exec wrapper or env starts was not found on a search
path outside the workspace, so untrusted mode cannot tell what would
run.
Fields
program: EchoedPathThe wrapped program, as configured.
WrappedProgramPathContainsEquals
The vetted path of a program that env starts contains =, which
env would read as an assignment, so it cannot be passed on unchanged.
Fields
program: EchoedPathThe wrapped program, as configured.
UnpinnedTypescriptLauncher
The configured command starts the TypeScript server through a launcher that untrusted mode cannot pin to a binary outside the workspace.
Fields
command: ServerCommandThe configured command.
NonUtf8Path
A resolved path is not valid UTF-8, so untrusted mode cannot pass it on unchanged.
BlankResolvedPath
A resolved path is blank, so there is nothing to start.
Fields
what: ResolvedItemWhat the path belongs to.
NulInResolvedPath
A resolved path contains a NUL, which the operating system cannot pass in a path or environment variable.
Fields
what: ResolvedItemWhat the path belongs to.
NoSafeWorkingDirectory
No directory outside the workspace is available for the server to start in.
EnvTooLarge
The variables untrusted mode sets for the server do not fit in its
env table.
Fields
error: EnvTooLargeWhich limit the table would be over.
Trait Implementations§
Source§impl Clone for UntrustedRefusal
impl Clone for UntrustedRefusal
Source§impl Debug for UntrustedRefusal
impl Debug for UntrustedRefusal
Source§impl Display for UntrustedRefusal
impl Display for UntrustedRefusal
impl Eq for UntrustedRefusal
Source§impl PartialEq for UntrustedRefusal
impl PartialEq for UntrustedRefusal
impl StructuralPartialEq for UntrustedRefusal
Auto Trait Implementations§
impl Freeze for UntrustedRefusal
impl RefUnwindSafe for UntrustedRefusal
impl Send for UntrustedRefusal
impl Sync for UntrustedRefusal
impl Unpin for UntrustedRefusal
impl UnsafeUnpin for UntrustedRefusal
impl UnwindSafe for UntrustedRefusal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.