Commit Graph

19 Commits

Author SHA1 Message Date
Erik Olof Gunnar Andersson 5c88c50349 Improve object fields coverage and fixed error handling
- Fixed bad error handling.
- Removed unreachable code.
- Minor cleanup for consistency.

Change-Id: Ie632f3c1358a6d25a75dfc023fa053b89b32ebf4
2023-11-08 00:57:43 +00:00
Erik Olof Gunnar Andersson 68fc28527a pyupgrade changes for Python3.8+
Result of running

$ pyupgrade --py38-plus $(git ls-files | grep ".py$")

This was inspired by Nova [1] and Octavia [2]

Fixed PEP8 errors introduced by pyupgrade by running:

$ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \
  --in-place designate

and manual updates.

[1]: https://review.opendev.org/c/openstack/nova/+/896986
[2]: https://review.opendev.org/c/openstack/octavia/+/899263

Change-Id: Idfa757d7ba238012db116fdb3e98cc7c5ff4b169
2023-11-03 11:19:07 +00:00
Erik Olof Gunnar Andersson 18a5d4f4d9 Moved all regexes to constants
- Moved record regexes to constants.
- Moved floating ip regex to constants.
- Moved valdiation regex to constants.
- Added additional floating ip tests around regexes.

Change-Id: I3cb738f2775f770deda30253b91f148b593314bc
2023-08-14 17:21:24 +00:00
Erik Olof Gunnar Andersson 5c9fca9d42 Removed unused object fields code
Change-Id: Ibb410619f08ab879266cac81c7758f7739a7c0e4
2023-08-02 21:09:21 +00:00
Rossen Popov aa151b4d00 Improve NAPTR support
This patchset adds support for fields (e.g flags, services, regexp)
to be quoted and empty as described in RFC 2915. While unquoted
fields are NOT optional, the previous behaviour remains for
backward compatibility. The regular expressions have been adjusted
to allow empty string values for quoted fields. Additional tests
added to cover more cases.

https://datatracker.ietf.org/doc/html/rfc2915
https://github.com/isc-projects/bind9/blob/main/bin/tests/system/xfer/dig1.good

Change-Id: I44bc7d2a231ed8d63cba69ec95f06358687aa914
2023-05-19 19:10:11 +01:00
dekehn f44395870d Checks for invalid denylist regex patterns
Adds new field check method DenyListFields to validate
the pattern string. in addition, check for a zero
length string as well.

Closes-Bug: #1934252
Change-Id: I2b69025fc11125bb73a4e0f8c0dedad951399cbf
2022-02-18 19:14:35 +00:00
Christian Rohmann 1cef20edbc Allow email subadresses to be used within mail url of CAA records
This patch allows for +subaddress to be used for the local part of mail urls
used for CAA records. While there are more characters allowed in email
addresses, using subadresses for incoming email to role accounts is quite
common.

Closes-Bug: 1958533
Change-Id: Id265fa1dfa5c0703d8e95b5de1334d4ca716fbc0
2022-01-22 20:24:12 +01:00
Dr. Jens Harbott 296a5adaf9 Improve wording for validation error messages
Correct some grammatical issues and harmonize the responses

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: Ib45eae335160d53bb25e3745fcbe451bffa2cc31
2021-12-01 15:45:14 +00:00
Michael Johnson 0e16095a80 Enable H306 check and fix import ordering
To better align with other OpenStack projects and to reduce the
ongoing problem with duplicate imports, this patch re-enables the
H306 check for proper module import order.

