diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-09-28 06:45:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-28 06:45:04 +0200 |
| commit | 910247d4099f3a3fe9339c93926a21e9da93b226 (patch) | |
| tree | 26b6a2a8a5bf74405288f82fc2e0304975b82f31 /python | |
| parent | 3ceed1f90dd29640d6bad00039e2e59ff527e437 (diff) | |
| parent | 6a7558e586cfa91823512681e12944b065754774 (diff) | |
| download | vyos-1x-910247d4099f3a3fe9339c93926a21e9da93b226.tar.gz vyos-1x-910247d4099f3a3fe9339c93926a21e9da93b226.zip | |
Merge pull request #5505 from c-po/accel-ppp-any-login
accel-ppp: T9357: do not require local users when any-login is configured
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/accel_ppp_util.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/python/vyos/accel_ppp_util.py b/python/vyos/accel_ppp_util.py index 844bc56e5..c70f3b017 100644 --- a/python/vyos/accel_ppp_util.py +++ b/python/vyos/accel_ppp_util.py @@ -130,19 +130,23 @@ def verify_accel_ppp_authentication(config, local_users=True): Common helper function which must be used by all Accel-PPP services based on get_config_dict() """ + # "any-login" accepts every username/password combination, thus there is + # no need to have any local user account configured at all + any_login = False + if 'authentication' in config and 'any_login' in config['authentication']: + any_login = True + # verify auth settings if local_users and dict_search("authentication.mode", config) == "local": - if ( - dict_search("authentication.local_users", config) is None - or dict_search("authentication.local_users", config) == {} - ): + local_users_config = dict_search('authentication.local_users.username', + config, default={}) + + if not local_users_config and not any_login: raise ConfigError( "Authentication mode local requires local users to be configured!" ) - for user in dict_search("authentication.local_users.username", config): - user_config = config["authentication"]["local_users"]["username"][user] - + for user, user_config in local_users_config.items(): if "password" not in user_config: raise ConfigError(f'Password required for local user "{user}"') |
