summaryrefslogtreecommitdiff
path: root/designate/storage
diff options
context:
space:
mode:
authorkpdev <kinpaa@gmail.com>2021-07-25 11:12:44 +0200
committerkpdev <kinpaa@gmail.com>2021-07-25 11:12:44 +0200
commite7b024660938d0b55ead1fa8556dca1d22c7bb59 (patch)
treea2810bcd9a9a6ae786df0f62d4cdef6eae537d08 /designate/storage
parent6fc04e72ec1fd039290173197dc4921df2f3d1c0 (diff)
downloaddesignate-e7b024660938d0b55ead1fa8556dca1d22c7bb59.tar.gz
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
Diffstat (limited to 'designate/storage')
-rw-r--r--designate/storage/impl_sqlalchemy/migrate_repo/versions/103_support_cert_records.py29
-rw-r--r--designate/storage/impl_sqlalchemy/tables.py2
2 files changed, 30 insertions, 1 deletions
diff --git a/designate/storage/impl_sqlalchemy/migrate_repo/versions/103_support_cert_records.py b/designate/storage/impl_sqlalchemy/migrate_repo/versions/103_support_cert_records.py
new file mode 100644
index 00000000..85ba5b67
--- /dev/null
+++ b/designate/storage/impl_sqlalchemy/migrate_repo/versions/103_support_cert_records.py
@@ -0,0 +1,29 @@
+# Copyright 2021 Cloudification GmbH
+#
+# Author: cloudification <contact@cloudification.io>
+#
+# 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', 'CAA', 'CERT']
+
+ records_table = Table('recordsets', meta, autoload=True)
+ records_table.columns.type.alter(name='type', type=Enum(*RECORD_TYPES))
diff --git a/designate/storage/impl_sqlalchemy/tables.py b/designate/storage/impl_sqlalchemy/tables.py
index 8adb14d2..6f4c4a81 100644
--- a/designate/storage/impl_sqlalchemy/tables.py
+++ b/designate/storage/impl_sqlalchemy/tables.py
@@ -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', 'NAPTR', 'CAA']
+ 'SSHFP', 'SOA', 'NAPTR', 'CAA', 'CERT']
TASK_STATUSES = ['ACTIVE', 'PENDING', 'DELETED', 'ERROR', 'COMPLETE']
TSIG_ALGORITHMS = ['hmac-md5', 'hmac-sha1', 'hmac-sha224', 'hmac-sha256',