From 9d3327f353ac13c95d4f2b01f244b13cb0962bfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 03:56:14 +0000 Subject: [PATCH 01/15] Bump pypa/gh-action-pypi-publish from 1.8.14 to 1.9.0 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.14 to 1.9.0. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/81e9d935c883d0b210363ab89cf05f3894778450...ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index aecc5c44..f65d718c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -34,7 +34,7 @@ jobs: - name: Build package run: python -m build - name: Publish package - uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 + uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} From 4d91c8c7aaa38f629e453cc1f9cb2fb14d218483 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 03:34:55 +0000 Subject: [PATCH 02/15] Bump pypa/gh-action-pypi-publish from 1.9.0 to 1.10.0 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0...8a08d616893759ef8e1aa1f2785787c0b97e20d6) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index f65d718c..ba51fe16 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -34,7 +34,7 @@ jobs: - name: Build package run: python -m build - name: Publish package - uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 + uses: pypa/gh-action-pypi-publish@8a08d616893759ef8e1aa1f2785787c0b97e20d6 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} From 1f8f1bc3d137978f93e6cc32fb66809ab27f2a4d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 03:34:57 +0000 Subject: [PATCH 03/15] Bump github/super-linter from 6 to 7 Bumps [github/super-linter](https://github.com/github/super-linter) from 6 to 7. - [Release notes](https://github.com/github/super-linter/releases) - [Changelog](https://github.com/github/super-linter/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/super-linter/compare/v6...v7) --- updated-dependencies: - dependency-name: github/super-linter dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7907cd0d..a6bb4c4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: fetch-depth: 0 - name: Lint Code Base - uses: github/super-linter/slim@v6 + uses: github/super-linter/slim@v7 env: DEFAULT_BRANCH: dev GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 38e8f98d2f6506faf5c052055822bd91690c7d01 Mon Sep 17 00:00:00 2001 From: Chris Russell Date: Mon, 9 Sep 2024 01:51:40 +0100 Subject: [PATCH 04/15] Update README.md Specifically State 1.6.1 as 4.0.x compatible only --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 34ef9938..fc795e0d 100644 --- a/README.md +++ b/README.md @@ -37,14 +37,14 @@ See the [CONTRIBUTING](CONTRIBUTING.md) for more information. Each Plugin Version listed below has been tested with its corresponding NetBox Version. | NetBox Version | Plugin Version | -|:--------------:|:--------------:| -| >= 4.0.2 | 1.6.1 | -| 3.7 | 1.5.0 | -| 3.6 | 1.4.0 | -| 3.5 | 1.3.0 | -| 3.4 | 1.2.2 | -| 3.3 | 1.1.0 | -| 3.2 | 1.0.1 | +|:-------------------:|:--------------:| +| >= 4.0.2 < 4.1.0 | 1.6.1 | +| 3.7 | 1.5.0 | +| 3.6 | 1.4.0 | +| 3.5 | 1.3.0 | +| 3.4 | 1.2.2 | +| 3.3 | 1.1.0 | +| 3.2 | 1.0.1 | ## Installing From ebc4a8a05359e833eb637808fa5aabec14dcf491 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 03:26:45 +0000 Subject: [PATCH 05/15] Bump pypa/gh-action-pypi-publish from 1.10.0 to 1.10.1 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.10.0 to 1.10.1. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/8a08d616893759ef8e1aa1f2785787c0b97e20d6...0ab0b79471669eb3a4d647e625009c62f9f3b241) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index ba51fe16..2b082ba0 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -34,7 +34,7 @@ jobs: - name: Build package run: python -m build - name: Publish package - uses: pypa/gh-action-pypi-publish@8a08d616893759ef8e1aa1f2785787c0b97e20d6 + uses: pypa/gh-action-pypi-publish@0ab0b79471669eb3a4d647e625009c62f9f3b241 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} From 79b7756716ea45dbcb22ce52925fb065ad46e7e7 Mon Sep 17 00:00:00 2001 From: Chris Russell Date: Thu, 19 Sep 2024 20:05:43 +0100 Subject: [PATCH 06/15] Closes #212 and Fixes #210 --- netbox_acls/graphql/__init__.py | 4 +--- netbox_acls/graphql/schema.py | 30 +++++++++--------------------- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/netbox_acls/graphql/__init__.py b/netbox_acls/graphql/__init__.py index f778a806..8e9089c1 100644 --- a/netbox_acls/graphql/__init__.py +++ b/netbox_acls/graphql/__init__.py @@ -2,8 +2,6 @@ from .types import * schema = [ - schema.NetBoxACLSAccessListQuery, - schema.NetBoxACLSStandardRuleQuery, - schema.NetBoxACLSACLExtendedRuleQuery + schema.NetBoxACLSQuery ] diff --git a/netbox_acls/graphql/schema.py b/netbox_acls/graphql/schema.py index 94b707d5..27d7e9e7 100644 --- a/netbox_acls/graphql/schema.py +++ b/netbox_acls/graphql/schema.py @@ -2,31 +2,19 @@ import strawberry_django from .types import * from ..models import * +from typing import List -@strawberry.type -class NetBoxACLSAccessListQuery: +@strawberry.type(name="Query") +class NetBoxACLSQuery: """ Defines the queries available to this plugin via the graphql api. """ - @strawberry.field - def access_list(self, id: int) -> AccessListType: - return AccessList.objects.get(pk=id) - access_list_list: list[AccessListType] = strawberry_django.field() + access_list: AccessListType = strawberry_django.field() + access_list_list: List[AccessListType] = strawberry_django.field() -@strawberry.type -class NetBoxACLSACLExtendedRuleQuery: - @strawberry.field - def acl_extended_rule(self, id: int) -> ACLExtendedRuleType: - return ACLExtendedRule.objects.get(pk=id) - acl_extended_rule_list: list[ACLExtendedRuleType] = strawberry_django.field() - - - -@strawberry.type -class NetBoxACLSStandardRuleQuery: - @strawberry.field - def acl_standard_rule(self, id: int) -> ACLStandardRuleType: - return ACLStandardRule.objects.get(pk=id) - acl_standard_rule_list: list[ACLStandardRuleType] = strawberry_django.field() + acl_extended_rule: ACLExtendedRuleType = strawberry_django.field() + acl_extended_rule_list: List[ACLExtendedRuleType] = strawberry_django.field() + acl_standard_rule: ACLStandardRuleType = strawberry_django.field() + acl_standard_rule_list: List[ACLStandardRuleType] = strawberry_django.field() From 25c8eebb213a0e7c17e07352d7c464c2e924a9bb Mon Sep 17 00:00:00 2001 From: Chris Russell Date: Thu, 19 Sep 2024 20:31:15 +0100 Subject: [PATCH 07/15] Update __init__.py min, max versions --- netbox_acls/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox_acls/__init__.py b/netbox_acls/__init__.py index 6e81b98f..3dc34919 100644 --- a/netbox_acls/__init__.py +++ b/netbox_acls/__init__.py @@ -17,8 +17,8 @@ class NetBoxACLsConfig(PluginConfig): version = __version__ description = "Manage simple ACLs in NetBox" base_url = "access-lists" - min_version = "4.0.2" - max_version = "4.0.99" + min_version = "4.1.0" + max_version = "4.1.20" config = NetBoxACLsConfig From 7c27db634f2c77ce20f97ef480f186aa3e5f7f54 Mon Sep 17 00:00:00 2001 From: Chris Russell Date: Thu, 19 Sep 2024 20:34:27 +0100 Subject: [PATCH 08/15] Update Docker to v4.1 --- Dockerfile | 2 +- docker-compose.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8616db28..b133357b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG NETBOX_VARIANT=v4.0 +ARG NETBOX_VARIANT=v4.1 FROM netboxcommunity/netbox:${NETBOX_VARIANT} diff --git a/docker-compose.yml b/docker-compose.yml index 5ea2ed26..b36e24ff 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,4 @@ --- -version: '3.4' services: netbox: From e157c8bdabbae5202d777a1263f12aa09c0bf28a Mon Sep 17 00:00:00 2001 From: Chris Russell Date: Thu, 19 Sep 2024 20:40:08 +0100 Subject: [PATCH 09/15] Bump Python version in Docker --- Dockerfile | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b133357b..a0abf626 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,4 @@ RUN mkdir -pv /plugins/netbox-acls COPY . /plugins/netbox-acls RUN /opt/netbox/venv/bin/python3 /plugins/netbox-acls/setup.py develop && \ - cp -rf /plugins/netbox-acls/netbox_acls/ /opt/netbox/venv/lib/python3.11/site-packages/netbox_acls + cp -rf /plugins/netbox-acls/netbox_acls/ /opt/netbox/venv/lib/python3.12/site-packages/netbox_acls diff --git a/setup.py b/setup.py index 2ac195b8..60544f8d 100644 --- a/setup.py +++ b/setup.py @@ -54,6 +54,7 @@ def get_version(relative_path): "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Intended Audience :: System Administrators", "Intended Audience :: Telecommunications Industry", "Framework :: Django", From 87fcb9366003d258b99b8d16af797472ee582761 Mon Sep 17 00:00:00 2001 From: Chris Russell Date: Thu, 19 Sep 2024 20:46:09 +0100 Subject: [PATCH 10/15] Change Serializers to nested --- netbox_acls/api/serializers.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/netbox_acls/api/serializers.py b/netbox_acls/api/serializers.py index 3715599c..e2e42531 100644 --- a/netbox_acls/api/serializers.py +++ b/netbox_acls/api/serializers.py @@ -5,10 +5,9 @@ from django.contrib.contenttypes.models import ContentType from drf_spectacular.utils import extend_schema_field -from ipam.api.serializers import NestedPrefixSerializer +from ipam.api.serializers import PrefixSerializer from netbox.api.fields import ContentTypeField from netbox.api.serializers import NetBoxModelSerializer -from netbox.constants import NESTED_SERIALIZER_PREFIX from rest_framework import serializers from utilities.api import get_serializer_for_model @@ -81,10 +80,9 @@ class Meta: def get_assigned_object(self, obj): serializer = get_serializer_for_model( obj.assigned_object, - prefix=NESTED_SERIALIZER_PREFIX, ) context = {"request": self.context["request"]} - return serializer(obj.assigned_object, context=context).data + return serializer(obj.assigned_object, nested=True, context=context).data def validate(self, data): """ @@ -145,11 +143,10 @@ class Meta: @extend_schema_field(serializers.DictField()) def get_assigned_object(self, obj): serializer = get_serializer_for_model( - obj.assigned_object, - prefix=NESTED_SERIALIZER_PREFIX, + obj.assigned_object ) context = {"request": self.context["request"]} - return serializer(obj.assigned_object, context=context).data + return serializer(obj.assigned_object, nested=True, context=context).data def validate(self, data): """ @@ -187,10 +184,11 @@ class ACLStandardRuleSerializer(NetBoxModelSerializer): view_name="plugins-api:netbox_acls-api:aclstandardrule-detail", ) access_list = NestedAccessListSerializer() - source_prefix = NestedPrefixSerializer( + source_prefix = PrefixSerializer( required=False, allow_null=True, default=None, + nested=True ) class Meta: @@ -251,15 +249,17 @@ class ACLExtendedRuleSerializer(NetBoxModelSerializer): view_name="plugins-api:netbox_acls-api:aclextendedrule-detail", ) access_list = NestedAccessListSerializer() - source_prefix = NestedPrefixSerializer( + source_prefix = PrefixSerializer( required=False, allow_null=True, default=None, + nested=True ) - destination_prefix = NestedPrefixSerializer( + destination_prefix = PrefixSerializer( required=False, allow_null=True, default=None, + nested=True ) class Meta: From 4af0917274042371d1a0b4e3443aeaff8381d1dd Mon Sep 17 00:00:00 2001 From: Chris Russell Date: Thu, 19 Sep 2024 21:48:45 +0100 Subject: [PATCH 11/15] Filterset fixes --- netbox_acls/forms/filtersets.py | 40 +++++++++------------------------ netbox_acls/forms/models.py | 40 +++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 47 deletions(-) diff --git a/netbox_acls/forms/filtersets.py b/netbox_acls/forms/filtersets.py index 33ac9fb5..41715ffd 100644 --- a/netbox_acls/forms/filtersets.py +++ b/netbox_acls/forms/filtersets.py @@ -1,12 +1,13 @@ """ Defines each django model's GUI filter/search options. """ - +from django.utils.translation import gettext_lazy as _ from dcim.models import Device, Interface, Region, Site, SiteGroup, VirtualChassis from django import forms from django.utils.translation import gettext as _ from ipam.models import Prefix from netbox.forms import NetBoxModelFilterSetForm +from utilities.forms.rendering import FieldSet from utilities.forms.fields import ( DynamicModelChoiceField, DynamicModelMultipleChoiceField, @@ -90,22 +91,11 @@ class AccessListFilterForm(NetBoxModelFilterSetForm): tag = TagFilterField(model) fieldsets = ( - (None, ("q", "tag")), - ( - "Host Details", - ( - "region", - "site_group", - "site", - "device_id", - "virtual_chassis_id", - "virtual_machine_id", - ), - ), - ("ACL Details", ("type", "default_action")), + FieldSet("region", "site_group", "site", "device_id", "virtual_chassis_id", "virtual_machine_id", name=_("Host Details")), + FieldSet("type", "default_action", name=_('ACL Details')), + FieldSet("q", "tag",name=None) ) - class ACLInterfaceAssignmentFilterForm(NetBoxModelFilterSetForm): """ GUI filter form to search the django AccessList model. @@ -195,12 +185,11 @@ class ACLStandardRuleFilterForm(NetBoxModelFilterSetForm): choices=add_blank_choice(ACLRuleActionChoices), required=False, ) + fieldsets = ( - (None, ("q", "tag")), - ("Rule Details", ("access_list", "action", "source_prefix")), + FieldSet("access_list", "action", "source_prefix", name=_('Rule Details')), + FieldSet("q", "tag",name=None) ) - - class ACLExtendedRuleFilterForm(NetBoxModelFilterSetForm): """ GUI filter form to search the django ACLExtendedRule model. @@ -235,15 +224,6 @@ class ACLExtendedRuleFilterForm(NetBoxModelFilterSetForm): ) fieldsets = ( - (None, ("q", "tag")), - ( - "Rule Details", - ( - "access_list", - "action", - "source_prefix", - "desintation_prefix", - "protocol", - ), - ), + FieldSet("access_list", "action", "source_prefix", "desintation_prefix", "protocol", name=_('Rule Details')), + FieldSet("q", "tag",name=None) ) diff --git a/netbox_acls/forms/models.py b/netbox_acls/forms/models.py index dfba9159..162e63de 100644 --- a/netbox_acls/forms/models.py +++ b/netbox_acls/forms/models.py @@ -1,13 +1,14 @@ """ Defines each django model's GUI form to add or edit objects for each django model. """ - +from django.utils.translation import gettext_lazy as _ from dcim.models import Device, Interface, Region, Site, SiteGroup, VirtualChassis from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError from django.utils.safestring import mark_safe from ipam.models import Prefix from netbox.forms import NetBoxModelForm +from utilities.forms.rendering import FieldSet from utilities.forms.fields import CommentField, DynamicModelChoiceField from virtualization.models import ( Cluster, @@ -134,6 +135,11 @@ class Meta: "comments", "tags", ) + fieldsets = ( + FieldSet('region', 'site_group', 'site', 'virtual_machine', 'virtual_chassis', 'device', name=_('Assignment')), + FieldSet('name', 'type', 'default_action', name=_('Access List')), + FieldSet('comments', 'tags', name=_('')), + ) help_texts = { "default_action": "The default behavior of the ACL.", "name": "The name uniqueness per device is case insensitive.", @@ -313,6 +319,11 @@ class Meta: "comments", "tags", ) + fieldsets = ( + FieldSet('device', 'interface', 'virtual_machine', 'vminterface', name=_('Assignment')), + FieldSet('access_list', 'direction', name=_('Access List Details')), + FieldSet('comments', 'tags', name=_('')), + ) help_texts = { "direction": mark_safe( "*Note: CANNOT assign 2 ACLs to the same interface & direction.", @@ -455,6 +466,13 @@ class Meta: "tags", "description", ) + fieldsets = ( + FieldSet("access_list", "description", "tags", name=_('Access List Details')), + FieldSet("index", "action", "remark", "source_prefix", name=_('Rule Definition')) + ) + + + help_texts = { "index": help_text_acl_rule_index, "action": help_text_acl_action, @@ -523,22 +541,6 @@ class ACLExtendedRuleForm(NetBoxModelForm): help_text=help_text_acl_rule_logic, label="Destination Prefix", ) - fieldsets = ( - ("Access List Details", ("access_list", "description", "tags")), - ( - "Rule Definition", - ( - "index", - "action", - "remark", - "source_prefix", - "source_ports", - "destination_prefix", - "destination_ports", - "protocol", - ), - ), - ) class Meta: model = ACLExtendedRule @@ -555,6 +557,10 @@ class Meta: "tags", "description", ) + fieldsets = ( + FieldSet("access_list", "description", "tags", name=_('Access List Details')), + FieldSet("index", "action", "remark", "source_prefix", "source_ports", "destination_prefix", "destination_ports", "protocol", name=_('Rule Definition')) + ) help_texts = { "action": help_text_acl_action, "destination_ports": help_text_acl_rule_logic, From f950858e55df35cfbca909c6c3d14880b680b161 Mon Sep 17 00:00:00 2001 From: Chris Russell Date: Thu, 19 Sep 2024 22:23:10 +0100 Subject: [PATCH 12/15] move filtersets to models not meta --- netbox_acls/forms/models.py | 44 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/netbox_acls/forms/models.py b/netbox_acls/forms/models.py index 162e63de..d25bab2b 100644 --- a/netbox_acls/forms/models.py +++ b/netbox_acls/forms/models.py @@ -119,7 +119,12 @@ class AccessListForm(NetBoxModelForm): ) comments = CommentField() - + fieldsets = ( + FieldSet('region', 'site_group', 'site', 'virtual_machine', 'virtual_chassis', 'device', name=_('Assignment')), + FieldSet('name', 'type', 'default_action', name=_('Access List')), + FieldSet('comments', 'tags', name=_('')), + ) + class Meta: model = AccessList fields = ( @@ -135,11 +140,7 @@ class Meta: "comments", "tags", ) - fieldsets = ( - FieldSet('region', 'site_group', 'site', 'virtual_machine', 'virtual_chassis', 'device', name=_('Assignment')), - FieldSet('name', 'type', 'default_action', name=_('Access List')), - FieldSet('comments', 'tags', name=_('')), - ) + help_texts = { "default_action": "The default behavior of the ACL.", "name": "The name uniqueness per device is case insensitive.", @@ -291,6 +292,11 @@ class ACLInterfaceAssignmentForm(NetBoxModelForm): ), ) comments = CommentField() + fieldsets = ( + FieldSet('device', 'interface', 'virtual_machine', 'vminterface', name=_('Assignment')), + FieldSet('access_list', 'direction', name=_('Access List Details')), + FieldSet('comments', 'tags', name=_('')), + ) def __init__(self, *args, **kwargs): # Initialize helper selectors @@ -319,11 +325,7 @@ class Meta: "comments", "tags", ) - fieldsets = ( - FieldSet('device', 'interface', 'virtual_machine', 'vminterface', name=_('Assignment')), - FieldSet('access_list', 'direction', name=_('Access List Details')), - FieldSet('comments', 'tags', name=_('')), - ) + help_texts = { "direction": mark_safe( "*Note: CANNOT assign 2 ACLs to the same interface & direction.", @@ -451,10 +453,9 @@ class ACLStandardRuleForm(NetBoxModelForm): ) fieldsets = ( - ("Access List Details", ("access_list", "description", "tags")), - ("Rule Definition", ("index", "action", "remark", "source_prefix")), + FieldSet("access_list", "description", "tags", name=_('Access List Details')), + FieldSet("index", "action", "remark", "source_prefix", name=_('Rule Definition')) ) - class Meta: model = ACLStandardRule fields = ( @@ -466,10 +467,7 @@ class Meta: "tags", "description", ) - fieldsets = ( - FieldSet("access_list", "description", "tags", name=_('Access List Details')), - FieldSet("index", "action", "remark", "source_prefix", name=_('Rule Definition')) - ) + @@ -541,7 +539,10 @@ class ACLExtendedRuleForm(NetBoxModelForm): help_text=help_text_acl_rule_logic, label="Destination Prefix", ) - + fieldsets = ( + FieldSet("access_list", "description", "tags", name=_('Access List Details')), + FieldSet("index", "action", "remark", "source_prefix", "source_ports", "destination_prefix", "destination_ports", "protocol", name=_('Rule Definition')) + ) class Meta: model = ACLExtendedRule fields = ( @@ -557,10 +558,7 @@ class Meta: "tags", "description", ) - fieldsets = ( - FieldSet("access_list", "description", "tags", name=_('Access List Details')), - FieldSet("index", "action", "remark", "source_prefix", "source_ports", "destination_prefix", "destination_ports", "protocol", name=_('Rule Definition')) - ) + help_texts = { "action": help_text_acl_action, "destination_ports": help_text_acl_rule_logic, From d2f83357710218b3df06c7d2698751e650759049 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 03:05:48 +0000 Subject: [PATCH 13/15] Bump pypa/gh-action-pypi-publish from 1.10.1 to 1.10.2 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.10.1 to 1.10.2. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/0ab0b79471669eb3a4d647e625009c62f9f3b241...897895f1e160c830e369f9779632ebc134688e1b) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 2b082ba0..04d71773 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -34,7 +34,7 @@ jobs: - name: Build package run: python -m build - name: Publish package - uses: pypa/gh-action-pypi-publish@0ab0b79471669eb3a4d647e625009c62f9f3b241 + uses: pypa/gh-action-pypi-publish@897895f1e160c830e369f9779632ebc134688e1b with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} From 359299cf507eef71841a1c4d085a9ea55010e9b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 03:10:47 +0000 Subject: [PATCH 14/15] Bump pypa/gh-action-pypi-publish from 1.10.2 to 1.10.3 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.10.2 to 1.10.3. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/897895f1e160c830e369f9779632ebc134688e1b...f7600683efdcb7656dec5b29656edb7bc586e597) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 04d71773..044bc49d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -34,7 +34,7 @@ jobs: - name: Build package run: python -m build - name: Publish package - uses: pypa/gh-action-pypi-publish@897895f1e160c830e369f9779632ebc134688e1b + uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} From 02f428acb0d85a51342eb63b89ba06e44b557f1e Mon Sep 17 00:00:00 2001 From: Chris Russell Date: Thu, 10 Oct 2024 21:09:11 +0100 Subject: [PATCH 15/15] bump version to 1.7.0 --- README.md | 15 ++++++++------- netbox_acls/__init__.py | 2 +- netbox_acls/version.py | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fc795e0d..11feab53 100644 --- a/README.md +++ b/README.md @@ -36,15 +36,16 @@ See the [CONTRIBUTING](CONTRIBUTING.md) for more information. Each Plugin Version listed below has been tested with its corresponding NetBox Version. -| NetBox Version | Plugin Version | +| NetBox Version | Plugin Version | |:-------------------:|:--------------:| +| 4.1.x | 1.7.0 | | >= 4.0.2 < 4.1.0 | 1.6.1 | -| 3.7 | 1.5.0 | -| 3.6 | 1.4.0 | -| 3.5 | 1.3.0 | -| 3.4 | 1.2.2 | -| 3.3 | 1.1.0 | -| 3.2 | 1.0.1 | +| 3.7.x | 1.5.0 | +| 3.6.x | 1.4.0 | +| 3.5.x | 1.3.0 | +| 3.4.x | 1.2.2 | +| 3.3.x | 1.1.0 | +| 3.2.x | 1.0.1 | ## Installing diff --git a/netbox_acls/__init__.py b/netbox_acls/__init__.py index 3dc34919..aed9081d 100644 --- a/netbox_acls/__init__.py +++ b/netbox_acls/__init__.py @@ -18,7 +18,7 @@ class NetBoxACLsConfig(PluginConfig): description = "Manage simple ACLs in NetBox" base_url = "access-lists" min_version = "4.1.0" - max_version = "4.1.20" + max_version = "4.1.99" config = NetBoxACLsConfig diff --git a/netbox_acls/version.py b/netbox_acls/version.py index f49459c7..14d9d2f5 100644 --- a/netbox_acls/version.py +++ b/netbox_acls/version.py @@ -1 +1 @@ -__version__ = "1.6.1" +__version__ = "1.7.0"