Skip to main content

apply_identity

Function apply_identity 

Source
pub fn apply_identity(
    env: &mut EnvSnapshot,
    settings: &mut Settings,
    id: &Identity,
) -> Vec<ToolError>
Expand description

Write the resolved identity into the environment snapshot and, for a File identity, the record’s server_url into the settings: settings.server_url = identity.server_url (a null record means the background service, exactly as an empty OPENCODE_CTL_SERVER does) with the source Env, overriding a user-file value. Env and None identities (a missing or unparsable record yields None) leave the settings untouched. A record URL carrying userinfo is ignored: the settings keep their current value and source, and env.server is cleared.