Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[change] OpenWrt: updated WPA enterprise settings #291 #292

Merged
merged 3 commits into from
Mar 20, 2024

Conversation

pandafy
Copy link
Member

@pandafy pandafy commented Jan 24, 2024

  • Generate "auth_sever", "auth_port" and "auth_secret" options from "server", "port" and "key" properties
  • Set "acct_secret" to the value of "key" if it is not configured in NetJSON
  • Add new options: "acct_inverval", "dae_client", "dae_port", "dae_secret"

Closes #291

@pandafy pandafy force-pushed the issues/291-wpa-enterprise branch from c45cf89 to 0c83f93 Compare January 24, 2024 15:08
@coveralls
Copy link

coveralls commented Jan 24, 2024

Coverage Status

coverage: 98.723% (-0.005%) from 98.728%
when pulling e0049b6 on issues/291-wpa-enterprise
into 571af14 on master.

- Generate "auth_sever", "auth_port" and "auth_secret" options
  from "server", "port" and "key" properties
- Set "acct_secret" to the value of "key" if it is not configured
  in NetJSON
- Add new options: "acct_inverval", "dae_client", "dae_port", "dae_secret"

Closes #291
@pandafy pandafy force-pushed the issues/291-wpa-enterprise branch from 0c83f93 to 91d8e8d Compare January 24, 2024 15:21
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I want to get a chance to review the code a bit more before merging.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, see my comment below.

@@ -368,6 +383,9 @@ def test_render_wpa3_enterprise(self):

def test_parse_wpa3_enterprise(self):
o = OpenWrt(native=self._wpa3_enterprise_ap_uci)
from pprint import pprint

pprint(dict(o.config))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems a leftover

for option in ['server', 'port']:
if f'auth_{option}' in settings:
settings[option] = settings.pop(f'auth_{option}')
if settings.get('acct_port'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not if 'acct_port' in settings? Why using get here? Is it on purpose?

uci['auth_secret'] = encryption['key']
if not encryption.get('acct_secret'):
uci['acct_secret'] = encryption['key']
if encryption.get('acct_server_port'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

if option in encryption:
uci[f'auth_{option}'] = encryption[option]
uci['auth_secret'] = encryption['key']
if not encryption.get('acct_secret'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@nemesifier nemesifier merged commit 8396e4f into master Mar 20, 2024
6 checks passed
@nemesifier nemesifier deleted the issues/291-wpa-enterprise branch March 20, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[change] OpenWrt: update WPA enterprise settings
3 participants