Skip to content

Commit

Permalink
Merge pull request #111 from nautobot/develop
Browse files Browse the repository at this point in the history
Develop to Main v1.1.2 release
  • Loading branch information
whitej6 authored Nov 12, 2022
2 parents bd3420f + d9320d7 commit f896b28
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 16 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## v1.1.2 - 2022-11-12

### Added

- #108 Enable cloning for PolicyRule and NATPolicyRule models
- #110 Add support for port lists on ServiceObject

### Fixed

- #109 Resolved incorrect links in mkdocs.yml

## v1.1.1 - 2022-10-26

### Fixed
Expand Down
6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
dev_addr: "127.0.0.1:8001"
edit_uri: "edit/main/nautobot-plugin-firewall-model/docs"
edit_uri: "edit/main/docs"
site_name: "Nautobot Firewall Models Documentation"
site_url: "https://nautobot-plugin-firewall-model.readthedocs.io/"
site_url: "https://nautobot-plugin-firewall-models.readthedocs.io/"
site_dir: nautobot_firewall_models/static/nautobot_firewall_models/docs
repo_url: "https://github.com/networktocode-llc/nautobot-plugin-firewall-model"
repo_url: "https://github.com/nautobot/nautobot-plugin-firewall-models"
theme:
name: "readthedocs"
navigation_depth: 4
Expand Down
42 changes: 42 additions & 0 deletions nautobot_firewall_models/models/core_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,24 @@ class PolicyRule(PrimaryModel):
description = models.CharField(max_length=200, null=True, blank=True)
index = models.PositiveSmallIntegerField(null=True, blank=True)

clone_fields = [
"source_users",
"source_user_groups",
"source_addresses",
"source_address_groups",
"source_zone",
"source_services",
"source_service_groups",
"destination_addresses",
"destination_address_groups",
"destination_zone",
"destination_services",
"destination_service_groups",
"action",
"log",
"status",
]

class Meta:
"""Meta class."""

Expand Down Expand Up @@ -755,6 +773,30 @@ class NATPolicyRule(PrimaryModel):
to=ServiceObjectGroup, through="NATTransDestSvcGroupM2M", related_name="translated_destination_nat_policy_rules"
)

clone_fields = [
"destination_zone",
"source_zone",
"original_source_addresses",
"original_source_address_groups",
"original_source_services",
"original_source_service_groups",
"original_destination_addresses",
"original_destination_address_groups",
"original_destination_services",
"original_destination_service_groups",
"translated_source_addresses",
"translated_source_address_groups",
"translated_source_services",
"translated_source_service_groups",
"translated_destination_addresses",
"translated_destination_address_groups",
"translated_destination_services",
"translated_destination_service_groups",
"remark",
"log",
"status",
]

class Meta:
"""Meta class."""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'generic/object_detail.html' %}
{% extends 'generic/object_retrieve.html' %}
{% load helpers %}
{% load plugins %}
{% block content %}
Expand Down
44 changes: 44 additions & 0 deletions nautobot_firewall_models/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def test_delete_object(self):
def test_bulk_delete_objects(self):
pass

@skip("on_delete set to PROTECT")
def test_delete_object_without_permission(self):
pass


class AddressObjectGroupAPIViewTest(APIViewTestCases.APIViewTestCase):
"""Test the AddressObjectGroup viewsets."""
Expand Down Expand Up @@ -112,6 +116,10 @@ def test_delete_object(self):
def test_bulk_delete_objects(self):
pass

@skip("on_delete set to PROTECT")
def test_delete_object_without_permission(self):
pass

def test_create_object(self):
self.validation_excluded_fields = ["address_objects"]
return super().test_create_object()
Expand Down Expand Up @@ -154,6 +162,10 @@ def test_delete_object(self):
def test_bulk_delete_objects(self):
pass

@skip("on_delete set to PROTECT")
def test_delete_object_without_permission(self):
pass


class ServiceGroupAPIViewTest(APIViewTestCases.APIViewTestCase):
"""Test the ServiceGroup viewsets."""
Expand Down Expand Up @@ -184,6 +196,10 @@ def test_delete_object(self):
def test_bulk_delete_objects(self):
pass

@skip("on_delete set to PROTECT")
def test_delete_object_without_permission(self):
pass

def test_create_object(self):
self.validation_excluded_fields = ["service_objects"]
return super().test_create_object()
Expand Down Expand Up @@ -225,6 +241,10 @@ def test_delete_object(self):
def test_bulk_delete_objects(self):
pass

@skip("on_delete set to PROTECT")
def test_delete_object_without_permission(self):
pass


class UserObjectGroupAPIViewTest(APIViewTestCases.APIViewTestCase):
"""Test the UserGroup viewsets."""
Expand Down Expand Up @@ -255,6 +275,10 @@ def test_delete_object(self):
def test_bulk_delete_objects(self):
pass

@skip("on_delete set to PROTECT")
def test_delete_object_without_permission(self):
pass

def test_create_object(self):
self.validation_excluded_fields = ["user_objects"]
return super().test_create_object()
Expand Down Expand Up @@ -296,6 +320,10 @@ def test_delete_object(self):
def test_bulk_delete_objects(self):
pass

@skip("on_delete set to PROTECT")
def test_delete_object_without_permission(self):
pass


class PolicyRuleAPIViewTest(APIViewTestCases.APIViewTestCase):
"""Test the PolicyRule viewsets."""
Expand Down Expand Up @@ -346,6 +374,10 @@ def test_delete_object(self):
def test_bulk_delete_objects(self):
pass

@skip("on_delete set to PROTECT")
def test_delete_object_without_permission(self):
pass


class PolicyAPIViewTest(APIViewTestCases.APIViewTestCase):
"""Test the Policy viewsets."""
Expand Down Expand Up @@ -388,6 +420,10 @@ def test_delete_object(self):
def test_bulk_delete_objects(self):
pass

@skip("on_delete set to PROTECT")
def test_delete_object_without_permission(self):
pass


class NATPolicyRuleAPIViewTest(APIViewTestCases.APIViewTestCase):
"""Test the PolicyRule viewsets."""
Expand Down Expand Up @@ -434,6 +470,10 @@ def test_delete_object(self):
def test_bulk_delete_objects(self):
pass

@skip("on_delete set to PROTECT")
def test_delete_object_without_permission(self):
pass


class NATPolicyAPIViewTest(APIViewTestCases.APIViewTestCase):
"""Test the Policy viewsets."""
Expand Down Expand Up @@ -475,3 +515,7 @@ def test_delete_object(self):
@skip("on_delete set to PROTECT")
def test_bulk_delete_objects(self):
pass

@skip("on_delete set to PROTECT")
def test_delete_object_without_permission(self):
pass
Loading

0 comments on commit f896b28

Please sign in to comment.