Skip to content

Commit

Permalink
Merge pull request #91 from nautobot/develop
Browse files Browse the repository at this point in the history
v1.0.2 release
  • Loading branch information
whitej6 authored Sep 22, 2022
2 parents 299eb55 + bb39cb5 commit c757fe2
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## v1.0.2 - 2022-09-22

### Fixed

- #87 NestedWritabeSerializer fix for schema generation on VarBinaryField
- #88 Docs fix
- #89 Ressolve ordering when viewing PolicyRules via a Policy view.

## v1.0.1 - 2022-09-18

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion docs/capirca.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The process is to create a custom field, such as `ctd_pan-application`, this wil
capirca_allow = ['ctd_pan-application', 'ctd_expiration']
```

> Note: This is pseudo-code and is technically the custom_field called `capirca_allow` that has the dat `['ctd_pan-application', 'ctd_expiration']` in this example.
> Note: This is pseudo-code and is technically the custom_field called `capirca_allow` that has the data `["ctd_pan-application", "ctd_expiration"]` in this example.
As previously mentioned, there is only a small opinion that is applied from the translation between the model and Capirca. That being said, Capirca has an opinion on how rules and objects are deployed, and within this project there is no consideration for how that may not align with anyone's intention on how Capirca should work. All such considerations should be referred to the Capirca project. There is no intention to modify the output that Capirca creates **in any situation** within this plugin.

Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ nav:
- Examples: "example.md"
- Development Environment: "development.md"
- Models: "models.md"
- Capirca Usage: "capirca.md"
4 changes: 3 additions & 1 deletion nautobot_firewall_models/api/nested_serializers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Nested serializers."""
from nautobot.core.api import WritableNestedSerializer
from rest_framework.serializers import HyperlinkedIdentityField
from rest_framework.serializers import CharField, HyperlinkedIdentityField

from nautobot_firewall_models import models

Expand All @@ -21,6 +21,8 @@ class NestedIPRangeSerializer(WritableNestedSerializer):
"""Nested serializer for IPRange."""

url = HyperlinkedIdentityField(view_name="plugins-api:nautobot_firewall_models-api:fqdn-detail")
start_address = CharField()
end_address = CharField()

class Meta:
"""Meta attributes."""
Expand Down
6 changes: 3 additions & 3 deletions nautobot_firewall_models/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


from nautobot_firewall_models import models
from nautobot_firewall_models.api import nested_serializers
from nautobot_firewall_models.api.nested_serializers import NestedFQDNSerializer, NestedIPRangeSerializer


class StatusModelSerializerMixin(_StatusModelSerializerMixin): # pylint: disable=abstract-method
Expand Down Expand Up @@ -66,8 +66,8 @@ class AddressObjectSerializer(TaggedObjectSerializer, StatusModelSerializerMixin
url = serializers.HyperlinkedIdentityField(
view_name="plugins-api:nautobot_firewall_models-api:addressobject-detail"
)
ip_range = nested_serializers.NestedIPRangeSerializer(required=False)
fqdn = nested_serializers.NestedFQDNSerializer(required=False)
ip_range = NestedIPRangeSerializer(required=False)
fqdn = NestedFQDNSerializer(required=False)
ip_address = NestedIPAddressSerializer(required=False)
prefix = NestedPrefixSerializer(required=False)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.2.15 on 2022-09-22 13:35

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("nautobot_firewall_models", "0008_renaming_part3"),
]

operations = [
migrations.AlterModelOptions(
name="policyrulem2m",
options={"ordering": ["rule__index"]},
),
]
5 changes: 5 additions & 0 deletions nautobot_firewall_models/models/through_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ class PolicyRuleM2M(BaseModel):
policy = models.ForeignKey("nautobot_firewall_models.Policy", on_delete=models.CASCADE)
rule = models.ForeignKey("nautobot_firewall_models.PolicyRule", on_delete=models.PROTECT)

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

ordering = ["rule__index"]


class ServiceObjectGroupM2M(BaseModel):
"""Custom through model to on_delete=models.PROTECT to prevent deleting associated ServiceGroup if assigned to a PolicyRule."""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nautobot-firewall-models"
version = "1.0.1"
version = "1.0.2"
description = "Nautobot plugin to model firewall objects."
authors = ["Network to Code, LLC <info@networktocode.com>"]
license = "Apache-2.0"
Expand Down

0 comments on commit c757fe2

Please sign in to comment.