part of #288.
the .ovpn parser in core/ovpn_parser/parser.rs doesn't handle the auth-user-pass directive. this is one of the most common directives in real-world .ovpn files — it tells the client that the server requires username/password authentication.
because of this, TryFrom<OvpnFile> for OpenVpnConfig always sets auth_type: None, so imported configs don't know whether password auth is required. a user importing a .ovpn file that has auth-user-pass will get a config that doesn't prompt for or include credentials.
changes
- add
auth_user_pass: bool field to OvpnFile
- parse
auth-user-pass directive in the lexer/parser (with optional file path argument, which we can ignore for now — NM handles interactive prompts)
- in
TryFrom<OvpnFile>, infer auth_type from the combination of auth_user_pass and cert presence:
auth_user_pass + certs → PasswordTls
auth_user_pass + no certs → Password
- no
auth_user_pass + certs → Tls
- neither →
None (same as today)
tests
- parser test for
auth-user-pass (bare and with file path)
TryFrom test confirming auth_type inference
part of #288.
the
.ovpnparser incore/ovpn_parser/parser.rsdoesn't handle theauth-user-passdirective. this is one of the most common directives in real-world.ovpnfiles — it tells the client that the server requires username/password authentication.because of this,
TryFrom<OvpnFile> for OpenVpnConfigalways setsauth_type: None, so imported configs don't know whether password auth is required. a user importing a.ovpnfile that hasauth-user-passwill get a config that doesn't prompt for or include credentials.changes
auth_user_pass: boolfield toOvpnFileauth-user-passdirective in the lexer/parser (with optional file path argument, which we can ignore for now — NM handles interactive prompts)TryFrom<OvpnFile>, inferauth_typefrom the combination ofauth_user_passand cert presence:auth_user_pass+ certs →PasswordTlsauth_user_pass+ no certs →Passwordauth_user_pass+ certs →TlsNone(same as today)tests
auth-user-pass(bare and with file path)TryFromtest confirming auth_type inference