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
This commit is contained in:
Tytus Kurek
2018-10-17 09:34:13 +02:00
committed by Graham Hayes
parent 7e7a43b829
commit 44d9c02c7c
10 changed files with 211 additions and 4 deletions

View File

@@ -0,0 +1,44 @@
# Copyright 2018 Canonical Ltd.
#
# Author: Tytus Kurek <tytus.kurek@canonical.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from sqlalchemy import MetaData, Table, Enum
meta = MetaData()
def upgrade(migrate_engine):
meta.bind = migrate_engine
RECORD_TYPES = ['A', 'AAAA', 'CNAME', 'MX', 'SRV', 'TXT', 'SPF', 'NS',
'PTR', 'SSHFP', 'SOA', 'NAPTR']
records_table = Table('recordsets', meta, autoload=True)
records_table.columns.type.alter(name='type', type=Enum(*RECORD_TYPES))
def downgrade(migrate_engine):
meta.bind = migrate_engine
RECORD_TYPES = ['A', 'AAAA', 'CNAME', 'MX', 'SRV', 'TXT', 'SPF', 'NS',
'PTR', 'SSHFP', 'SOA']
records_table = Table('recordsets', meta, autoload=True)
# Delete all NAPTR records
records_table.filter_by(name='type', type='NAPTR').delete()
# Remove CAA from the ENUM
records_table.columns.type.alter(type=Enum(*RECORD_TYPES))

View File

@@ -29,7 +29,7 @@ CONF = cfg.CONF
RESOURCE_STATUSES = ['ACTIVE', 'PENDING', 'DELETED', 'ERROR']
RECORD_TYPES = ['A', 'AAAA', 'CNAME', 'MX', 'SRV', 'TXT', 'SPF', 'NS', 'PTR',
'SSHFP', 'SOA']
'SSHFP', 'SOA', 'NAPTR']
TASK_STATUSES = ['ACTIVE', 'PENDING', 'DELETED', 'ERROR', 'COMPLETE']
TSIG_ALGORITHMS = ['hmac-md5', 'hmac-sha1', 'hmac-sha224', 'hmac-sha256',
'hmac-sha384', 'hmac-sha512']