Skip to main content

check_protocol_allowed_with

Function check_protocol_allowed_with 

Source
pub fn check_protocol_allowed_with(
    protocol: &str,
    inputs: &ProtocolPolicyInputs,
) -> Result<(), ProtocolError>
Expand description

Check whether a given protocol (e.g. file, git, ssh, https) is allowed.

Rules match Git’s transport.c / is_transport_allowed:

  1. GIT_ALLOW_PROTOCOL is a colon- or comma-separated whitelist.
  2. protocol.<name>.allow overrides the blanket config.
  3. protocol.allow supplies a blanket default.
  4. Built-in defaults: http, https, git, and ssh are always allowed; ext is never allowed; any other protocol is user.