From e3961f8da26a886c6de0b8312837ff0fa20e8cb7 Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Fri, 31 Jul 2020 18:37:39 -0600 Subject: [PATCH 01/16] Checking for a trailing period in TP wrt static DNS entry --- .../FormDeliveryServiceStaticDnsEntryController.js | 1 + .../form.deliveryServiceStaticDnsEntry.tpl.html | 8 ++++++-- .../app/src/common/service/utils/LocationUtils.js | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/FormDeliveryServiceStaticDnsEntryController.js b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/FormDeliveryServiceStaticDnsEntryController.js index 949c61c467..2ab249799b 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/FormDeliveryServiceStaticDnsEntryController.js +++ b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/FormDeliveryServiceStaticDnsEntryController.js @@ -18,6 +18,7 @@ */ var FormDeliveryServiceStaticDnsEntryController = function(deliveryService, staticDnsEntry, $scope, formUtils, locationUtils, typeService, cacheGroupService) { + $scope.StaticDNSPattern = locationUtils.StaticDNSPattern; var getTypes = function() { typeService.getTypes({ useInTable: 'staticdnsentry' }) diff --git a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html index 2519630f6b..f97f17dad5 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html +++ b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html @@ -57,10 +57,14 @@
- +
- + Required + Invalid Address
diff --git a/traffic_portal/app/src/common/service/utils/LocationUtils.js b/traffic_portal/app/src/common/service/utils/LocationUtils.js index beee97e4e4..2ee3e10b0f 100644 --- a/traffic_portal/app/src/common/service/utils/LocationUtils.js +++ b/traffic_portal/app/src/common/service/utils/LocationUtils.js @@ -19,6 +19,11 @@ var LocationUtils = function($location, $uibModal) { + // ... this one allows Static DNS entries with only a trailing period + this.StaticDNSPattern = /^(?=.{1,253}\.?$)(?:(?!-|[^.]+_)[A-Za-z0-9-_]{1,63}(?:\.)){2,}$/; + // actual regex: /^(?=.{1,253}\.?$)(?:(?!-|[^.]+_)[A-Za-z0-9-_]{1,63}(? Date: Sun, 2 Aug 2020 19:45:27 -0600 Subject: [PATCH 02/16] Added test cases for adding adn deleting static DNS entry. Added name in table anf form js to support these test cases --- ...orm.deliveryServiceStaticDnsEntry.tpl.html | 2 +- ...e.deliveryServiceStaticDnsEntries.tpl.html | 4 +- .../delivery-services-spec.js | 65 ++++++++++++++++--- .../end_to_end/deliveryServices/pageData.js | 8 +++ .../test/end_to_end/servers/servers-spec.js | 4 +- 5 files changed, 68 insertions(+), 15 deletions(-) diff --git a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html index f97f17dad5..ef7b6df3f1 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html +++ b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html @@ -58,7 +58,7 @@
diff --git a/traffic_portal/app/src/common/modules/table/deliveryServiceStaticDnsEntries/table.deliveryServiceStaticDnsEntries.tpl.html b/traffic_portal/app/src/common/modules/table/deliveryServiceStaticDnsEntries/table.deliveryServiceStaticDnsEntries.tpl.html index 1d7b6b7369..64b2b7beca 100644 --- a/traffic_portal/app/src/common/modules/table/deliveryServiceStaticDnsEntries/table.deliveryServiceStaticDnsEntries.tpl.html +++ b/traffic_portal/app/src/common/modules/table/deliveryServiceStaticDnsEntries/table.deliveryServiceStaticDnsEntries.tpl.html @@ -21,11 +21,11 @@
- +
diff --git a/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js b/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js index 94a7021aa9..07211557e6 100644 --- a/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js +++ b/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js @@ -50,7 +50,11 @@ describe('Traffic Portal Delivery Services Suite', function() { dnsXmlId: "dns-xml-id-" + commonFunctions.shuffle('abcdefghijklmonpqrstuvwxyz'), httpXmlId: "http-xml-id-" + commonFunctions.shuffle('abcdefghijklmonpqrstuvwxyz'), steeringXmlId: "http-xml-id-" + commonFunctions.shuffle('abcdefghijklmonpqrstuvwxyz'), - longDesc: "This is only a test delivery service that should be disposed of by Automated UI Testing." + longDesc: "This is only a test delivery service that should be disposed of by Automated UI Testing.", + staticDNShostName: "static-dns-xml-id-" + commonFunctions.shuffle('abcdefghijklmonpqrstuvwxyz'), + staticDNSTTL: 50, + staticDNSAddress: "cdn.test.com." + }; it('should open delivery services page', function() { @@ -312,21 +316,62 @@ describe('Traffic Portal Delivery Services Suite', function() { expect(pageData.displayName.getText() === "Updated display name"); }); - it('should add a required server capability to the HTTP delivery service', function() { - console.log('Adding required server capability to ' + mockVals.httpXmlId); + // it('should add a required server capability to the HTTP delivery service', function() { + // console.log('Adding required server capability to ' + mockVals.httpXmlId); + // pageData.moreBtn.click(); + // pageData.viewCapabilitiesMenuItem.click(); + // expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toMatch(commonFunctions.urlPath(browser.baseUrl)+"#!/delivery-services/[0-9]+/required-server-capabilities"); + // pageData.addCapabilityBtn.click(); + // expect(pageData.selectFormSubmitButton.isEnabled()).toBe(false); + // commonFunctions.selectDropdownbyNum(pageData.selectFormDropdown, 1); + // expect(pageData.selectFormSubmitButton.isEnabled()).toBe(true); + // pageData.selectFormSubmitButton.click(); + // element.all(by.css('tbody tr')).then(function(totalRows) { + // expect(totalRows.length).toBe(1); + // }); + // }); + + it('should add a required Static DNS entry to the HTTP delivery service', function() { + console.log('Adding Static DNS entry to ' + mockVals.httpXmlId); pageData.moreBtn.click(); - pageData.viewCapabilitiesMenuItem.click(); - expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toMatch(commonFunctions.urlPath(browser.baseUrl)+"#!/delivery-services/[0-9]+/required-server-capabilities"); - pageData.addCapabilityBtn.click(); - expect(pageData.selectFormSubmitButton.isEnabled()).toBe(false); - commonFunctions.selectDropdownbyNum(pageData.selectFormDropdown, 1); - expect(pageData.selectFormSubmitButton.isEnabled()).toBe(true); - pageData.selectFormSubmitButton.click(); + pageData.viewStaticCapabilitiesMenuItem.click(); + expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toMatch(commonFunctions.urlPath(browser.baseUrl)+"#!/delivery-services/[0-9]+/static-dns-entries/?type=HTTP"); + pageData.addStaticDNSBtn.click(); + // expect(pageData.selectFormSubmitButton.isEnabled()).toBe(false); + // set host name + pageData.host.sendKeys(mockVals.staticDNShostName); + // set type ID + pageData.typeId.click(); + commonFunctions.selectDropdownbyNum(pageData.typeId, 3); + // set ttl + pageData.ttl.sendKeys(mockVals.staticDNSTTL); + // set address + pageData.address.sendKeys(mockVals.staticDNSAddress); + expect(pageData.createButton.isEnabled()).toBe(true); + pageData.createButton.click(); element.all(by.css('tbody tr')).then(function(totalRows) { expect(totalRows.length).toBe(1); }); }); + it('should delete the Static DNS entry', function() { + console.log('Deleting the Static DNS entry for ' + mockVals.httpXmlId); + // pageData.searchStaticFilter.clear().then(function () { + // pageData.searchStaticFilter.sendKeys(mockVals.staticDNShostName); + // }); + // element.all(by.repeater('s in ::staticDnsEntries')).filter(function(row){ + // return row.element(by.name('::s.host')).getText().then(function(val){ + // return val.toString() === mockVals.staticDNShostName.toString(); + // }); + // }).get(0).click(); + pageData.dsStaticLink.click(); + expect(pageData.deleteButton.isEnabled()).toBe(true); + pageData.deleteButton.click(); + pageData.confirmWithNameInput.sendKeys(mockVals.staticDNShostName); + pageData.deletePermanentlyButton.click(); + expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toEqual(commonFunctions.urlPath(browser.baseUrl)+"#!/delivery-services/[0-9]+/static-dns-entries"); + }); + it('should navigate back to the HTTP delivery service and delete it', function() { console.log('Deleting ' + mockVals.httpXmlId); pageData.dsLink.click(); diff --git a/traffic_portal/test/end_to_end/deliveryServices/pageData.js b/traffic_portal/test/end_to_end/deliveryServices/pageData.js index d1c5b91809..130b7fb1ba 100644 --- a/traffic_portal/test/end_to_end/deliveryServices/pageData.js +++ b/traffic_portal/test/end_to_end/deliveryServices/pageData.js @@ -20,11 +20,14 @@ module.exports = function(){ this.moreBtn=element(by.name('moreBtn')); this.viewCapabilitiesMenuItem=element(by.css('a[ng-click*=viewCapabilities]')); + this.viewStaticCapabilitiesMenuItem=element(by.css('a[ng-click*=viewStaticDnsEntries]')); this.addCapabilityBtn=element(by.name('addCapabilityBtn')); + this.addStaticDNSBtn=element(by.name('addStaticDNSBtn')); this.manageServersMenuItem=element(by.css('a[ng-click*=viewServers]')); this.selectServersBtn=element(by.name('selectServersBtn')); this.selectAllCB=element(by.id('selectAllCB')); this.dsLink=element(by.name('dsLink')); + this.dsStaticLink=element(by.name('dsStaticLink')); this.selectFormDropdown=element(by.name('selectFormDropdown')); this.selectFormSubmitButton=element(by.buttonText('Submit')); this.active=element(by.name('active')); @@ -37,10 +40,15 @@ module.exports = function(){ this.protocol=element(by.name('protocol')); this.longDesc=element(by.name('longDesc')); this.remapText=element(by.name('remapText')); + this.host=element(by.name('host')); + this.typeId=element(by.name('typeId')); + this.ttl=element(by.name('ttl')); + this.address=element(by.name('address')); this.createButton=element(by.buttonText('Create')); this.deleteButton=element(by.buttonText('Delete')); this.updateButton=element(by.buttonText('Update')); this.searchFilter=element(by.id('deliveryServicesTable_filter')).element(by.css('label input')); + this.searchStaticFilter=element(by.id('staticDnsEntriesTable_filter')).element(by.css('label input')); this.confirmWithNameInput=element(by.name('confirmWithNameInput')); this.deletePermanentlyButton=element(by.buttonText('Delete Permanently')); }; \ No newline at end of file diff --git a/traffic_portal/test/end_to_end/servers/servers-spec.js b/traffic_portal/test/end_to_end/servers/servers-spec.js index fca5bca0b0..89ff92d20f 100644 --- a/traffic_portal/test/end_to_end/servers/servers-spec.js +++ b/traffic_portal/test/end_to_end/servers/servers-spec.js @@ -34,7 +34,7 @@ describe('Traffic Portal Servers Test Suite', function() { }; it('should go to the Servers page', function() { - console.log('Looading Configure/Servers'); + console.log('Loading Configure/Servers'); browser.setLocation("servers"); expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toEqual(commonFunctions.urlPath(browser.baseUrl)+"#!/servers"); }); @@ -77,7 +77,7 @@ describe('Traffic Portal Servers Test Suite', function() { it('should verify the new Server and then update Server', function() { console.log('Verifying new server added and updating ' + mockVals.hostName); browser.sleep(1000); - element(by.cssContainingText('.ag-cell', mockVals.hostName)).click() + element(by.cssContainingText('.ag-cell', mockVals.hostName)).click(); browser.sleep(1000); pageData.domainName.clear(); pageData.domainName.sendKeys('testupdated.com'); From 5b49aceb24fac56cb489973b213b85aea96e8155 Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Mon, 3 Aug 2020 09:32:18 -0600 Subject: [PATCH 03/16] Added CHANGELOG.md --- CHANGELOG.md | 1 + .../delivery-services-spec.js | 28 +++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ad25fef69..aa0d6be32f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added the ability to view Hash ID field (aka xmppID) on Traffic Portals' server summary page ### Fixed +- Fixed #4743 - Validate absolute DNS name requirement on Static DNS entry type [Related github issue](https://github.com/apache/trafficcontrol/issues/4743) - Fixed #4848 - `GET /api/x/cdns/capacity` gives back 500, with the message `capacity was zero` - Fixed #2156 - Renaming a host in TC, does not impact xmpp_id and thereby hashid [Related github issue](https://github.com/apache/trafficcontrol/issues/2156) - Fixed #3661 - Anonymous Proxy ipv4 whitelist does not work diff --git a/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js b/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js index 07211557e6..6ddaecf046 100644 --- a/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js +++ b/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js @@ -316,20 +316,20 @@ describe('Traffic Portal Delivery Services Suite', function() { expect(pageData.displayName.getText() === "Updated display name"); }); - // it('should add a required server capability to the HTTP delivery service', function() { - // console.log('Adding required server capability to ' + mockVals.httpXmlId); - // pageData.moreBtn.click(); - // pageData.viewCapabilitiesMenuItem.click(); - // expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toMatch(commonFunctions.urlPath(browser.baseUrl)+"#!/delivery-services/[0-9]+/required-server-capabilities"); - // pageData.addCapabilityBtn.click(); - // expect(pageData.selectFormSubmitButton.isEnabled()).toBe(false); - // commonFunctions.selectDropdownbyNum(pageData.selectFormDropdown, 1); - // expect(pageData.selectFormSubmitButton.isEnabled()).toBe(true); - // pageData.selectFormSubmitButton.click(); - // element.all(by.css('tbody tr')).then(function(totalRows) { - // expect(totalRows.length).toBe(1); - // }); - // }); + it('should add a required server capability to the HTTP delivery service', function() { + console.log('Adding required server capability to ' + mockVals.httpXmlId); + pageData.moreBtn.click(); + pageData.viewCapabilitiesMenuItem.click(); + expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toMatch(commonFunctions.urlPath(browser.baseUrl)+"#!/delivery-services/[0-9]+/required-server-capabilities"); + pageData.addCapabilityBtn.click(); + expect(pageData.selectFormSubmitButton.isEnabled()).toBe(false); + commonFunctions.selectDropdownbyNum(pageData.selectFormDropdown, 1); + expect(pageData.selectFormSubmitButton.isEnabled()).toBe(true); + pageData.selectFormSubmitButton.click(); + element.all(by.css('tbody tr')).then(function(totalRows) { + expect(totalRows.length).toBe(1); + }); + }); it('should add a required Static DNS entry to the HTTP delivery service', function() { console.log('Adding Static DNS entry to ' + mockVals.httpXmlId); From 212612cdf96bbc5510bf0d0e0cb8a80eadbbef6b Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Mon, 3 Aug 2020 15:59:16 -0600 Subject: [PATCH 04/16] Updated selenium test cases --- ...e.deliveryServiceStaticDnsEntries.tpl.html | 2 +- .../delivery-services-spec.js | 21 ++----------------- .../end_to_end/deliveryServices/pageData.js | 2 -- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/traffic_portal/app/src/common/modules/table/deliveryServiceStaticDnsEntries/table.deliveryServiceStaticDnsEntries.tpl.html b/traffic_portal/app/src/common/modules/table/deliveryServiceStaticDnsEntries/table.deliveryServiceStaticDnsEntries.tpl.html index 64b2b7beca..f3cebbf6d3 100644 --- a/traffic_portal/app/src/common/modules/table/deliveryServiceStaticDnsEntries/table.deliveryServiceStaticDnsEntries.tpl.html +++ b/traffic_portal/app/src/common/modules/table/deliveryServiceStaticDnsEntries/table.deliveryServiceStaticDnsEntries.tpl.html @@ -21,7 +21,7 @@
diff --git a/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js b/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js index 6ddaecf046..c70aad19f3 100644 --- a/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js +++ b/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js @@ -332,10 +332,11 @@ describe('Traffic Portal Delivery Services Suite', function() { }); it('should add a required Static DNS entry to the HTTP delivery service', function() { + pageData.dsLink.click(); console.log('Adding Static DNS entry to ' + mockVals.httpXmlId); pageData.moreBtn.click(); pageData.viewStaticCapabilitiesMenuItem.click(); - expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toMatch(commonFunctions.urlPath(browser.baseUrl)+"#!/delivery-services/[0-9]+/static-dns-entries/?type=HTTP"); + expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toMatch(commonFunctions.urlPath(browser.baseUrl)+"#!/delivery-services/[0-9]+/static-dns-entries?type=HTTP"); pageData.addStaticDNSBtn.click(); // expect(pageData.selectFormSubmitButton.isEnabled()).toBe(false); // set host name @@ -354,24 +355,6 @@ describe('Traffic Portal Delivery Services Suite', function() { }); }); - it('should delete the Static DNS entry', function() { - console.log('Deleting the Static DNS entry for ' + mockVals.httpXmlId); - // pageData.searchStaticFilter.clear().then(function () { - // pageData.searchStaticFilter.sendKeys(mockVals.staticDNShostName); - // }); - // element.all(by.repeater('s in ::staticDnsEntries')).filter(function(row){ - // return row.element(by.name('::s.host')).getText().then(function(val){ - // return val.toString() === mockVals.staticDNShostName.toString(); - // }); - // }).get(0).click(); - pageData.dsStaticLink.click(); - expect(pageData.deleteButton.isEnabled()).toBe(true); - pageData.deleteButton.click(); - pageData.confirmWithNameInput.sendKeys(mockVals.staticDNShostName); - pageData.deletePermanentlyButton.click(); - expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toEqual(commonFunctions.urlPath(browser.baseUrl)+"#!/delivery-services/[0-9]+/static-dns-entries"); - }); - it('should navigate back to the HTTP delivery service and delete it', function() { console.log('Deleting ' + mockVals.httpXmlId); pageData.dsLink.click(); diff --git a/traffic_portal/test/end_to_end/deliveryServices/pageData.js b/traffic_portal/test/end_to_end/deliveryServices/pageData.js index 130b7fb1ba..1b9198483a 100644 --- a/traffic_portal/test/end_to_end/deliveryServices/pageData.js +++ b/traffic_portal/test/end_to_end/deliveryServices/pageData.js @@ -27,7 +27,6 @@ module.exports = function(){ this.selectServersBtn=element(by.name('selectServersBtn')); this.selectAllCB=element(by.id('selectAllCB')); this.dsLink=element(by.name('dsLink')); - this.dsStaticLink=element(by.name('dsStaticLink')); this.selectFormDropdown=element(by.name('selectFormDropdown')); this.selectFormSubmitButton=element(by.buttonText('Submit')); this.active=element(by.name('active')); @@ -48,7 +47,6 @@ module.exports = function(){ this.deleteButton=element(by.buttonText('Delete')); this.updateButton=element(by.buttonText('Update')); this.searchFilter=element(by.id('deliveryServicesTable_filter')).element(by.css('label input')); - this.searchStaticFilter=element(by.id('staticDnsEntriesTable_filter')).element(by.css('label input')); this.confirmWithNameInput=element(by.name('confirmWithNameInput')); this.deletePermanentlyButton=element(by.buttonText('Delete Permanently')); }; \ No newline at end of file From b9cdba9774393f12c44a9bddf1bfb4b385cd7910 Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Mon, 3 Aug 2020 16:23:03 -0600 Subject: [PATCH 05/16] Updated end-to-end test case. Removed patten from LocationUtil and added to DeliveryServiceUtils. --- .../FormDeliveryServiceStaticDnsEntryController.js | 6 +++--- .../app/src/common/service/utils/DeliveryServiceUtils.js | 4 ++++ .../app/src/common/service/utils/LocationUtils.js | 5 ----- .../end_to_end/deliveryServices/delivery-services-spec.js | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/FormDeliveryServiceStaticDnsEntryController.js b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/FormDeliveryServiceStaticDnsEntryController.js index 2ab249799b..5fae673f9b 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/FormDeliveryServiceStaticDnsEntryController.js +++ b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/FormDeliveryServiceStaticDnsEntryController.js @@ -17,8 +17,8 @@ * under the License. */ -var FormDeliveryServiceStaticDnsEntryController = function(deliveryService, staticDnsEntry, $scope, formUtils, locationUtils, typeService, cacheGroupService) { - $scope.StaticDNSPattern = locationUtils.StaticDNSPattern; +var FormDeliveryServiceStaticDnsEntryController = function(deliveryService, staticDnsEntry, $scope, formUtils, locationUtils, deliveryServiceUtils, typeService, cacheGroupService) { + $scope.StaticDNSPattern = deliveryServiceUtils.StaticDNSPattern; var getTypes = function() { typeService.getTypes({ useInTable: 'staticdnsentry' }) @@ -44,5 +44,5 @@ var FormDeliveryServiceStaticDnsEntryController = function(deliveryService, stat }; -FormDeliveryServiceStaticDnsEntryController.$inject = ['deliveryService', 'staticDnsEntry', '$scope', 'formUtils', 'locationUtils', 'typeService', 'cacheGroupService']; +FormDeliveryServiceStaticDnsEntryController.$inject = ['deliveryService', 'staticDnsEntry', '$scope', 'formUtils', 'locationUtils', 'deliveryServiceUtils', 'typeService', 'cacheGroupService']; module.exports = FormDeliveryServiceStaticDnsEntryController; diff --git a/traffic_portal/app/src/common/service/utils/DeliveryServiceUtils.js b/traffic_portal/app/src/common/service/utils/DeliveryServiceUtils.js index 601ceae95f..b9b3910704 100644 --- a/traffic_portal/app/src/common/service/utils/DeliveryServiceUtils.js +++ b/traffic_portal/app/src/common/service/utils/DeliveryServiceUtils.js @@ -50,6 +50,10 @@ var DeliveryServiceUtils = function($window, propertiesModel) { 3: "slice" }; + // ... this one allows Static DNS entries with only a trailing period + // Source of regex: https://stackoverflow.com/questions/10306690/what-is-a-regular-expression-which-will-match-a-valid-domain-name-without-a-subd/41193739#comment73159724_41193739 + this.StaticDNSPattern = /^(?=.{1,253}\.?$)(?:(?!-|[^.]+_)[A-Za-z0-9-_]{1,63}(?:\.)){2,}$/; + this.openCharts = function(ds) { $window.open( propertiesModel.properties.deliveryServices.charts.customLink.baseUrl + ds.xmlId, diff --git a/traffic_portal/app/src/common/service/utils/LocationUtils.js b/traffic_portal/app/src/common/service/utils/LocationUtils.js index 2ee3e10b0f..beee97e4e4 100644 --- a/traffic_portal/app/src/common/service/utils/LocationUtils.js +++ b/traffic_portal/app/src/common/service/utils/LocationUtils.js @@ -19,11 +19,6 @@ var LocationUtils = function($location, $uibModal) { - // ... this one allows Static DNS entries with only a trailing period - this.StaticDNSPattern = /^(?=.{1,253}\.?$)(?:(?!-|[^.]+_)[A-Za-z0-9-_]{1,63}(?:\.)){2,}$/; - // actual regex: /^(?=.{1,253}\.?$)(?:(?!-|[^.]+_)[A-Za-z0-9-_]{1,63}(? Date: Thu, 6 Aug 2020 09:53:38 -0600 Subject: [PATCH 06/16] Removed regex patten from DeliveryServiceUtils and added logic to TO, to ensure both API calls and TP behave the same. --- .../traffic_ops_golang/staticdnsentry/staticdnsentry.go | 6 ++++++ .../FormDeliveryServiceStaticDnsEntryController.js | 5 ++--- .../form.deliveryServiceStaticDnsEntry.tpl.html | 5 ++--- .../app/src/common/service/utils/DeliveryServiceUtils.js | 4 ---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go b/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go index 7c5f30b693..12b74ba7ed 100644 --- a/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go +++ b/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go @@ -20,6 +20,7 @@ package staticdnsentry */ import ( + "fmt" "net/http" "strconv" "time" @@ -103,6 +104,11 @@ func (staticDNSEntry TOStaticDNSEntry) Validate() error { addressErr = validation.Validate(staticDNSEntry.Address, validation.Required, is.IPv6) case "CNAME_RECORD": addressErr = validation.Validate(staticDNSEntry.Address, validation.Required, is.DNSName) + address := *staticDNSEntry.Address + lastChar := address[len(address)-1:] + if lastChar != "." { + addressErr = fmt.Errorf("must be a valid DNS entry. Missing a trailing period at the end") + } default: addressErr = validation.Validate(staticDNSEntry.Address, validation.Required) } diff --git a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/FormDeliveryServiceStaticDnsEntryController.js b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/FormDeliveryServiceStaticDnsEntryController.js index 5fae673f9b..949c61c467 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/FormDeliveryServiceStaticDnsEntryController.js +++ b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/FormDeliveryServiceStaticDnsEntryController.js @@ -17,8 +17,7 @@ * under the License. */ -var FormDeliveryServiceStaticDnsEntryController = function(deliveryService, staticDnsEntry, $scope, formUtils, locationUtils, deliveryServiceUtils, typeService, cacheGroupService) { - $scope.StaticDNSPattern = deliveryServiceUtils.StaticDNSPattern; +var FormDeliveryServiceStaticDnsEntryController = function(deliveryService, staticDnsEntry, $scope, formUtils, locationUtils, typeService, cacheGroupService) { var getTypes = function() { typeService.getTypes({ useInTable: 'staticdnsentry' }) @@ -44,5 +43,5 @@ var FormDeliveryServiceStaticDnsEntryController = function(deliveryService, stat }; -FormDeliveryServiceStaticDnsEntryController.$inject = ['deliveryService', 'staticDnsEntry', '$scope', 'formUtils', 'locationUtils', 'deliveryServiceUtils', 'typeService', 'cacheGroupService']; +FormDeliveryServiceStaticDnsEntryController.$inject = ['deliveryService', 'staticDnsEntry', '$scope', 'formUtils', 'locationUtils', 'typeService', 'cacheGroupService']; module.exports = FormDeliveryServiceStaticDnsEntryController; diff --git a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html index ef7b6df3f1..0fce239485 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html +++ b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html @@ -58,13 +58,12 @@
- + Required - Invalid Address
diff --git a/traffic_portal/app/src/common/service/utils/DeliveryServiceUtils.js b/traffic_portal/app/src/common/service/utils/DeliveryServiceUtils.js index b9b3910704..601ceae95f 100644 --- a/traffic_portal/app/src/common/service/utils/DeliveryServiceUtils.js +++ b/traffic_portal/app/src/common/service/utils/DeliveryServiceUtils.js @@ -50,10 +50,6 @@ var DeliveryServiceUtils = function($window, propertiesModel) { 3: "slice" }; - // ... this one allows Static DNS entries with only a trailing period - // Source of regex: https://stackoverflow.com/questions/10306690/what-is-a-regular-expression-which-will-match-a-valid-domain-name-without-a-subd/41193739#comment73159724_41193739 - this.StaticDNSPattern = /^(?=.{1,253}\.?$)(?:(?!-|[^.]+_)[A-Za-z0-9-_]{1,63}(?:\.)){2,}$/; - this.openCharts = function(ds) { $window.open( propertiesModel.properties.deliveryServices.charts.customLink.baseUrl + ds.xmlId, From 2b2c326c31200d42a9904ddfd5e4e122040ecea4 Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Thu, 6 Aug 2020 10:15:03 -0600 Subject: [PATCH 07/16] Updated documentation --- docs/source/api/v2/staticdnsentries.rst | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/source/api/v2/staticdnsentries.rst b/docs/source/api/v2/staticdnsentries.rst index afae0a74a9..b96c2d98ac 100644 --- a/docs/source/api/v2/staticdnsentries.rst +++ b/docs/source/api/v2/staticdnsentries.rst @@ -75,7 +75,7 @@ Request Structure Response Structure ------------------ -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server, otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server with a trailing period, otherwise it is the IP address to which ``host`` shall be resolved :cachegroup: An optional string containing the :ref:`Name of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -109,7 +109,7 @@ Response Structure { "response": [ { - "address": "foo.bar", + "address": "foo.bar.", "cachegroup": null, "cachegroupId": null, "deliveryservice": "demo1", @@ -119,7 +119,7 @@ Response Structure "lastUpdated": "2018-12-10 19:59:56+00", "ttl": 300, "type": "CNAME_RECORD", - "typeId": 40 + "typeId": 41 } ]} @@ -133,7 +133,7 @@ Creates a new, static DNS entry. Request Structure ----------------- -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server, otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server that is required to end with a trailing period (eg:cdn.test.com. is the right usage but cdn.test.com will error), otherwise it is the IP address to which ``host`` shall be resolved :cachegroupId: An optional, integer that is the :ref:`ID of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -155,16 +155,16 @@ Request Structure Content-Type: application/json { - "address": "test.quest", + "address": "test.quest.", "deliveryserviceId": 1, "host": "test", "ttl": 300, - "typeId": 40 + "typeId": 41 } Response Structure ------------------ -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server, otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server with a trailing period, otherwise it is the IP address to which ``host`` shall be resolved :cachegroup: An optional string containing the :ref:`Name of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -203,7 +203,7 @@ Response Structure } ], "response": { - "address": "test.quest", + "address": "test.quest.", "cachegroup": null, "cachegroupId": null, "deliveryservice": null, @@ -213,7 +213,7 @@ Response Structure "lastUpdated": "2018-12-10 19:54:19+00", "ttl": 300, "type": null, - "typeId": 40 + "typeId": 41 }} ``PUT`` @@ -234,7 +234,7 @@ Request Structure | id | The integral, unique identifier of the static DNS entry to modify | +------+-------------------------------------------------------------------+ -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server, otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server that is required to end with a trailing period (eg:cdn.test.com. is right usage but cdn.test.com will error), otherwise it is the IP address to which ``host`` shall be resolved :cachegroupId: An optional, integer that is the :ref:`ID of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -256,16 +256,16 @@ Request Structure Content-Type: application/json { - "address": "foo.bar", + "address": "foo.bar.", "deliveryserviceId": 1, "host": "test", "ttl": 300, - "typeId": 40 + "typeId": 41 } Response Structure ------------------ -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server, otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server with a trailing period, otherwise it is the IP address to which ``host`` shall be resolved :cachegroup: An optional string containing the :ref:`Name of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -304,7 +304,7 @@ Response Structure } ], "response": { - "address": "foo.bar", + "address": "foo.bar.", "cachegroup": null, "cachegroupId": null, "deliveryservice": null, @@ -314,7 +314,7 @@ Response Structure "lastUpdated": "2018-12-10 19:59:56+00", "ttl": 300, "type": null, - "typeId": 40 + "typeId": 41 }} From c89b45cbff5c86e2fa284d1445148b146e78885f Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Thu, 6 Aug 2020 18:01:18 -0600 Subject: [PATCH 08/16] Added api test case for Update() --- docs/source/api/v2/staticdnsentries.rst | 4 +-- docs/source/api/v3/staticdnsentries.rst | 30 +++++++++---------- .../testing/api/v2/staticdnsentries_test.go | 22 ++++++++++++-- .../testing/api/v3/staticdnsentries_test.go | 24 ++++++++++++--- .../staticdnsentry/staticdnsentry.go | 4 +-- 5 files changed, 58 insertions(+), 26 deletions(-) diff --git a/docs/source/api/v2/staticdnsentries.rst b/docs/source/api/v2/staticdnsentries.rst index b96c2d98ac..35e3a22061 100644 --- a/docs/source/api/v2/staticdnsentries.rst +++ b/docs/source/api/v2/staticdnsentries.rst @@ -133,7 +133,7 @@ Creates a new, static DNS entry. Request Structure ----------------- -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server that is required to end with a trailing period (eg:cdn.test.com. is the right usage but cdn.test.com will error), otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server that is required to end with a trailing period (eg:cdn.test.com. is the right usage but cdn.test.com will throw an error), otherwise it is the IP address to which ``host`` shall be resolved :cachegroupId: An optional, integer that is the :ref:`ID of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -234,7 +234,7 @@ Request Structure | id | The integral, unique identifier of the static DNS entry to modify | +------+-------------------------------------------------------------------+ -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server that is required to end with a trailing period (eg:cdn.test.com. is right usage but cdn.test.com will error), otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server that is required to end with a trailing period (eg:cdn.test.com. is right usage but cdn.test.com will throw an error), otherwise it is the IP address to which ``host`` shall be resolved :cachegroupId: An optional, integer that is the :ref:`ID of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. diff --git a/docs/source/api/v3/staticdnsentries.rst b/docs/source/api/v3/staticdnsentries.rst index 57ce60ab38..52a4750691 100644 --- a/docs/source/api/v3/staticdnsentries.rst +++ b/docs/source/api/v3/staticdnsentries.rst @@ -75,7 +75,7 @@ Request Structure Response Structure ------------------ -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server, otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server with a trailing period, otherwise it is the IP address to which ``host`` shall be resolved :cachegroup: An optional string containing the :ref:`Name of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -109,7 +109,7 @@ Response Structure { "response": [ { - "address": "foo.bar", + "address": "foo.bar.", "cachegroup": null, "cachegroupId": null, "deliveryservice": "demo1", @@ -119,7 +119,7 @@ Response Structure "lastUpdated": "2018-12-10 19:59:56+00", "ttl": 300, "type": "CNAME_RECORD", - "typeId": 40 + "typeId": 41 } ]} @@ -133,7 +133,7 @@ Creates a new, static DNS entry. Request Structure ----------------- -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server, otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server that is required to end with a trailing period (eg:cdn.test.com. is the right usage but cdn.test.com will throw an error), otherwise it is the IP address to which ``host`` shall be resolved :cachegroupId: An optional, integer that is the :ref:`ID of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -155,16 +155,16 @@ Request Structure Content-Type: application/json { - "address": "test.quest", + "address": "test.quest.", "deliveryserviceId": 1, "host": "test", "ttl": 300, - "typeId": 40 + "typeId": 41 } Response Structure ------------------ -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server, otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server with a trailing period, otherwise it is the IP address to which ``host`` shall be resolved :cachegroup: An optional string containing the :ref:`Name of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -203,7 +203,7 @@ Response Structure } ], "response": { - "address": "test.quest", + "address": "test.quest.", "cachegroup": null, "cachegroupId": null, "deliveryservice": null, @@ -213,7 +213,7 @@ Response Structure "lastUpdated": "2018-12-10 19:54:19+00", "ttl": 300, "type": null, - "typeId": 40 + "typeId": 41 }} ``PUT`` @@ -234,7 +234,7 @@ Request Structure | id | The integral, unique identifier of the static DNS entry to modify | +------+-------------------------------------------------------------------+ -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server, otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server that is required to end with a trailing period (eg:cdn.test.com. is right usage but cdn.test.com will throw an error), otherwise it is the IP address to which ``host`` shall be resolved :cachegroupId: An optional, integer that is the :ref:`ID of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -256,16 +256,16 @@ Request Structure Content-Type: application/json { - "address": "foo.bar", + "address": "foo.bar.", "deliveryserviceId": 1, "host": "test", "ttl": 300, - "typeId": 40 + "typeId": 41 } Response Structure ------------------ -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server, otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server with a trailing period, otherwise it is the IP address to which ``host`` shall be resolved :cachegroup: An optional string containing the :ref:`Name of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -304,7 +304,7 @@ Response Structure } ], "response": { - "address": "foo.bar", + "address": "foo.bar.", "cachegroup": null, "cachegroupId": null, "deliveryservice": null, @@ -314,7 +314,7 @@ Response Structure "lastUpdated": "2018-12-10 19:59:56+00", "ttl": 300, "type": null, - "typeId": 40 + "typeId": 41 }} diff --git a/traffic_ops/testing/api/v2/staticdnsentries_test.go b/traffic_ops/testing/api/v2/staticdnsentries_test.go index 41c2fa0178..dda7bc974e 100644 --- a/traffic_ops/testing/api/v2/staticdnsentries_test.go +++ b/traffic_ops/testing/api/v2/staticdnsentries_test.go @@ -74,7 +74,11 @@ func UpdateTestStaticDNSEntries(t *testing.T) { func UpdateTestStaticDNSEntriesInvalidAddress(t *testing.T) { - expectedAlerts := []tc.Alerts{tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid IPv4 address", "error"}}}, tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid DNS name", "error"}}}, tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid IPv6 address", "error"}}}} + expectedAlerts := []tc.Alerts{ + tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid IPv4 address", "error"}}}, + tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid DNS name", "error"}}}, + tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid DNS name. Missing a trailing period at the end", "error"}}}, + tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid IPv6 address", "error"}}}} // A_RECORD firstStaticDNSEntry := testData.StaticDNSEntries[0] @@ -116,6 +120,18 @@ func UpdateTestStaticDNSEntriesInvalidAddress(t *testing.T) { t.Errorf("got alerts: %v but expected alerts: %v", alert, expectedAlerts[1]) } + //CNAME_RECORD: missing a trailing period + expectedAddressMissingPeriod := "cdn.test.com" + remoteStaticDNSEntry.Address = expectedAddressMissingPeriod + alert, _, status, err = TOSession.UpdateStaticDNSEntryByID(remoteStaticDNSEntry.ID, remoteStaticDNSEntry) + t.Log("Status Code [expect 400]: ", status) + if err != nil { + t.Logf("cannot UPDATE StaticDNSEntries using url: %v - %v\n", err, alert) + } + if !reflect.DeepEqual(alert, expectedAlerts[2]) { + t.Errorf("got alerts: %v but expected alerts: %v", alert, expectedAlerts[2]) + } + // AAAA_RECORD thirdStaticDNSEntry := testData.StaticDNSEntries[2] // Retrieve the StaticDNSEntries by name so we can get the id for the Update @@ -131,8 +147,8 @@ func UpdateTestStaticDNSEntriesInvalidAddress(t *testing.T) { if err != nil { t.Logf("cannot UPDATE StaticDNSEntries using url: %v - %v\n", err, alert) } - if !reflect.DeepEqual(alert, expectedAlerts[2]) { - t.Errorf("got alerts: %v but expected alerts: %v", alert, expectedAlerts[2]) + if !reflect.DeepEqual(alert, expectedAlerts[3]) { + t.Errorf("got alerts: %v but expected alerts: %v", alert, expectedAlerts[3]) } } diff --git a/traffic_ops/testing/api/v3/staticdnsentries_test.go b/traffic_ops/testing/api/v3/staticdnsentries_test.go index 85811d323a..94ee24ba13 100644 --- a/traffic_ops/testing/api/v3/staticdnsentries_test.go +++ b/traffic_ops/testing/api/v3/staticdnsentries_test.go @@ -69,7 +69,7 @@ func GetTestStaticDNSEntriesIMSAfterChange(t *testing.T, header http.Header) { func GetTestStaticDNSEntriesIMS(t *testing.T) { var header http.Header header = make(map[string][]string) - futureTime := time.Now().AddDate(0,0,1) + futureTime := time.Now().AddDate(0, 0, 1) time := futureTime.Format(time.RFC1123) header.Set(rfc.IfModifiedSince, time) @@ -128,7 +128,11 @@ func UpdateTestStaticDNSEntries(t *testing.T) { func UpdateTestStaticDNSEntriesInvalidAddress(t *testing.T) { - expectedAlerts := []tc.Alerts{tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid IPv4 address", "error"}}}, tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid DNS name", "error"}}}, tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid IPv6 address", "error"}}}} + expectedAlerts := []tc.Alerts{ + tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid IPv4 address", "error"}}}, + tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid DNS name", "error"}}}, + tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid DNS name. Missing a trailing period at the end", "error"}}}, + tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid IPv6 address", "error"}}}} // A_RECORD firstStaticDNSEntry := testData.StaticDNSEntries[0] @@ -170,6 +174,18 @@ func UpdateTestStaticDNSEntriesInvalidAddress(t *testing.T) { t.Errorf("got alerts: %v but expected alerts: %v", alert, expectedAlerts[1]) } + //CNAME_RECORD: missing a trailing period + expectedAddressMissingPeriod := "cdn.test.com" + remoteStaticDNSEntry.Address = expectedAddressMissingPeriod + alert, _, status, err = TOSession.UpdateStaticDNSEntryByID(remoteStaticDNSEntry.ID, remoteStaticDNSEntry) + t.Log("Status Code [expect 400]: ", status) + if err != nil { + t.Logf("cannot UPDATE StaticDNSEntries using url: %v - %v\n", err, alert) + } + if !reflect.DeepEqual(alert, expectedAlerts[2]) { + t.Errorf("got alerts: %v but expected alerts: %v", alert, expectedAlerts[2]) + } + // AAAA_RECORD thirdStaticDNSEntry := testData.StaticDNSEntries[2] // Retrieve the StaticDNSEntries by name so we can get the id for the Update @@ -185,8 +201,8 @@ func UpdateTestStaticDNSEntriesInvalidAddress(t *testing.T) { if err != nil { t.Logf("cannot UPDATE StaticDNSEntries using url: %v - %v\n", err, alert) } - if !reflect.DeepEqual(alert, expectedAlerts[2]) { - t.Errorf("got alerts: %v but expected alerts: %v", alert, expectedAlerts[2]) + if !reflect.DeepEqual(alert, expectedAlerts[3]) { + t.Errorf("got alerts: %v but expected alerts: %v", alert, expectedAlerts[3]) } } diff --git a/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go b/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go index 12b74ba7ed..e37473c914 100644 --- a/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go +++ b/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go @@ -106,8 +106,8 @@ func (staticDNSEntry TOStaticDNSEntry) Validate() error { addressErr = validation.Validate(staticDNSEntry.Address, validation.Required, is.DNSName) address := *staticDNSEntry.Address lastChar := address[len(address)-1:] - if lastChar != "." { - addressErr = fmt.Errorf("must be a valid DNS entry. Missing a trailing period at the end") + if lastChar != "." && addressErr == nil { + addressErr = fmt.Errorf("must be a valid DNS name. Missing a trailing period at the end") } default: addressErr = validation.Validate(staticDNSEntry.Address, validation.Required) From 9edc6813a2e9bb45cedd02aca59d72b7259553b3 Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Fri, 7 Aug 2020 08:46:22 -0600 Subject: [PATCH 09/16] Updated html page for staticDNSEntry --- CHANGELOG.md | 2 +- .../form.deliveryServiceStaticDnsEntry.tpl.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a500adffc..788f40c8c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added debugging functionality to CDN-in-a-Box for Traffic Stats. ### Fixed -- Fixed #4743 - Validate absolute DNS name requirement on Static DNS entry type [Related github issue](https://github.com/apache/trafficcontrol/issues/4743) +- Fixed #4743 - Validate absolute DNS name requirement on Static DNS entry for CNAME type [Related github issue](https://github.com/apache/trafficcontrol/issues/4743) - Fixed #4848 - `GET /api/x/cdns/capacity` gives back 500, with the message `capacity was zero` - Fixed #2156 - Renaming a host in TC, does not impact xmpp_id and thereby hashid [Related github issue](https://github.com/apache/trafficcontrol/issues/2156) - Fixed #3661 - Anonymous Proxy ipv4 whitelist does not work diff --git a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html index 0fce239485..281b5cc478 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html +++ b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html @@ -62,7 +62,7 @@
- + Required
From 97b92fb2fce564d6fcacdaf3b68717ea1874b0c5 Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Fri, 7 Aug 2020 12:39:44 -0600 Subject: [PATCH 10/16] Updated code per PR review comments. --- docs/source/api/v2/staticdnsentries.rst | 6 +++--- docs/source/api/v3/staticdnsentries.rst | 8 ++++---- traffic_ops/testing/api/v2/staticdnsentries_test.go | 2 +- traffic_ops/testing/api/v3/staticdnsentries_test.go | 2 +- .../staticdnsentry/staticdnsentry.go | 2 +- .../form.deliveryServiceStaticDnsEntry.tpl.html | 10 ++++++++-- .../deliveryServices/delivery-services-spec.js | 7 +++---- .../test/end_to_end/deliveryServices/pageData.js | 13 +++++++------ 8 files changed, 28 insertions(+), 22 deletions(-) diff --git a/docs/source/api/v2/staticdnsentries.rst b/docs/source/api/v2/staticdnsentries.rst index 35e3a22061..6dc7c0640f 100644 --- a/docs/source/api/v2/staticdnsentries.rst +++ b/docs/source/api/v2/staticdnsentries.rst @@ -133,7 +133,7 @@ Creates a new, static DNS entry. Request Structure ----------------- -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server that is required to end with a trailing period (eg:cdn.test.com. is the right usage but cdn.test.com will throw an error), otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server with a trailing period, otherwise it is the IP address to which ``host`` shall be resolved :cachegroupId: An optional, integer that is the :ref:`ID of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -212,7 +212,7 @@ Response Structure "id": 2, "lastUpdated": "2018-12-10 19:54:19+00", "ttl": 300, - "type": null, + "type": "CNAME_RECORD", "typeId": 41 }} @@ -234,7 +234,7 @@ Request Structure | id | The integral, unique identifier of the static DNS entry to modify | +------+-------------------------------------------------------------------+ -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server that is required to end with a trailing period (eg:cdn.test.com. is right usage but cdn.test.com will throw an error), otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server with a trailing period, otherwise it is the IP address to which ``host`` shall be resolved :cachegroupId: An optional, integer that is the :ref:`ID of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. diff --git a/docs/source/api/v3/staticdnsentries.rst b/docs/source/api/v3/staticdnsentries.rst index 52a4750691..039ed51251 100644 --- a/docs/source/api/v3/staticdnsentries.rst +++ b/docs/source/api/v3/staticdnsentries.rst @@ -133,7 +133,7 @@ Creates a new, static DNS entry. Request Structure ----------------- -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server that is required to end with a trailing period (eg:cdn.test.com. is the right usage but cdn.test.com will throw an error), otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server with a trailing period, otherwise it is the IP address to which ``host`` shall be resolved :cachegroupId: An optional, integer that is the :ref:`ID of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -212,7 +212,7 @@ Response Structure "id": 2, "lastUpdated": "2018-12-10 19:54:19+00", "ttl": 300, - "type": null, + "type": "CNAME_RECORD", "typeId": 41 }} @@ -234,7 +234,7 @@ Request Structure | id | The integral, unique identifier of the static DNS entry to modify | +------+-------------------------------------------------------------------+ -:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server that is required to end with a trailing period (eg:cdn.test.com. is right usage but cdn.test.com will throw an error), otherwise it is the IP address to which ``host`` shall be resolved +:address: If ``typeId`` identifies a ``CNAME`` type record, this is the Canonical Name (CNAME) of the server with a trailing period, otherwise it is the IP address to which ``host`` shall be resolved :cachegroupId: An optional, integer that is the :ref:`ID of a Cache Group ` which will service this static DNS entry .. note:: This field has no effect, and is not used by any part of Traffic Control. It exists for legacy compatibility reasons. @@ -313,7 +313,7 @@ Response Structure "id": 2, "lastUpdated": "2018-12-10 19:59:56+00", "ttl": 300, - "type": null, + "type": "CNAME_RECORD", "typeId": 41 }} diff --git a/traffic_ops/testing/api/v2/staticdnsentries_test.go b/traffic_ops/testing/api/v2/staticdnsentries_test.go index dda7bc974e..0bedbfa113 100644 --- a/traffic_ops/testing/api/v2/staticdnsentries_test.go +++ b/traffic_ops/testing/api/v2/staticdnsentries_test.go @@ -77,7 +77,7 @@ func UpdateTestStaticDNSEntriesInvalidAddress(t *testing.T) { expectedAlerts := []tc.Alerts{ tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid IPv4 address", "error"}}}, tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid DNS name", "error"}}}, - tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid DNS name. Missing a trailing period at the end", "error"}}}, + tc.Alerts{[]tc.Alert{tc.Alert{"'address' for type: CNAME_RECORD must have a trailing period", "error"}}}, tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid IPv6 address", "error"}}}} // A_RECORD diff --git a/traffic_ops/testing/api/v3/staticdnsentries_test.go b/traffic_ops/testing/api/v3/staticdnsentries_test.go index 94ee24ba13..46d7149713 100644 --- a/traffic_ops/testing/api/v3/staticdnsentries_test.go +++ b/traffic_ops/testing/api/v3/staticdnsentries_test.go @@ -131,7 +131,7 @@ func UpdateTestStaticDNSEntriesInvalidAddress(t *testing.T) { expectedAlerts := []tc.Alerts{ tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid IPv4 address", "error"}}}, tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid DNS name", "error"}}}, - tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid DNS name. Missing a trailing period at the end", "error"}}}, + tc.Alerts{[]tc.Alert{tc.Alert{"'address' for type: CNAME_RECORD must have a trailing period", "error"}}}, tc.Alerts{[]tc.Alert{tc.Alert{"'address' must be a valid IPv6 address", "error"}}}} // A_RECORD diff --git a/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go b/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go index e37473c914..8207d07d5a 100644 --- a/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go +++ b/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go @@ -107,7 +107,7 @@ func (staticDNSEntry TOStaticDNSEntry) Validate() error { address := *staticDNSEntry.Address lastChar := address[len(address)-1:] if lastChar != "." && addressErr == nil { - addressErr = fmt.Errorf("must be a valid DNS name. Missing a trailing period at the end") + addressErr = fmt.Errorf("for type: CNAME_RECORD must have a trailing period") } default: addressErr = validation.Validate(staticDNSEntry.Address, validation.Required) diff --git a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html index 281b5cc478..6db9fc3c5f 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html +++ b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html @@ -58,11 +58,17 @@
- + Required
diff --git a/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js b/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js index 933d80a236..90ffb25787 100644 --- a/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js +++ b/traffic_portal/test/end_to_end/deliveryServices/delivery-services-spec.js @@ -338,12 +338,11 @@ describe('Traffic Portal Delivery Services Suite', function() { pageData.viewStaticCapabilitiesMenuItem.click(); expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toMatch(commonFunctions.urlPath(browser.baseUrl)+"#!/delivery-services/[0-9]+/static-dns-entries"); pageData.addStaticDNSBtn.click(); - // expect(pageData.selectFormSubmitButton.isEnabled()).toBe(false); // set host name pageData.host.sendKeys(mockVals.staticDNShostName); - // set type ID - pageData.typeId.click(); - commonFunctions.selectDropdownbyNum(pageData.typeId, 3); + // set type ID to CNAME_RECORD's id + pageData.staticDNStypeId.click(); + commonFunctions.selectDropdownbyNum(pageData.staticDNStypeId, 3); // set ttl pageData.ttl.sendKeys(mockVals.staticDNSTTL); // set address diff --git a/traffic_portal/test/end_to_end/deliveryServices/pageData.js b/traffic_portal/test/end_to_end/deliveryServices/pageData.js index 1b9198483a..9df8a01fe6 100644 --- a/traffic_portal/test/end_to_end/deliveryServices/pageData.js +++ b/traffic_portal/test/end_to_end/deliveryServices/pageData.js @@ -19,10 +19,8 @@ module.exports = function(){ this.moreBtn=element(by.name('moreBtn')); - this.viewCapabilitiesMenuItem=element(by.css('a[ng-click*=viewCapabilities]')); this.viewStaticCapabilitiesMenuItem=element(by.css('a[ng-click*=viewStaticDnsEntries]')); this.addCapabilityBtn=element(by.name('addCapabilityBtn')); - this.addStaticDNSBtn=element(by.name('addStaticDNSBtn')); this.manageServersMenuItem=element(by.css('a[ng-click*=viewServers]')); this.selectServersBtn=element(by.name('selectServersBtn')); this.selectAllCB=element(by.id('selectAllCB')); @@ -39,14 +37,17 @@ module.exports = function(){ this.protocol=element(by.name('protocol')); this.longDesc=element(by.name('longDesc')); this.remapText=element(by.name('remapText')); - this.host=element(by.name('host')); - this.typeId=element(by.name('typeId')); - this.ttl=element(by.name('ttl')); - this.address=element(by.name('address')); this.createButton=element(by.buttonText('Create')); this.deleteButton=element(by.buttonText('Delete')); this.updateButton=element(by.buttonText('Update')); this.searchFilter=element(by.id('deliveryServicesTable_filter')).element(by.css('label input')); this.confirmWithNameInput=element(by.name('confirmWithNameInput')); this.deletePermanentlyButton=element(by.buttonText('Delete Permanently')); + // delivery service static dns entry fields + this.viewCapabilitiesMenuItem=element(by.css('a[ng-click*=viewCapabilities]')); + this.addStaticDNSBtn=element(by.name('addStaticDNSBtn')); + this.host=element(by.name('host')); + this.staticDNStypeId=element(by.name('typeId')); + this.ttl=element(by.name('ttl')); + this.address=element(by.name('address')); }; \ No newline at end of file From 29dedc429bba5c03ed4f5b9ec21fe1dbe288cb52 Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Fri, 7 Aug 2020 13:04:03 -0600 Subject: [PATCH 11/16] Checking for address length. --- .../traffic_ops_golang/staticdnsentry/staticdnsentry.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go b/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go index 8207d07d5a..f6bdcd32d3 100644 --- a/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go +++ b/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go @@ -105,9 +105,11 @@ func (staticDNSEntry TOStaticDNSEntry) Validate() error { case "CNAME_RECORD": addressErr = validation.Validate(staticDNSEntry.Address, validation.Required, is.DNSName) address := *staticDNSEntry.Address - lastChar := address[len(address)-1:] - if lastChar != "." && addressErr == nil { - addressErr = fmt.Errorf("for type: CNAME_RECORD must have a trailing period") + if len(address) != 0 { + lastChar := address[len(address)-1:] + if lastChar != "." && addressErr == nil { + addressErr = fmt.Errorf("for type: CNAME_RECORD must have a trailing period") + } } default: addressErr = validation.Validate(staticDNSEntry.Address, validation.Required) From b8aae9264bf43045795f96d267af55885780ac71 Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Fri, 7 Aug 2020 13:22:56 -0600 Subject: [PATCH 12/16] Keeping it simple and short --- .../traffic_ops_golang/staticdnsentry/staticdnsentry.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go b/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go index f6bdcd32d3..a0e0e04a55 100644 --- a/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go +++ b/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go @@ -105,9 +105,9 @@ func (staticDNSEntry TOStaticDNSEntry) Validate() error { case "CNAME_RECORD": addressErr = validation.Validate(staticDNSEntry.Address, validation.Required, is.DNSName) address := *staticDNSEntry.Address - if len(address) != 0 { + if addressErr == nil { lastChar := address[len(address)-1:] - if lastChar != "." && addressErr == nil { + if lastChar != "." { addressErr = fmt.Errorf("for type: CNAME_RECORD must have a trailing period") } } From ed53815597df78e9fd5389785e3c1505e54581b4 Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Tue, 11 Aug 2020 08:44:42 -0600 Subject: [PATCH 13/16] Used correct html tags. --- .../form.deliveryServiceStaticDnsEntry.tpl.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html index 6db9fc3c5f..89ecfeeffe 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html +++ b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html @@ -59,10 +59,12 @@
From 3f47be3e190fa7442a92d1eed5aed0371178ab2b Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Tue, 11 Aug 2020 09:45:03 -0600 Subject: [PATCH 14/16] Re-worded a sentence. --- .../form.deliveryServiceStaticDnsEntry.tpl.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html index 89ecfeeffe..a91f0b1946 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html +++ b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html @@ -62,7 +62,7 @@
  • Type:A_RECORD, address should be an IPv4 address.
  • Type:AAAA_RECORD, address should be an IPv6 address.
  • -
  • Type:CNAME, address must end with a trailing period.
  • +
  • Type:CNAME, address must be a valid DNS name ending with a trailing period.
  • Type:TXT_RECORD, address cannot be blank.
@@ -70,7 +70,7 @@
+ required title="Address must be: an IPv4, if type:A_RECORD; an IPv6, if type: AAAA_RECORD; end with a trailing period if type:CNAME_RECORD; cannot be blank; if type: TXT_RECORD"> Required
From 8f5dc47ae3cec56ff9cc5a0d84014c0b73484eac Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Tue, 11 Aug 2020 11:19:47 -0600 Subject: [PATCH 15/16] Re-worded sentence-1 --- .../form.deliveryServiceStaticDnsEntry.tpl.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html index a91f0b1946..5b2deb122d 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html +++ b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html @@ -70,7 +70,7 @@
+ required title="Address must be: an IPv4, if type:A_RECORD; an IPv6, if type: AAAA_RECORD; valid DNS name ending with a trailing period if type:CNAME_RECORD; cannot be blank; if type: TXT_RECORD"> Required
From a3e49e179566cf4cd9f78729127987887049468a Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Tue, 11 Aug 2020 14:37:18 -0600 Subject: [PATCH 16/16] reword sentence-2 --- .../form.deliveryServiceStaticDnsEntry.tpl.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html index 5b2deb122d..aac08b2397 100644 --- a/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html +++ b/traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html @@ -70,7 +70,7 @@
+ required title="Address must be: an IPv4, if type:A_RECORD; an IPv6, if type: AAAA_RECORD; valid DNS name ending with a trailing period, if type:CNAME_RECORD; cannot be blank, if type: TXT_RECORD"> Required