From 64b76bdc6e91e4e352e91c69cc375e935c1779cf Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 15 May 2020 00:27:07 +0000 Subject: [PATCH 1/4] chore(deps): bump firebase from 7.14.3 to 7.14.4 Bumps [firebase](https://github.com/firebase/firebase-js-sdk) from 7.14.3 to 7.14.4. - [Release notes](https://github.com/firebase/firebase-js-sdk/releases) - [Commits](https://github.com/firebase/firebase-js-sdk/compare/firebase@7.14.3...firebase@7.14.4) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 20 ++++++++++---------- package.json | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 40924ae1e..1ee5d8021 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1338,9 +1338,9 @@ } }, "@firebase/firestore": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-1.14.3.tgz", - "integrity": "sha512-vmkXa5Msumutf0ZQjF8AQQwXr4mXI7D8TBbI44w+CMQEnKcD5MW7Dr1SmCTWy8+kNAAFwdA6lCiUtDY5Gx/Hlw==", + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-1.14.4.tgz", + "integrity": "sha512-TQUNXOy5WZKNp/o7mRijo5+AbR5Q0s5GTeKjRXBDtYYbDYPTJ/jktvCDI4N39hACl5829819kqhCZ510F3B5nw==", "requires": { "@firebase/component": "0.1.11", "@firebase/firestore-types": "1.10.1", @@ -6305,16 +6305,16 @@ } }, "firebase": { - "version": "7.14.3", - "resolved": "https://registry.npmjs.org/firebase/-/firebase-7.14.3.tgz", - "integrity": "sha512-qExwE/vhf/l6Mf8ES3IFX1SB6/DysKPtvrIWnIuswmRMeSA9eERwrqp4Pom4NHhzjBP1jOmlIPKeOplsNwMlOQ==", + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-7.14.4.tgz", + "integrity": "sha512-BeI+Jfyg1QyNPY8tD+P0LeVbSqivQm3fEVPCoqVC/oYVusNplZD1LmMI5Swk3Wvh0G0BrSM1nhtv0/nF98fSUg==", "requires": { "@firebase/analytics": "0.3.4", "@firebase/app": "0.6.3", "@firebase/app-types": "0.6.0", "@firebase/auth": "0.14.5", "@firebase/database": "0.6.2", - "@firebase/firestore": "1.14.3", + "@firebase/firestore": "1.14.4", "@firebase/functions": "0.4.43", "@firebase/installations": "0.4.9", "@firebase/messaging": "0.6.15", @@ -11401,9 +11401,9 @@ }, "dependencies": { "@types/node": { - "version": "13.13.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.5.tgz", - "integrity": "sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g==" + "version": "13.13.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.6.tgz", + "integrity": "sha512-zqRj8ugfROCjXCNbmPBe2mmQ0fJWP9lQaN519hwunOgpHgVykme4G6FW95++dyNFDvJUk4rtExkVkL0eciu5NA==" } } }, diff --git a/package.json b/package.json index a85eed453..eda459885 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@nuxtjs/sitemap": "^2.3.0", "@nuxtjs/toast": "^3.3.0", "ace-builds": "^1.4.11", - "firebase": "^7.14.3", + "firebase": "^7.14.4", "graphql": "^14.6.0", "graphql-language-service-interface": "^2.3.3", "nuxt": "^2.12.2", From b1ffeb1f24b0b840c78210b5155763a2d4f19977 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Fri, 15 May 2020 02:10:26 -0400 Subject: [PATCH 2/4] Updated URL validation regex to be more lenient --- functions/utils/valid.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/functions/utils/valid.js b/functions/utils/valid.js index 3ca6c461d..1969969f2 100644 --- a/functions/utils/valid.js +++ b/functions/utils/valid.js @@ -1,11 +1,6 @@ -function generateIPRE(protocol) { +function generateREForProtocol(protocol) { return new RegExp( - `${protocol}(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$` - ) -} -function generateHostnameRE(protocol) { - return new RegExp( - `${protocol}(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]).)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9/])$` + `${protocol}[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&\\/\\/=]*)` ) } @@ -14,9 +9,7 @@ function generateHostnameRE(protocol) { */ export function wsValid(url) { const protocol = "^(wss?:\\/\\/)?" - const validIP = generateIPRE(protocol) - const validHostname = generateHostnameRE(protocol) - return validIP.test(url) || validHostname.test(url) + return generateREForProtocol(protocol).test(url) } /** @@ -24,9 +17,7 @@ export function wsValid(url) { */ export function sseValid(url) { const protocol = "^(https?:\\/\\/)?" - const validIP = generateIPRE(protocol) - const validHostname = generateHostnameRE(protocol) - return validIP.test(url) || validHostname.test(url) + return generateREForProtocol(protocol).test(url) } /** @@ -34,7 +25,5 @@ export function sseValid(url) { */ export function socketioValid(url) { const protocol = "^((wss?:\\/\\/)|(https?:\\/\\/))?" - const validIP = generateIPRE(protocol) - const validHostname = generateHostnameRE(protocol) - return validIP.test(url) || validHostname.test(url) + return generateREForProtocol(protocol).test(url) } From b49e215617fc16d63d5795fd9ef6dd1f5794b1e7 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Fri, 15 May 2020 02:14:24 -0400 Subject: [PATCH 3/4] Refactor Realtime URL validation functions --- functions/utils/valid.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/functions/utils/valid.js b/functions/utils/valid.js index 1969969f2..745872e45 100644 --- a/functions/utils/valid.js +++ b/functions/utils/valid.js @@ -1,3 +1,7 @@ +const wsRegex = generateREForProtocol("^(wss?:\\/\\/)?") +const sseRegex = generateREForProtocol("^(https?:\\/\\/)?") +const socketioRegex = generateREForProtocol("^((wss?:\\/\\/)|(https?:\\/\\/))?") + function generateREForProtocol(protocol) { return new RegExp( `${protocol}[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&\\/\\/=]*)` @@ -8,22 +12,19 @@ function generateREForProtocol(protocol) { * valid url for ws/wss */ export function wsValid(url) { - const protocol = "^(wss?:\\/\\/)?" - return generateREForProtocol(protocol).test(url) + return wsRegex.test(url) } /** * valid url for http/https */ export function sseValid(url) { - const protocol = "^(https?:\\/\\/)?" - return generateREForProtocol(protocol).test(url) + return sseRegex.test(url) } /** * valid url for ws/wss/http/https */ export function socketioValid(url) { - const protocol = "^((wss?:\\/\\/)|(https?:\\/\\/))?" - return generateREForProtocol(protocol).test(url) + return socketioRegex.test(url) } From 240351ea2323d5aa03f8c8d58699ccca10223431 Mon Sep 17 00:00:00 2001 From: "Samir L. Boulema" Date: Fri, 15 May 2020 16:43:25 +0200 Subject: [PATCH 4/4] Fix syncing environments --- components/environments/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/environments/index.vue b/components/environments/index.vue index 9e6595987..596425000 100644 --- a/components/environments/index.vue +++ b/components/environments/index.vue @@ -116,7 +116,7 @@ export default { this.$data.editingEnvironment = environment this.$data.editingEnvironmentIndex = environmentIndex this.displayModalEdit(true) - this.syncEnvironments + this.syncEnvironments() }, resetSelectedData() { this.$data.editingEnvironment = undefined