Skip to content

Firewall: Allow any zone as valid input for is_zone function - #85

Merged
gsanchietti merged 4 commits into
mainfrom
sdl-fix_inactive_zone
Jan 10, 2025
Merged

Firewall: Allow any zone as valid input for is_zone function#85
gsanchietti merged 4 commits into
mainfrom
sdl-fix_inactive_zone

Conversation

@stephdl

@stephdl stephdl commented Jan 10, 2025

Copy link
Copy Markdown
Contributor

Update the is_zone function to recognize '*' as a valid zone name, enhancing its flexibility in zone validation.

NethServer/nethsecurity#1012

@stephdl
stephdl force-pushed the sdl-fix_inactive_zone branch from 758ea41 to 6e935e2 Compare January 10, 2025 11:01
@stephdl
stephdl requested a review from gsanchietti January 10, 2025 11:02
Comment thread src/nethsec/firewall/__init__.py Outdated
Comment on lines +1194 to +1196
# True zone if name is 'any' zone name -> '*'
elif name == '*':
return True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should not be inside the loop. It's enough to check it once at beginning of the function.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please also add the tests for this function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

tests done, we wheck is active_zone is set in the rule list and we check some fex example of ulr True or False

@gsanchietti
gsanchietti merged commit 9b519f4 into main Jan 10, 2025
@gsanchietti
gsanchietti deleted the sdl-fix_inactive_zone branch January 10, 2025 13:19
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.

2 participants