Change-Id: Iced92590829f6d9177d64ad4868aebe6eafd6a8a
2021-11-18 00:30:05 +00:00
kpdev e7b0246609 CERT DNS records
This patchset adds support for DNS CERT Resource Record which is
described in RFC 4398
(https://tools.ietf.org/html/rfc4398)

Closes-Bug: 1937113
Change-Id: I0cdfa1decd28096b7135b820b01ee7ec17b1a57d
2021-07-25 11:12:44 +02:00
Erik Olof Gunnar Andersson 2c9e9f5f41 Bump to hacking 1.1.0
* Minor changes to fix some new checks.
* Use pycodestyle directly instead of pep8.

Change-Id: I5fbe877f8d05c1b25bf760e52ea8abdfd0a2d8d9
2019-07-04 00:33:00 -07:00
Tytus Kurek c0b54602a4
CAA DNS records
This patchset adds support for DNS CAA (Certification Authority
Authorization) Resource Record which is described in RFC 6844
(https://tools.ietf.org/html/rfc6844)

Change-Id: If9619096f1706d1123895b63b9129b9ffd4fb320
Closes-Bug: 1787552
2018-11-07 16:08:01 +00:00
Tytus Kurek 44d9c02c7c
NAPTR DNS records
This patchset adds support for DNS NAPTR (Naming Authority
Pointer) Resource Record which is described in RFC 2915
(https://tools.ietf.org/html/rfc2915)

Change-Id: Ic7d26a6c653ce46e67438e983476782edd6ec890
Closes-Bug: 1779850
2018-11-06 15:59:04 +00:00
Nguyen Van Trung 205281ec0d Change copyright information for field.py
Due to wrong copy&paste and this is commit from fujitsu
since last year [1]

[1] https://review.openstack.org/#/c/464971/

Change-Id: Ib403898521efcda9edfefcfbc027b831031783c3
2018-05-14 09:05:59 +00:00
Graham Hayes d72c652013 Ensure we do not pass invalid data for A records
DNSPython does not allow IPs to have leading zeros
for A records [1] and eventlet agrees [2], so we should
ensure we do not create a situation where a project can
DOS itself.

This patch uses the DNSPython method to ensure it is kept in sync

1 - https://github.com/rthalley/dnspython/blob/v1.15.0/dns/ipv4.py#L52-L54
2 - https://github.com/eventlet/eventlet/blob/v0.20.0/eventlet/support/dns/ipv4.py#L52-L54

Partial-Bug: 1760833
Change-Id: I975b18d390647de9fe11c105cd421b761f88be6c
2018-04-11 15:34:15 +01:00
Dai Dang Van b215bf69c0 Migrate object to OVO (7)
- Remove old base objects

Co-authored-By: Nguyen Van Trung <trungnv@vn.fujitsu.com>

Change-Id: Icb8817a699a8c12957126a0499d95d13b8eeda6d
Implements: blueprint designate-rolling-upgrade
2018-02-25 16:07:58 +00:00
Nguyen Van Trung e9cc75ff01 Migrate object to OVO (5)
This commit will migrate:
- Blacklist object
- Quota objects
- Floating_IP objects

Co-authored-By: Dai Dang Van <daidv@vn.fujitsu.com>

Change-Id: I85455e7cbf24da4c7c6302060d5c3d203fdf2fc5
Implements: blueprint designate-rolling-upgrade
2018-02-25 16:07:44 +00:00
Nguyen Van Trung 274c2cb82c Migrate object to OVO (4)
This commit will migrate:
- Pool and PoolList
- Related objects

Co-authored-By: Dai Dang Van <daidv@vn.fujitsu.com>

Change-Id: I59da0628a9dc23efe8d8665bbf3359e652eaa8c9
Implements: blueprint designate-rolling-upgrade
2018-02-25 16:07:38 +00:00
Dai Dang Van 0eb9627cb0
Migrate object to OVO
This commit will migrate Zone and ZoneMaster objects

Co-authored-By: Hieu LE <hieulq@vn.fujitsu.com>
Co-authored-By: Nguyen Van Trung <trungnv@vn.fujitsu.com>

Change-Id: I8a0b0868d25dacd3dabeb7e0436cfcf93b1e4cc7
Implements: blueprint designate-rolling-upgrade
2018-02-25 16:05:06 +00:00