pub fn resolve_auth_mode(settings: &Settings) -> AuthModeExpand description
What: Resolve the effective authentication mode from settings.
Inputs:
settings: Reference to the application settings.
Output:
- The resolved
AuthModeto use for privilege escalation.
Details:
- If
auth_modeis explicitly set to something other than the default (Prompt), it takes precedence. - If
auth_modeisPrompt(the default) and the legacyuse_passwordless_sudoistrue, maps toPasswordlessOnlyfor backward compatibility and logs a deprecation warning. - When both
auth_mode != Promptanduse_passwordless_sudo = trueare set,auth_modewins and a deprecation warning is logged.