Skip to content

Validate IpamRouteTarget.name against the RFC 4360 route-target formats #82

Open

Description

@lancamat1

Context. IpamRouteTarget.name is a free Text attribute. Any string is accepted, so
typos in route targets are only caught by the device that rejects the generated config.
The marker predates this PR (present on main:extensions/vrf/vrf.yml:62) and is unchanged
by it.

Current marker.

extensions/vrf/vrf.yml:78
      # TODO: regex to comply with RFC 4360 (nautobot doesn't enforce that)

What this asks for. Add a regex to IpamRouteTarget.name covering the RFC 4360 forms:
2-byte-ASN ASN:NN, IPv4 A.B.C.D:NN, and 4-byte-ASN, including asdot notation
(ASN.ASN:NN). This was deferred out of v2.0 rather than implemented because a regex
tight enough to be useful risks rejecting valid customer values on a schema every
marketplace user loads, and the author's own parenthetical (Nautobot does not enforce it)
is the reason to be careful. The issue should settle two things before any regex lands:
whether the library validates at all at this tier, and whether asdot is accepted
alongside asplain.

Origin: pass-1 review of #75, packet VRF-03, CC-8 bucket (c).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions