From d4cfba8dda8621ca0d1c7bf604d7103c2c077f23 Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Fri, 19 Nov 2021 08:30:58 +0100 Subject: [PATCH 01/13] ci: add Node 17 in test matrix --- .github/workflows/ci.yml | 5 +++++ README.md | 2 +- ci/ciCheck.js | 1 - package.json | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96ed13b0c8..f0282920ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,6 +196,11 @@ jobs: - name: PostgreSQL 14, PostGIS 3.1 POSTGRES_IMAGE: postgis/postgis:14-3.1 NODE_VERSION: 16.13.0 + - name: Node 17 + MONGODB_VERSION: 4.4.10 + MONGODB_TOPOLOGY: standalone + MONGODB_STORAGE_ENGINE: wiredTiger + NODE_VERSION: 17.1.0 fail-fast: false name: ${{ matrix.name }} timeout-minutes: 15 diff --git a/README.md b/README.md index f2ecce98ab..b3c7ec9e66 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ Parse Server is continuously tested with the most recent releases of Node.js to | Node.js 12 | 12.22.7 | April 2022 | ✅ Yes | | Node.js 14 | 14.18.1 | April 2023 | ✅ Yes | | Node.js 16 | 16.13.0 | April 2024 | ✅ Yes | -| Node.js 17 | 17.x | June 2022 | ❌ Not tested | +| Node.js 17 | 17.1.0 | June 2022 | ✅ Yes | #### MongoDB Parse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the [MongoDB support schedule](https://www.mongodb.com/support-policy) and only test against versions that are officially supported and have not reached their end-of-life date. diff --git a/ci/ciCheck.js b/ci/ciCheck.js index 2ad5c3e8f3..2b3911ef59 100644 --- a/ci/ciCheck.js +++ b/ci/ciCheck.js @@ -61,7 +61,6 @@ async function checkNodeVersions() { '<12.0.0', // These versions have reached their end-of-life support date '>=13.0.0 <14.0.0', // These versions have reached their end-of-life support date '>=15.0.0 <16.0.0', // These versions have reached their end-of-life support date - '>=17.0.0', // These versions are not officially supported yet ], }).check(); } diff --git a/package.json b/package.json index 73bb74b099..7cab533760 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "madge:circular": "node_modules/.bin/madge ./src --circular" }, "engines": { - "node": ">=12.20.0 <16" + "node": ">=12.20.0 <18" }, "bin": { "parse-server": "bin/parse-server" From 217c5262c76dad81b246025fc45199606a7fb753 Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Fri, 19 Nov 2021 08:32:01 +0100 Subject: [PATCH 02/13] fix: localhost resolving to ::1 in tests --- spec/helper.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/helper.js b/spec/helper.js index 612c716202..1ae30c0074 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -1,9 +1,15 @@ 'use strict'; +const dns = require('dns'); const semver = require('semver'); const CurrentSpecReporter = require('./support/CurrentSpecReporter.js'); const { SpecReporter } = require('jasmine-spec-reporter'); const SchemaCache = require('../lib/Adapters/Cache/SchemaCache').default; +// Ensures localhost resolves to ipv4 address first on node v17+ +if (dns.setDefaultResultOrder) { + dns.setDefaultResultOrder('ipv4first'); +} + // Sets up a Parse API server for testing. jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 10000; jasmine.getEnv().addReporter(new CurrentSpecReporter()); From ca2e9fe8bbc6c3328a8a200e5b08c2d5d3810c6c Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Fri, 19 Nov 2021 08:34:32 +0100 Subject: [PATCH 03/13] ci: misplaces node 17 test --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0282920ed..b87b8ee3c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -142,6 +142,11 @@ jobs: MONGODB_TOPOLOGY: standalone MONGODB_STORAGE_ENGINE: wiredTiger NODE_VERSION: 14.18.1 + - name: Node 17 + MONGODB_VERSION: 4.4.10 + MONGODB_TOPOLOGY: standalone + MONGODB_STORAGE_ENGINE: wiredTiger + NODE_VERSION: 17.1.0 fail-fast: false name: ${{ matrix.name }} timeout-minutes: 15 @@ -196,11 +201,6 @@ jobs: - name: PostgreSQL 14, PostGIS 3.1 POSTGRES_IMAGE: postgis/postgis:14-3.1 NODE_VERSION: 16.13.0 - - name: Node 17 - MONGODB_VERSION: 4.4.10 - MONGODB_TOPOLOGY: standalone - MONGODB_STORAGE_ENGINE: wiredTiger - NODE_VERSION: 17.1.0 fail-fast: false name: ${{ matrix.name }} timeout-minutes: 15 From f8216129b9d3da8694ac5111176a03591356a517 Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Fri, 19 Nov 2021 12:44:06 +0100 Subject: [PATCH 04/13] docs: add node 17 badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b3c7ec9e66..613cf6f947 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Coverage](https://img.shields.io/codecov/c/github/parse-community/parse-server/alpha.svg)](https://codecov.io/github/parse-community/parse-server?branch=alpha) [![auto-release](https://img.shields.io/badge/%F0%9F%9A%80-auto--release-9e34eb.svg)](https://github.com/parse-community/parse-dashboard/releases) -[![Node Version](https://img.shields.io/badge/nodejs-12,_14,_16-green.svg?logo=node.js&style=flat)](https://nodejs.org) +[![Node Version](https://img.shields.io/badge/nodejs-12,_14,_16,_17-green.svg?logo=node.js&style=flat)](https://nodejs.org) [![MongoDB Version](https://img.shields.io/badge/mongodb-4.0,_4.2,_4.4,_5.0-green.svg?logo=mongodb&style=flat)](https://www.mongodb.com) [![Postgres Version](https://img.shields.io/badge/postgresql-11,_12,_13,_14-green.svg?logo=postgresql&style=flat)](https://www.postgresql.org) From 0b00945c7b283677e477a86467a7a186843ffb8e Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Fri, 19 Nov 2021 12:45:10 +0100 Subject: [PATCH 05/13] ci: ignore node 18+ --- ci/ciCheck.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/ciCheck.js b/ci/ciCheck.js index 2b3911ef59..3e79012599 100644 --- a/ci/ciCheck.js +++ b/ci/ciCheck.js @@ -61,6 +61,7 @@ async function checkNodeVersions() { '<12.0.0', // These versions have reached their end-of-life support date '>=13.0.0 <14.0.0', // These versions have reached their end-of-life support date '>=15.0.0 <16.0.0', // These versions have reached their end-of-life support date + '>=18.0.0', // These versions are not officially supported yet ], }).check(); } From 28a28869359aba47b79701eb332c0462ae2c41f3 Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Fri, 17 Dec 2021 16:03:09 +0100 Subject: [PATCH 06/13] Test with Node 17.2.0 --- .github/workflows/ci.yml | 2 +- README.md | 2 +- spec/helper.js | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b87b8ee3c7..b70807549b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,7 +146,7 @@ jobs: MONGODB_VERSION: 4.4.10 MONGODB_TOPOLOGY: standalone MONGODB_STORAGE_ENGINE: wiredTiger - NODE_VERSION: 17.1.0 + NODE_VERSION: 17.2.0 fail-fast: false name: ${{ matrix.name }} timeout-minutes: 15 diff --git a/README.md b/README.md index 613cf6f947..c0f690967d 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ Parse Server is continuously tested with the most recent releases of Node.js to | Node.js 12 | 12.22.7 | April 2022 | ✅ Yes | | Node.js 14 | 14.18.1 | April 2023 | ✅ Yes | | Node.js 16 | 16.13.0 | April 2024 | ✅ Yes | -| Node.js 17 | 17.1.0 | June 2022 | ✅ Yes | +| Node.js 17 | 17.2.0 | June 2022 | ✅ Yes | #### MongoDB Parse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the [MongoDB support schedule](https://www.mongodb.com/support-policy) and only test against versions that are officially supported and have not reached their end-of-life date. diff --git a/spec/helper.js b/spec/helper.js index 1ae30c0074..612c716202 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -1,15 +1,9 @@ 'use strict'; -const dns = require('dns'); const semver = require('semver'); const CurrentSpecReporter = require('./support/CurrentSpecReporter.js'); const { SpecReporter } = require('jasmine-spec-reporter'); const SchemaCache = require('../lib/Adapters/Cache/SchemaCache').default; -// Ensures localhost resolves to ipv4 address first on node v17+ -if (dns.setDefaultResultOrder) { - dns.setDefaultResultOrder('ipv4first'); -} - // Sets up a Parse API server for testing. jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 10000; jasmine.getEnv().addReporter(new CurrentSpecReporter()); From d11b44c43b934e808f3833253e2879a111740d01 Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Fri, 17 Dec 2021 16:04:48 +0100 Subject: [PATCH 07/13] Replace all HTTP localhost to 127.0.0.1 --- README.md | 30 +-- bootstrap.sh | 2 +- spec/AccountLockoutPolicy.spec.js | 10 +- spec/AudienceRouter.spec.js | 4 +- spec/AuthenticationAdapters.spec.js | 2 +- spec/CloudCode.spec.js | 36 ++-- spec/EmailVerificationToken.spec.js | 60 +++--- spec/GridFSBucketStorageAdapter.spec.js | 4 +- spec/HTTPRequest.spec.js | 2 +- spec/Idempotency.spec.js | 16 +- spec/LogsRouter.spec.js | 14 +- spec/MongoStorageAdapter.spec.js | 8 +- spec/PagesRouter.spec.js | 58 +++--- spec/Parse.Push.spec.js | 4 +- spec/ParseAPI.spec.js | 42 ++--- spec/ParseFile.spec.js | 48 ++--- spec/ParseGeoPoint.spec.js | 2 +- spec/ParseGlobalConfig.spec.js | 20 +- spec/ParseGraphQLServer.spec.js | 26 +-- spec/ParseHooks.spec.js | 2 +- spec/ParseInstallation.spec.js | 4 +- spec/ParseLiveQuery.spec.js | 2 +- spec/ParseLiveQueryServer.spec.js | 4 +- spec/ParsePolygon.spec.js | 6 +- spec/ParseQuery.FullTextSearch.spec.js | 14 +- spec/ParseQuery.spec.js | 8 +- spec/ParseServer.spec.js | 4 +- spec/ParseServerRESTController.spec.js | 2 +- spec/ParseUser.spec.js | 120 ++++++------ spec/PasswordPolicy.spec.js | 116 ++++++------ spec/PostgresInitOptions.spec.js | 6 +- spec/PublicAPI.spec.js | 38 ++-- spec/PurchaseValidation.spec.js | 10 +- spec/PushController.spec.js | 4 +- spec/ReadPreferenceOption.spec.js | 18 +- spec/RegexVulnerabilities.spec.js | 4 +- spec/RestQuery.spec.js | 4 +- spec/SecurityCheck.spec.js | 2 +- spec/SecurityCheckGroups.spec.js | 2 +- spec/UserPII.spec.js | 44 ++--- spec/ValidationAndPasswordsReset.spec.js | 88 ++++----- spec/VerifyUserPassword.spec.js | 4 +- spec/WinstonLoggerAdapter.spec.js | 2 +- spec/batch.spec.js | 20 +- spec/features.spec.js | 4 +- spec/helper.js | 6 +- spec/index.spec.js | 40 ++-- spec/rest.spec.js | 16 +- spec/schemas.spec.js | 230 +++++++++++------------ src/ParseServer.js | 2 +- src/cli/parse-server.js | 4 +- 51 files changed, 609 insertions(+), 609 deletions(-) diff --git a/README.md b/README.md index c0f690967d..ac0a7ca2db 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,7 @@ $ curl -X POST \ -H "X-Parse-Application-Id: APPLICATION_ID" \ -H "Content-Type: application/json" \ -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \ -http://localhost:1337/parse/classes/GameScore +http://127.0.0.1:1337/parse/classes/GameScore ``` You should get a response similar to this: @@ -197,7 +197,7 @@ You can now retrieve this object directly (make sure to replace `2ntvSpRGIK` wit ```bash $ curl -X GET \ -H "X-Parse-Application-Id: APPLICATION_ID" \ - http://localhost:1337/parse/classes/GameScore/2ntvSpRGIK + http://127.0.0.1:1337/parse/classes/GameScore/2ntvSpRGIK ``` ```json // Response @@ -216,7 +216,7 @@ Keeping tracks of individual object ids is not ideal, however. In most cases you ```bash $ curl -X GET \ -H "X-Parse-Application-Id: APPLICATION_ID" \ - http://localhost:1337/parse/classes/GameScore + http://127.0.0.1:1337/parse/classes/GameScore ``` ```json // The response will provide all the matching objects within the `results` array: @@ -275,7 +275,7 @@ var api = new ParseServer({ appId: 'myAppId', masterKey: 'myMasterKey', // Keep this key secret! fileKey: 'optionalFileKey', - serverURL: 'http://localhost:1337/parse' // Don't forget to change to https if needed + serverURL: 'http://127.0.0.1:1337/parse' // Don't forget to change to https if needed }); // Serve the Parse API on the /parse URL prefix @@ -766,10 +766,10 @@ The easiest way to run the Parse GraphQL API is through the CLI: ```bash $ npm install -g parse-server mongodb-runner $ mongodb-runner start -$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://localhost:1337/parse --mountGraphQL --mountPlayground +$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://127.0.0.1:1337/parse --mountGraphQL --mountPlayground ``` -After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API. +After starting the server, you can visit http://127.0.0.1:1337/playground in your browser to start playing with your GraphQL API. ***Note:*** Do ***NOT*** use --mountPlayground option in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps. @@ -787,12 +787,12 @@ $ docker run --name my-mongo -d mongo #### Running the Parse Server Image ```bash -$ docker run --name my-parse-server --link my-mongo:mongo -v config-vol:/parse-server/config -p 1337:1337 -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test --publicServerURL http://localhost:1337/parse --mountGraphQL --mountPlayground +$ docker run --name my-parse-server --link my-mongo:mongo -v config-vol:/parse-server/config -p 1337:1337 -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test --publicServerURL http://127.0.0.1:1337/parse --mountGraphQL --mountPlayground ``` ***Note:*** *If you want to use [Cloud Code](https://docs.parseplatform.org/cloudcode/guide/), add `-v cloud-code-vol:/parse-server/cloud --cloud /parse-server/cloud/main.js` to the command above. Make sure `main.js` is in the `cloud-code-vol` directory before starting Parse Server.* -After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API. +After starting the server, you can visit http://127.0.0.1:1337/playground in your browser to start playing with your GraphQL API. ***Note:*** Do ***NOT*** use --mountPlayground option in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps. @@ -818,8 +818,8 @@ const parseServer = new ParseServer({ databaseURI: 'mongodb://localhost:27017/test', appId: 'APPLICATION_ID', masterKey: 'MASTER_KEY', - serverURL: 'http://localhost:1337/parse', - publicServerURL: 'http://localhost:1337/parse' + serverURL: 'http://127.0.0.1:1337/parse', + publicServerURL: 'http://127.0.0.1:1337/parse' }); const parseGraphQLServer = new ParseGraphQLServer( @@ -835,9 +835,9 @@ parseGraphQLServer.applyGraphQL(app); // Mounts the GraphQL API parseGraphQLServer.applyPlayground(app); // (Optional) Mounts the GraphQL Playground - do NOT use in Production app.listen(1337, function() { - console.log('REST API running on http://localhost:1337/parse'); - console.log('GraphQL API running on http://localhost:1337/graphql'); - console.log('GraphQL Playground running on http://localhost:1337/playground'); + console.log('REST API running on http://127.0.0.1:1337/parse'); + console.log('GraphQL API running on http://127.0.0.1:1337/graphql'); + console.log('GraphQL Playground running on http://127.0.0.1:1337/playground'); }); ``` @@ -848,7 +848,7 @@ $ npx mongodb-runner start $ node index.js ``` -After starting the app, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API. +After starting the app, you can visit http://127.0.0.1:1337/playground in your browser to start playing with your GraphQL API. ***Note:*** Do ***NOT*** mount the GraphQL Playground in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps. @@ -1028,7 +1028,7 @@ Parse GraphQL Server allows you to create a custom GraphQL schema with own queri To start creating your custom schema, you need to code a `schema.graphql` file and initialize Parse Server with `--graphQLSchema` and `--cloud` options: ```bash -$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://localhost:1337/parse --cloud ./cloud/main.js --graphQLSchema ./cloud/schema.graphql --mountGraphQL --mountPlayground +$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://127.0.0.1:1337/parse --cloud ./cloud/main.js --graphQLSchema ./cloud/schema.graphql --mountGraphQL --mountPlayground ``` ### Creating your first custom query diff --git a/bootstrap.sh b/bootstrap.sh index c36f0ad402..e5e3dfdd3d 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -200,7 +200,7 @@ npm install -s CURL_CMD=$(cat << EOF curl -X POST -H 'X-Parse-Application-Id: ${APP_ID}' \\ -H 'Content-Type: application/json' \\ - -d '{"foo":"bar"}' http://localhost:1337/parse/classes/TestObject + -d '{"foo":"bar"}' http://127.0.0.1:1337/parse/classes/TestObject EOF) echo "\n${CHECK} Happy Parsing!\n\n" diff --git a/spec/AccountLockoutPolicy.spec.js b/spec/AccountLockoutPolicy.spec.js index 43212d0e69..aa045f3358 100644 --- a/spec/AccountLockoutPolicy.spec.js +++ b/spec/AccountLockoutPolicy.spec.js @@ -43,7 +43,7 @@ describe('Account Lockout Policy: ', () => { it('account should not be locked even after failed login attempts if account lockout policy is not set', done => { reconfigureServer({ appName: 'unlimited', - publicServerURL: 'http://localhost:1337/1', + publicServerURL: 'http://127.0.0.1:1337/1', }) .then(() => { const user = new Parse.User(); @@ -236,7 +236,7 @@ describe('Account Lockout Policy: ', () => { duration: 1, threshold: 2, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { const user = new Parse.User(); @@ -269,7 +269,7 @@ describe('Account Lockout Policy: ', () => { duration: 0.05, // 0.05*60 = 3 secs threshold: 2, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { const user = new Parse.User(); @@ -306,7 +306,7 @@ describe('Account Lockout Policy: ', () => { duration: 0.05, // 0.05*60 = 3 secs threshold: 2, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { const user = new Parse.User(); @@ -357,7 +357,7 @@ describe('lockout with password reset option', () => { const config = { appName: 'exampleApp', accountLockout: accountLockout, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', emailAdapter: { sendVerificationEmail: () => Promise.resolve(), sendPasswordResetEmail: () => Promise.resolve(), diff --git a/spec/AudienceRouter.spec.js b/spec/AudienceRouter.spec.js index 208e7834b6..78e720cf6b 100644 --- a/spec/AudienceRouter.spec.js +++ b/spec/AudienceRouter.spec.js @@ -399,12 +399,12 @@ describe('AudiencesRouter', () => { await reconfigureServer({ appId: 'test', restAPIKey: 'test', - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); try { await request({ method: 'POST', - url: 'http://localhost:8378/1/classes/_Audience', + url: 'http://127.0.0.1:8378/1/classes/_Audience', body: { lorem: 'ipsum', _method: 'POST' }, headers: { 'X-Parse-Application-Id': 'test', diff --git a/spec/AuthenticationAdapters.spec.js b/spec/AuthenticationAdapters.spec.js index d32eba0423..187bdc5e8e 100644 --- a/spec/AuthenticationAdapters.spec.js +++ b/spec/AuthenticationAdapters.spec.js @@ -166,7 +166,7 @@ describe('AuthenticationProviders', function () { 'X-Parse-Session-Token': token, 'Content-Type': 'application/json', }, - url: 'http://localhost:8378/1/users', + url: 'http://127.0.0.1:8378/1/users', body: jsonBody, }; return request(options) diff --git a/spec/CloudCode.spec.js b/spec/CloudCode.spec.js index c185eac53e..c6a5193631 100644 --- a/spec/CloudCode.spec.js +++ b/spec/CloudCode.spec.js @@ -1214,7 +1214,7 @@ describe('Cloud Code', () => { .then(user => { session1 = user.getSessionToken(); return request({ - url: 'http://localhost:8378/1/login?username=test&password=moon-y', + url: 'http://127.0.0.1:8378/1/login?username=test&password=moon-y', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -1229,7 +1229,7 @@ describe('Cloud Code', () => { .then(() => request({ method: 'POST', - url: 'http://localhost:8378/1/functions/checkStaleUser', + url: 'http://127.0.0.1:8378/1/functions/checkStaleUser', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -1254,7 +1254,7 @@ describe('Cloud Code', () => { .then(() => request({ method: 'POST', - url: 'http://localhost:8378/1/functions/checkStaleUser', + url: 'http://127.0.0.1:8378/1/functions/checkStaleUser', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -1554,7 +1554,7 @@ describe('Cloud Code', () => { }); await Parse.Cloud.httpRequest({ method: 'POST', - url: 'http://localhost:8378/1/functions/hello', + url: 'http://127.0.0.1:8378/1/functions/hello', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -1575,7 +1575,7 @@ describe('Cloud Code', () => { request({ method: 'POST', - url: 'http://localhost:8378/1/jobs/myJob', + url: 'http://127.0.0.1:8378/1/jobs/myJob', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Master-Key': Parse.masterKey, @@ -1602,7 +1602,7 @@ describe('Cloud Code', () => { request({ method: 'POST', - url: 'http://localhost:8378/1/jobs/myJob', + url: 'http://127.0.0.1:8378/1/jobs/myJob', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -1632,7 +1632,7 @@ describe('Cloud Code', () => { request({ method: 'POST', - url: 'http://localhost:8378/1/jobs/myJob', + url: 'http://127.0.0.1:8378/1/jobs/myJob', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Master-Key': Parse.masterKey, @@ -1696,7 +1696,7 @@ describe('Cloud Code', () => { request({ method: 'POST', - url: 'http://localhost:8378/1/jobs/myJob', + url: 'http://127.0.0.1:8378/1/jobs/myJob', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Master-Key': Parse.masterKey, @@ -1727,7 +1727,7 @@ describe('Cloud Code', () => { request({ method: 'POST', - url: 'http://localhost:8378/1/jobs/myJob', + url: 'http://127.0.0.1:8378/1/jobs/myJob', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Master-Key': Parse.masterKey, @@ -1816,7 +1816,7 @@ describe('beforeSave hooks', () => { const req = request({ // Parse JS SDK does not currently support custom object ids (see #1097), so we do a REST request method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -2064,7 +2064,7 @@ describe('beforeFind hooks', () => { }); request({ - url: 'http://localhost:8378/1/classes/MyObject', + url: 'http://127.0.0.1:8378/1/classes/MyObject', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -2124,7 +2124,7 @@ describe('beforeFind hooks', () => { obj.save().then(function () { request({ method: 'GET', - url: 'http://localhost:8378/1/classes/MyObject/' + obj.id, + url: 'http://127.0.0.1:8378/1/classes/MyObject/' + obj.id, headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -2615,7 +2615,7 @@ describe('afterFind hooks', () => { }); const req = request({ method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -2647,7 +2647,7 @@ describe('afterFind hooks', () => { }); const req = request({ method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -2685,7 +2685,7 @@ describe('afterFind hooks', () => { }); const req = request({ method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -2717,7 +2717,7 @@ describe('afterFind hooks', () => { }); const req = request({ method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', headers: { 'X-Parse-REST-API-Key': 'rest', 'X-Parse-Cloud-Context': '{"key":"value","otherKey":1}', @@ -2744,7 +2744,7 @@ describe('afterFind hooks', () => { }); const req = request({ method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', headers: { 'X-Parse-REST-API-Key': 'rest', 'X-Parse-Cloud-Context': '{"key":"value","otherKey":1}', @@ -2777,7 +2777,7 @@ describe('afterFind hooks', () => { }); const req = request({ method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', headers: { 'X-Parse-REST-API-Key': 'rest', 'X-Parse-Cloud-Context': '{"key":"value","otherKey":1}', diff --git a/spec/EmailVerificationToken.spec.js b/spec/EmailVerificationToken.spec.js index 50b626de0d..94f4b6ba64 100644 --- a/spec/EmailVerificationToken.spec.js +++ b/spec/EmailVerificationToken.spec.js @@ -19,7 +19,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 0.5, // 0.5 second - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('testEmailVerifyTokenValidity'); @@ -38,7 +38,7 @@ describe('Email Verification Token Expiration: ', () => { }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/invalid_verification_link.html?username=testEmailVerifyTokenValidity&appId=test' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/invalid_verification_link.html?username=testEmailVerifyTokenValidity&appId=test' ); done(); }); @@ -65,7 +65,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 0.5, // 0.5 second - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('testEmailVerifyTokenValidity'); @@ -117,7 +117,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('testEmailVerifyTokenValidity'); @@ -132,7 +132,7 @@ describe('Email Verification Token Expiration: ', () => { }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/verify_email_success.html?username=testEmailVerifyTokenValidity' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/verify_email_success.html?username=testEmailVerifyTokenValidity' ); done(); }); @@ -158,7 +158,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('testEmailVerifyTokenValidity'); @@ -205,7 +205,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('testEmailVerifyTokenValidity'); @@ -252,7 +252,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('sets_email_verify_token_expires_at'); @@ -297,7 +297,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('unsets_email_verify_token_expires_at'); @@ -353,7 +353,7 @@ describe('Email Verification Token Expiration: ', () => { appName: 'emailVerifyToken', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }; // setup server WITHOUT enabling the expire email verify token flag @@ -386,7 +386,7 @@ describe('Email Verification Token Expiration: ', () => { }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/verify_email_success.html?username=testEmailVerifyTokenValidity' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/verify_email_success.html?username=testEmailVerifyTokenValidity' ); done(); }); @@ -411,7 +411,7 @@ describe('Email Verification Token Expiration: ', () => { appName: 'emailVerifyToken', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }; // setup server WITHOUT enabling the expire email verify token flag @@ -439,7 +439,7 @@ describe('Email Verification Token Expiration: ', () => { }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/invalid_verification_link.html?username=testEmailVerifyTokenValidity&appId=test' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/invalid_verification_link.html?username=testEmailVerifyTokenValidity&appId=test' ); done(); }); @@ -467,7 +467,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }; reconfigureServer(serverConfig) @@ -539,7 +539,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('resends_verification_token'); @@ -562,7 +562,7 @@ describe('Email Verification Token Expiration: ', () => { expect(sendVerificationEmailCallCount).toBe(1); return request({ - url: 'http://localhost:8378/1/verificationEmailRequest', + url: 'http://127.0.0.1:8378/1/verificationEmailRequest', method: 'POST', body: { email: 'user@parse.com', @@ -620,7 +620,7 @@ describe('Email Verification Token Expiration: ', () => { emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5 * 60, // 5 minutes emailVerifyTokenReuseIfValid: [], - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); fail('should have thrown.'); } catch (e) { @@ -632,7 +632,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenReuseIfValid: true, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); fail('should have thrown.'); } catch (e) { @@ -659,7 +659,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5 * 60, // 5 minutes - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', emailVerifyTokenReuseIfValid: true, }); const user = new Parse.User(); @@ -680,7 +680,7 @@ describe('Email Verification Token Expiration: ', () => { }, 1000); }); const response = await request({ - url: 'http://localhost:8378/1/verificationEmailRequest', + url: 'http://127.0.0.1:8378/1/verificationEmailRequest', method: 'POST', body: { email: 'user@example.com', @@ -725,7 +725,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('no_new_verification_token_once_verified'); @@ -745,7 +745,7 @@ describe('Email Verification Token Expiration: ', () => { expect(sendVerificationEmailCallCount).toBe(1); return request({ - url: 'http://localhost:8378/1/verificationEmailRequest', + url: 'http://127.0.0.1:8378/1/verificationEmailRequest', method: 'POST', body: { email: 'user@parse.com', @@ -785,11 +785,11 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { return request({ - url: 'http://localhost:8378/1/verificationEmailRequest', + url: 'http://127.0.0.1:8378/1/verificationEmailRequest', method: 'POST', body: { email: 'user@parse.com', @@ -831,11 +831,11 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { request({ - url: 'http://localhost:8378/1/verificationEmailRequest', + url: 'http://127.0.0.1:8378/1/verificationEmailRequest', method: 'POST', body: {}, headers: { @@ -876,11 +876,11 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { request({ - url: 'http://localhost:8378/1/verificationEmailRequest', + url: 'http://127.0.0.1:8378/1/verificationEmailRequest', method: 'POST', body: { email: 3 }, headers: { @@ -920,7 +920,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('testEmailVerifyTokenValidity'); @@ -963,7 +963,7 @@ describe('Email Verification Token Expiration: ', () => { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 5, // 5 seconds - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('testEmailVerifyTokenValidity'); diff --git a/spec/GridFSBucketStorageAdapter.spec.js b/spec/GridFSBucketStorageAdapter.spec.js index 8431d6d7f5..cede195d14 100644 --- a/spec/GridFSBucketStorageAdapter.spec.js +++ b/spec/GridFSBucketStorageAdapter.spec.js @@ -387,7 +387,7 @@ describe_only_db('mongo')('GridFSBucket and GridStore interop', () => { const response = await request({ method: 'GET', headers, - url: `http://localhost:8378/1/files/test/metadata/${file.name()}`, + url: `http://127.0.0.1:8378/1/files/test/metadata/${file.name()}`, }); fileData = response.data; expect(fileData.metadata).toEqual(metadata); @@ -405,7 +405,7 @@ describe_only_db('mongo')('GridFSBucket and GridStore interop', () => { const response = await request({ method: 'GET', headers, - url: `http://localhost:8378/1/files/test/metadata/filename.txt`, + url: `http://127.0.0.1:8378/1/files/test/metadata/filename.txt`, }); expect(response.data).toEqual({}); }); diff --git a/spec/HTTPRequest.spec.js b/spec/HTTPRequest.spec.js index f218ff3c91..e8bbe128db 100644 --- a/spec/HTTPRequest.spec.js +++ b/spec/HTTPRequest.spec.js @@ -6,7 +6,7 @@ const httpRequest = require('../lib/cloud-code/httpRequest'), express = require('express'); const port = 13371; -const httpRequestServer = `http://localhost:${port}`; +const httpRequestServer = `http://127.0.0.1:${port}`; function startServer(done) { const app = express(); diff --git a/spec/Idempotency.spec.js b/spec/Idempotency.spec.js index c2ef8665b7..89fa351a1d 100644 --- a/spec/Idempotency.spec.js +++ b/spec/Idempotency.spec.js @@ -49,7 +49,7 @@ describe_only_db('mongo')('Idempotency', () => { }); const params = { method: 'POST', - url: 'http://localhost:8378/1/functions/myFunction', + url: 'http://127.0.0.1:8378/1/functions/myFunction', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Master-Key': Parse.masterKey, @@ -72,7 +72,7 @@ describe_only_db('mongo')('Idempotency', () => { }); const params = { method: 'POST', - url: 'http://localhost:8378/1/functions/myFunction', + url: 'http://127.0.0.1:8378/1/functions/myFunction', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Master-Key': Parse.masterKey, @@ -96,7 +96,7 @@ describe_only_db('mongo')('Idempotency', () => { }); const params = { method: 'POST', - url: 'http://localhost:8378/1/jobs/myJob', + url: 'http://127.0.0.1:8378/1/jobs/myJob', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Master-Key': Parse.masterKey, @@ -118,7 +118,7 @@ describe_only_db('mongo')('Idempotency', () => { }); const params = { method: 'POST', - url: 'http://localhost:8378/1/classes/MyClass', + url: 'http://127.0.0.1:8378/1/classes/MyClass', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Master-Key': Parse.masterKey, @@ -140,7 +140,7 @@ describe_only_db('mongo')('Idempotency', () => { }); const params = { method: 'POST', - url: 'http://localhost:8378/1/users', + url: 'http://127.0.0.1:8378/1/users', body: { username: 'user', password: 'pass', @@ -166,7 +166,7 @@ describe_only_db('mongo')('Idempotency', () => { }); const params = { method: 'POST', - url: 'http://localhost:8378/1/installations', + url: 'http://127.0.0.1:8378/1/installations', body: { installationId: '1', deviceType: 'ios', @@ -193,7 +193,7 @@ describe_only_db('mongo')('Idempotency', () => { const promises = [...Array(100).keys()].map(() => { const params = { method: 'POST', - url: 'http://localhost:8378/1/classes/MyClass', + url: 'http://127.0.0.1:8378/1/classes/MyClass', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Master-Key': Parse.masterKey, @@ -211,7 +211,7 @@ describe_only_db('mongo')('Idempotency', () => { Parse.Cloud.define('myFunction', () => {}); const params = { method: 'POST', - url: 'http://localhost:8378/1/functions/myFunction', + url: 'http://127.0.0.1:8378/1/functions/myFunction', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Master-Key': Parse.masterKey, diff --git a/spec/LogsRouter.spec.js b/spec/LogsRouter.spec.js index eb119fe56c..f4c82435ec 100644 --- a/spec/LogsRouter.spec.js +++ b/spec/LogsRouter.spec.js @@ -53,7 +53,7 @@ describe_only(() => { it('can check invalid master key of request', done => { request({ - url: 'http://localhost:8378/1/scriptlog', + url: 'http://127.0.0.1:8378/1/scriptlog', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -81,12 +81,12 @@ describe_only(() => { }).then(function () { request({ headers: headers, - url: 'http://localhost:8378/1/login?username=test&password=simplepass.com', + url: 'http://127.0.0.1:8378/1/login?username=test&password=simplepass.com', }) .catch(() => {}) .then(() => { request({ - url: 'http://localhost:8378/1/scriptlog?size=4&level=verbose', + url: 'http://127.0.0.1:8378/1/scriptlog?size=4&level=verbose', headers: headers, }).then(response => { const body = response.data; @@ -114,12 +114,12 @@ describe_only(() => { headers: headers, // using urlencoded password, 'simple @,/?:&=+$#pass.com' url: - 'http://localhost:8378/1/login?username=test&password=simple%20%40%2C%2F%3F%3A%26%3D%2B%24%23pass.com', + 'http://127.0.0.1:8378/1/login?username=test&password=simple%20%40%2C%2F%3F%3A%26%3D%2B%24%23pass.com', }) .catch(() => {}) .then(() => { return request({ - url: 'http://localhost:8378/1/scriptlog?size=4&level=verbose', + url: 'http://127.0.0.1:8378/1/scriptlog?size=4&level=verbose', headers: headers, }).then(response => { const body = response.data; @@ -146,7 +146,7 @@ describe_only(() => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/login', + url: 'http://127.0.0.1:8378/1/login', body: { username: 'test', password: 'simplepass.com', @@ -155,7 +155,7 @@ describe_only(() => { .catch(() => {}) .then(() => { request({ - url: 'http://localhost:8378/1/scriptlog?size=4&level=verbose', + url: 'http://127.0.0.1:8378/1/scriptlog?size=4&level=verbose', headers: headers, }).then(response => { const body = response.data; diff --git a/spec/MongoStorageAdapter.spec.js b/spec/MongoStorageAdapter.spec.js index f6d2866417..50c2f60af0 100644 --- a/spec/MongoStorageAdapter.spec.js +++ b/spec/MongoStorageAdapter.spec.js @@ -398,7 +398,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { await request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/batch', + url: 'http://127.0.0.1:8378/1/batch', body: JSON.stringify({ requests: [ { @@ -429,7 +429,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { await request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/batch', + url: 'http://127.0.0.1:8378/1/batch', body: JSON.stringify({ requests: [ { @@ -460,7 +460,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { await request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/batch', + url: 'http://127.0.0.1:8378/1/batch', body: JSON.stringify({ requests: [ { @@ -490,7 +490,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { await request({ method: 'PUT', headers: headers, - url: 'http://localhost:8378/1/classes/MyObject/' + myObject.id, + url: 'http://127.0.0.1:8378/1/classes/MyObject/' + myObject.id, body: { myAttribute: 'myValue' }, }); diff --git a/spec/PagesRouter.spec.js b/spec/PagesRouter.spec.js index e50144f1fe..ddc8d6f700 100644 --- a/spec/PagesRouter.spec.js +++ b/spec/PagesRouter.spec.js @@ -23,7 +23,7 @@ describe('Pages Router', () => { config = { appId: 'test', appName: 'exampleAppname', - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', pages: { enableRouter: true }, }; await reconfigureServer(config); @@ -31,11 +31,11 @@ describe('Pages Router', () => { it('responds with file content on direct page request', async () => { const urls = [ - 'http://localhost:8378/1/apps/email_verification_link_invalid.html', - 'http://localhost:8378/1/apps/choose_password?appId=test', - 'http://localhost:8378/1/apps/email_verification_success.html', - 'http://localhost:8378/1/apps/password_reset_success.html', - 'http://localhost:8378/1/apps/custom_json.html', + 'http://127.0.0.1:8378/1/apps/email_verification_link_invalid.html', + 'http://127.0.0.1:8378/1/apps/choose_password?appId=test', + 'http://127.0.0.1:8378/1/apps/email_verification_success.html', + 'http://127.0.0.1:8378/1/apps/password_reset_success.html', + 'http://127.0.0.1:8378/1/apps/custom_json.html', ]; for (const url of urls) { const response = await request({ url }).catch(e => e); @@ -48,7 +48,7 @@ describe('Pages Router', () => { await reconfigureServer(config); const response = await request({ - url: 'http://localhost:8378/1/apps/email_verification_link_invalid.html', + url: 'http://127.0.0.1:8378/1/apps/email_verification_link_invalid.html', }).catch(e => e); expect(response.status).toBe(200); }); @@ -58,7 +58,7 @@ describe('Pages Router', () => { await reconfigureServer(config); const response = await request({ - url: `http://localhost:8378/1/pages/email_verification_link_invalid.html`, + url: `http://127.0.0.1:8378/1/pages/email_verification_link_invalid.html`, }).catch(e => e); expect(response.status).toBe(200); }); @@ -69,9 +69,9 @@ describe('Pages Router', () => { pages: { enableRouter: true }, }); const urls = [ - 'http://localhost:8378/1/apps/test/verify_email', - 'http://localhost:8378/1/apps/choose_password?appId=test', - 'http://localhost:8378/1/apps/test/request_password_reset', + 'http://127.0.0.1:8378/1/apps/test/verify_email', + 'http://127.0.0.1:8378/1/apps/choose_password?appId=test', + 'http://127.0.0.1:8378/1/apps/test/request_password_reset', ]; for (const url of urls) { const response = await request({ url }).catch(e => e); @@ -81,11 +81,11 @@ describe('Pages Router', () => { it('responds with 403 access denied with invalid appId', async () => { const reqs = [ - { url: 'http://localhost:8378/1/apps/invalid/verify_email', method: 'GET' }, - { url: 'http://localhost:8378/1/apps/choose_password?id=invalid', method: 'GET' }, - { url: 'http://localhost:8378/1/apps/invalid/request_password_reset', method: 'GET' }, - { url: 'http://localhost:8378/1/apps/invalid/request_password_reset', method: 'POST' }, - { url: 'http://localhost:8378/1/apps/invalid/resend_verification_email', method: 'POST' }, + { url: 'http://127.0.0.1:8378/1/apps/invalid/verify_email', method: 'GET' }, + { url: 'http://127.0.0.1:8378/1/apps/choose_password?id=invalid', method: 'GET' }, + { url: 'http://127.0.0.1:8378/1/apps/invalid/request_password_reset', method: 'GET' }, + { url: 'http://127.0.0.1:8378/1/apps/invalid/request_password_reset', method: 'POST' }, + { url: 'http://127.0.0.1:8378/1/apps/invalid/resend_verification_email', method: 'POST' }, ]; for (const req of reqs) { const response = await request(req).catch(e => e); @@ -98,7 +98,7 @@ describe('Pages Router', () => { beforeEach(async () => { await reconfigureServer({ appName: 'exampleAppname', - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', pages: { enableRouter: true }, }); }); @@ -107,7 +107,7 @@ describe('Pages Router', () => { spyOn(UserController.prototype, 'updatePassword').and.callFake(() => Promise.resolve()); const res = await request({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=user1&token=43634643&username=username`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -123,7 +123,7 @@ describe('Pages Router', () => { try { await request({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=&token=132414&username=Johnny`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -141,7 +141,7 @@ describe('Pages Router', () => { try { await request({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=user1&token=43634643&username=`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -159,7 +159,7 @@ describe('Pages Router', () => { try { await request({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=user1&token=&username=Johnny`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -206,7 +206,7 @@ describe('Pages Router', () => { sendPasswordResetEmail: () => Promise.resolve(), sendMail: () => {}, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', pages: { enableRouter: true, enableLocalization: true, @@ -345,7 +345,7 @@ describe('Pages Router', () => { }; await reconfigureServer(config); const response = await request({ - url: 'http://localhost:8378/1/apps/custom_json.html', + url: 'http://127.0.0.1:8378/1/apps/custom_json.html', followRedirects: false, method: 'GET', }); @@ -360,7 +360,7 @@ describe('Pages Router', () => { }; await reconfigureServer(config); const response = await request({ - url: 'http://localhost:8378/1/apps/custom_json.html', + url: 'http://127.0.0.1:8378/1/apps/custom_json.html', followRedirects: false, method: 'GET', }); @@ -375,7 +375,7 @@ describe('Pages Router', () => { }; await reconfigureServer(config); const response = await request({ - url: 'http://localhost:8378/1/apps/custom_json.html', + url: 'http://127.0.0.1:8378/1/apps/custom_json.html', followRedirects: false, method: 'GET', }); @@ -577,7 +577,7 @@ describe('Pages Router', () => { spyOnProperty(Page.prototype, 'defaultFile').and.returnValue(jsonPageFile); const response = await request({ - url: `http://localhost:8378/1/apps/test/request_password_reset?token=exampleToken&username=exampleUsername&locale=${exampleLocale}`, + url: `http://127.0.0.1:8378/1/apps/test/request_password_reset?token=exampleToken&username=exampleUsername&locale=${exampleLocale}`, followRedirects: false, }).catch(e => e); expect(response.status).toEqual(200); @@ -626,13 +626,13 @@ describe('Pages Router', () => { await reconfigureServer(config); const response = await request({ url: - 'http://localhost:8378/1/apps/test/request_password_reset?token=exampleToken&username=exampleUsername&locale=de-AT', + 'http://127.0.0.1:8378/1/apps/test/request_password_reset?token=exampleToken&username=exampleUsername&locale=de-AT', followRedirects: false, method: 'POST', }); expect(response.status).toEqual(303); expect(response.headers.location).toContain( - 'http://localhost:8378/1/apps/de-AT/password_reset_link_invalid.html' + 'http://127.0.0.1:8378/1/apps/de-AT/password_reset_link_invalid.html' ); }); @@ -640,7 +640,7 @@ describe('Pages Router', () => { await reconfigureServer(config); const response = await request({ url: - 'http://localhost:8378/1/apps/test/request_password_reset?token=exampleToken&username=exampleUsername&locale=de-AT', + 'http://127.0.0.1:8378/1/apps/test/request_password_reset?token=exampleToken&username=exampleUsername&locale=de-AT', followRedirects: false, method: 'GET', }); diff --git a/spec/Parse.Push.spec.js b/spec/Parse.Push.spec.js index 1732e426e3..ec7b10ae3c 100644 --- a/spec/Parse.Push.spec.js +++ b/spec/Parse.Push.spec.js @@ -156,7 +156,7 @@ describe('Parse.Push', () => { await pushCompleted(pushStatusId); try { await request({ - url: 'http://localhost:8378/1/classes/_PushStatus', + url: 'http://127.0.0.1:8378/1/classes/_PushStatus', json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -181,7 +181,7 @@ describe('Parse.Push', () => { }); await pushCompleted(pushStatusId); const response = await request({ - url: 'http://localhost:8378/1/classes/_PushStatus', + url: 'http://127.0.0.1:8378/1/classes/_PushStatus', json: true, headers: { 'X-Parse-Application-Id': 'test', diff --git a/spec/ParseAPI.spec.js b/spec/ParseAPI.spec.js index 7bb6c9889b..e103e8b6a1 100644 --- a/spec/ParseAPI.spec.js +++ b/spec/ParseAPI.spec.js @@ -965,7 +965,7 @@ describe('miscellaneous', function () { request({ method: 'PUT', headers: headers, - url: 'http://localhost:8378/1/classes/GameScore/' + obj.id, + url: 'http://127.0.0.1:8378/1/classes/GameScore/' + obj.id, body: JSON.stringify({ a: 'b', c: { __op: 'Increment', amount: 2 }, @@ -1080,7 +1080,7 @@ describe('miscellaneous', function () { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/classes/GameScore', + url: 'http://127.0.0.1:8378/1/classes/GameScore', body: JSON.stringify({ a: 'b' }), }).then(() => { expect(triggerTime).toEqual(2); @@ -1110,13 +1110,13 @@ describe('miscellaneous', function () { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/classes/GameScore', + url: 'http://127.0.0.1:8378/1/classes/GameScore', body: JSON.stringify({ a: 'b' }), }).then(response => { request({ method: 'DELETE', headers: headers, - url: 'http://localhost:8378/1/classes/GameScore/' + response.data.objectId, + url: 'http://127.0.0.1:8378/1/classes/GameScore/' + response.data.objectId, }).then(() => { expect(triggerTime).toEqual(2); done(); @@ -1154,7 +1154,7 @@ describe('miscellaneous', function () { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/functions/echoParams', //?option=1&other=2 + url: 'http://127.0.0.1:8378/1/functions/echoParams', //?option=1&other=2 qs: { option: 1, other: 2, @@ -1214,7 +1214,7 @@ describe('miscellaneous', function () { }; request({ headers: headers, - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', }).then(fail, response => { const b = response.data; expect(b.error).toEqual('unauthorized'); @@ -1230,7 +1230,7 @@ describe('miscellaneous', function () { }; request({ headers: headers, - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', }).then(fail, response => { const b = response.data; expect(b.error).toEqual('unauthorized'); @@ -1246,7 +1246,7 @@ describe('miscellaneous', function () { }; request({ headers: headers, - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', }).then(fail, response => { const b = response.data; expect(b.error).toEqual('unauthorized'); @@ -1262,7 +1262,7 @@ describe('miscellaneous', function () { }; request({ headers: headers, - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', }).then(fail, response => { const b = response.data; expect(b.error).toEqual('unauthorized'); @@ -1297,7 +1297,7 @@ describe('miscellaneous', function () { const requestOptions = { headers: headers, method: 'POST', - url: 'http://localhost:8378/1/installations', + url: 'http://127.0.0.1:8378/1/installations', body: JSON.stringify(data), }; request(requestOptions).then(response => { @@ -1325,11 +1325,11 @@ describe('miscellaneous', function () { const requestOptions = { method: 'POST', headers: headers, - url: 'http://localhost:8378/1/users', + url: 'http://127.0.0.1:8378/1/users', body: JSON.stringify(data), }; request(requestOptions).then(() => { - requestOptions.url = 'http://localhost:8378/1/login'; + requestOptions.url = 'http://127.0.0.1:8378/1/login'; request(requestOptions).then(response => { const b = response.data; expect(typeof b['sessionToken']).toEqual('string'); @@ -1354,7 +1354,7 @@ describe('miscellaneous', function () { }; const requestOptions = { headers: headers, - url: 'http://localhost:8378/1/classes/AnObject', + url: 'http://127.0.0.1:8378/1/classes/AnObject', json: true, }; request(requestOptions).then(res => { @@ -1382,7 +1382,7 @@ describe('miscellaneous', function () { }; const requestOptions = { headers: headers, - url: 'http://localhost:8378/1/classes/AnObject', + url: 'http://127.0.0.1:8378/1/classes/AnObject', json: true, }; const object = new Parse.Object('AnObject'); @@ -1395,7 +1395,7 @@ describe('miscellaneous', function () { amount: amount, }, }, - url: 'http://localhost:8378/1/classes/AnObject/' + object.id, + url: 'http://127.0.0.1:8378/1/classes/AnObject/' + object.id, method: 'PUT', }); return request(options).then(res => res.data); @@ -1423,7 +1423,7 @@ describe('miscellaneous', function () { request({ method: 'POST', headers: { 'Content-Type': 'application/json' }, - url: 'http://localhost:8378/1/classes/AnObject', + url: 'http://127.0.0.1:8378/1/classes/AnObject', body: { _method: 'GET', _ApplicationId: 'test', @@ -1583,7 +1583,7 @@ describe('miscellaneous', function () { request({ method: 'DELETE', headers: headers, - url: 'http://localhost:8378/1/purge/TestObject', + url: 'http://127.0.0.1:8378/1/purge/TestObject', }).then(() => { const query = new Parse.Query(TestObject); return query.count().then(count => { @@ -1603,7 +1603,7 @@ describe('miscellaneous', function () { request({ method: 'DELETE', headers: headers, - url: 'http://localhost:8378/1/purge/TestObject', + url: 'http://127.0.0.1:8378/1/purge/TestObject', }) .then(() => { fail('Should not succeed'); @@ -1663,7 +1663,7 @@ describe('miscellaneous', function () { return request({ method: 'DELETE', headers: headers, - url: 'http://localhost:8378/1/purge/_Role', + url: 'http://127.0.0.1:8378/1/purge/_Role', json: true, }); }) @@ -1713,7 +1713,7 @@ describe('miscellaneous', function () { 'X-Parse-Application-Id': 'test', 'X-Parse-Master-Key': 'test', }, - url: 'http://localhost:8378/1/schemas/MyObject', + url: 'http://127.0.0.1:8378/1/schemas/MyObject', json: true, }); } @@ -1742,7 +1742,7 @@ describe_only_db('mongo')('legacy _acl', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/classes/Report', + url: 'http://127.0.0.1:8378/1/classes/Report', body: { ACL: {}, name: 'My Report', diff --git a/spec/ParseFile.spec.js b/spec/ParseFile.spec.js index af1de35ee7..a43c307382 100644 --- a/spec/ParseFile.spec.js +++ b/spec/ParseFile.spec.js @@ -23,7 +23,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/file.txt', + url: 'http://127.0.0.1:8378/1/files/file.txt', body: 'argle bargle', }).then(response => { const b = response.data; @@ -40,7 +40,7 @@ describe('Parse.File testing', () => { it('works with _ContentType', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/files/file', + url: 'http://127.0.0.1:8378/1/files/file', body: JSON.stringify({ _ApplicationId: 'test', _JavaScriptKey: 'test', @@ -72,7 +72,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/file.txt', + url: 'http://127.0.0.1:8378/1/files/file.txt', body: 'argle bargle', }).then(response => { const b = response.data; @@ -94,7 +94,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/testfile.txt', + url: 'http://127.0.0.1:8378/1/files/testfile.txt', body: 'check one two', }).then(response => { const b = response.data; @@ -110,7 +110,7 @@ describe('Parse.File testing', () => { 'X-Parse-REST-API-Key': 'rest', 'X-Parse-Master-Key': 'test', }, - url: 'http://localhost:8378/1/files/' + b.name, + url: 'http://127.0.0.1:8378/1/files/' + b.name, }).then(response => { expect(response.status).toEqual(200); request({ @@ -137,7 +137,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/thefile.jpg', + url: 'http://127.0.0.1:8378/1/files/thefile.jpg', body: 'the file body', }).then(response => { const b = response.data; @@ -149,7 +149,7 @@ describe('Parse.File testing', () => { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/files/' + b.name, + url: 'http://127.0.0.1:8378/1/files/' + b.name, }).then(fail, response => { const del_b = response.data; expect(response.status).toEqual(403); @@ -162,7 +162,7 @@ describe('Parse.File testing', () => { 'X-Parse-REST-API-Key': 'rest', 'X-Parse-Master-Key': 'tryagain', }, - url: 'http://localhost:8378/1/files/' + b.name, + url: 'http://127.0.0.1:8378/1/files/' + b.name, }).then(fail, response => { const del_b2 = response.data; expect(response.status).toEqual(403); @@ -182,7 +182,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/file.jpg', + url: 'http://127.0.0.1:8378/1/files/file.jpg', body: 'argle bargle', }).then(response => { const b = response.data; @@ -360,7 +360,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/file', + url: 'http://127.0.0.1:8378/1/files/file', body: 'fee fi fo', }).then(response => { const b = response.data; @@ -381,7 +381,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/hello world.txt', + url: 'http://127.0.0.1:8378/1/files/hello world.txt', body: 'oh emm gee', }).then(response => { const b = response.data; @@ -423,7 +423,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/di$avowed.txt', + url: 'http://127.0.0.1:8378/1/files/di$avowed.txt', body: 'will fail', }).then(fail, response => { const b = response.data; @@ -446,7 +446,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/' + fileName, + url: 'http://127.0.0.1:8378/1/files/' + fileName, body: 'will fail', }).then(fail, response => { const b = response.data; @@ -599,7 +599,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/file.txt', + url: 'http://127.0.0.1:8378/1/files/file.txt', body: '', }).then(fail, response => { expect(response.status).toBe(400); @@ -618,7 +618,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/', + url: 'http://127.0.0.1:8378/1/files/', body: 'yolo', }).then(fail, response => { expect(response.status).toBe(400); @@ -640,7 +640,7 @@ describe('Parse.File testing', () => { request({ method: 'DELETE', headers: headers, - url: 'http://localhost:8378/1/files/file.txt', + url: 'http://127.0.0.1:8378/1/files/file.txt', }).then(fail, response => { expect(response.status).toBe(400); const body = response.text; @@ -664,7 +664,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/file.txt', + url: 'http://127.0.0.1:8378/1/files/file.txt', body: 'argle bargle', }).then(response => { const b = response.data; @@ -693,7 +693,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/file.txt', + url: 'http://127.0.0.1:8378/1/files/file.txt', body: 'argle bargle', }).then(response => { const b = response.data; @@ -723,7 +723,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/file.txt', + url: 'http://127.0.0.1:8378/1/files/file.txt', body: 'argle bargle', }).then(response => { const b = response.data; @@ -752,7 +752,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/file.txt', + url: 'http://127.0.0.1:8378/1/files/file.txt', body: 'something different', }).then(response => { const b = response.data; @@ -782,7 +782,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/file.txt', + url: 'http://127.0.0.1:8378/1/files/file.txt', body: 'something different', }).then(response => { const b = response.data; @@ -820,7 +820,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/file.txt', + url: 'http://127.0.0.1:8378/1/files/file.txt', body: repeat('argle bargle', 100), }).then(response => { const b = response.data; @@ -843,7 +843,7 @@ describe('Parse.File testing', () => { it('fails to stream unknown file', done => { request({ - url: 'http://localhost:8378/1/files/test/file.txt', + url: 'http://127.0.0.1:8378/1/files/test/file.txt', headers: { 'Content-Type': 'application/octet-stream', 'X-Parse-Application-Id': 'test', @@ -872,7 +872,7 @@ describe('Parse.File testing', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/files/file.txt', + url: 'http://127.0.0.1:8378/1/files/file.txt', body: 'argle bargle', }).then(response => { const b = response.data; diff --git a/spec/ParseGeoPoint.spec.js b/spec/ParseGeoPoint.spec.js index 83868e8d8d..8392814691 100644 --- a/spec/ParseGeoPoint.spec.js +++ b/spec/ParseGeoPoint.spec.js @@ -48,7 +48,7 @@ describe('Parse.GeoPoint testing', () => { obj.set('name', 'Zhoul'); await obj.save(); Parse.Cloud.httpRequest({ - url: 'http://localhost:8378/1/classes/TestObject/' + obj.id, + url: 'http://127.0.0.1:8378/1/classes/TestObject/' + obj.id, headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Master-Key': 'test', diff --git a/spec/ParseGlobalConfig.spec.js b/spec/ParseGlobalConfig.spec.js index 9f8b109ed3..c8b1dc0646 100644 --- a/spec/ParseGlobalConfig.spec.js +++ b/spec/ParseGlobalConfig.spec.js @@ -46,7 +46,7 @@ describe('a GlobalConfig', () => { it('can be retrieved', done => { request({ - url: 'http://localhost:8378/1/config', + url: 'http://127.0.0.1:8378/1/config', json: true, headers, }).then(response => { @@ -63,7 +63,7 @@ describe('a GlobalConfig', () => { it('internal parameter can be retrieved with master key', done => { request({ - url: 'http://localhost:8378/1/config', + url: 'http://127.0.0.1:8378/1/config', json: true, headers, }).then(response => { @@ -80,7 +80,7 @@ describe('a GlobalConfig', () => { it('internal parameter cannot be retrieved without master key', done => { request({ - url: 'http://localhost:8378/1/config', + url: 'http://127.0.0.1:8378/1/config', json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -102,7 +102,7 @@ describe('a GlobalConfig', () => { it('can be updated when a master key exists', done => { request({ method: 'PUT', - url: 'http://localhost:8378/1/config', + url: 'http://127.0.0.1:8378/1/config', json: true, body: { params: { companies: ['US', 'DK', 'SE'] } }, headers, @@ -117,7 +117,7 @@ describe('a GlobalConfig', () => { it('can add and retrive files', done => { request({ method: 'PUT', - url: 'http://localhost:8378/1/config', + url: 'http://127.0.0.1:8378/1/config', json: true, body: { params: { file: { __type: 'File', name: 'name', url: 'http://url' } }, @@ -140,7 +140,7 @@ describe('a GlobalConfig', () => { const geopoint = new Parse.GeoPoint(10, -20); request({ method: 'PUT', - url: 'http://localhost:8378/1/config', + url: 'http://127.0.0.1:8378/1/config', json: true, body: { params: { point: geopoint.toJSON() } }, headers, @@ -160,7 +160,7 @@ describe('a GlobalConfig', () => { it('properly handles delete op', done => { request({ method: 'PUT', - url: 'http://localhost:8378/1/config', + url: 'http://127.0.0.1:8378/1/config', json: true, body: { params: { @@ -175,7 +175,7 @@ describe('a GlobalConfig', () => { expect(response.status).toEqual(200); expect(body.result).toEqual(true); request({ - url: 'http://localhost:8378/1/config', + url: 'http://127.0.0.1:8378/1/config', json: true, headers, }).then(response => { @@ -196,7 +196,7 @@ describe('a GlobalConfig', () => { it('fail to update if master key is missing', done => { request({ method: 'PUT', - url: 'http://localhost:8378/1/config', + url: 'http://127.0.0.1:8378/1/config', json: true, body: { params: { companies: [] } }, headers: { @@ -222,7 +222,7 @@ describe('a GlobalConfig', () => { ) .then(() => { request({ - url: 'http://localhost:8378/1/config', + url: 'http://127.0.0.1:8378/1/config', json: true, headers, }).then(response => { diff --git a/spec/ParseGraphQLServer.spec.js b/spec/ParseGraphQLServer.spec.js index 58b26e4b65..546c7c98a8 100644 --- a/spec/ParseGraphQLServer.spec.js +++ b/spec/ParseGraphQLServer.spec.js @@ -420,7 +420,7 @@ describe('ParseGraphQLServer', () => { ); const wsLink = new WebSocketLink(subscriptionClient); const httpLink = createUploadLink({ - uri: 'http://localhost:13377/graphql', + uri: 'http://127.0.0.1:13377/graphql', fetch, headers, }); @@ -482,7 +482,7 @@ describe('ParseGraphQLServer', () => { }); }).concat( createHttpLink({ - uri: 'http://localhost:13377/graphql', + uri: 'http://127.0.0.1:13377/graphql', fetch, headers: { ...headers, @@ -532,7 +532,7 @@ describe('ParseGraphQLServer', () => { it('should mount playground', async () => { const res = await req({ method: 'GET', - url: 'http://localhost:13377/playground', + url: 'http://127.0.0.1:13377/playground', }); expect(res.status).toEqual(200); }); @@ -6792,7 +6792,7 @@ describe('ParseGraphQLServer', () => { const clientMutationId = uuidv4(); parseServer = await global.reconfigureServer({ - publicServerURL: 'http://localhost:13377/parse', + publicServerURL: 'http://127.0.0.1:13377/parse', }); const body = new FormData(); @@ -6824,7 +6824,7 @@ describe('ParseGraphQLServer', () => { contentType: 'text/plain', }); - let res = await fetch('http://localhost:13377/graphql', { + let res = await fetch('http://127.0.0.1:13377/graphql', { method: 'POST', headers, body, @@ -7045,7 +7045,7 @@ describe('ParseGraphQLServer', () => { const clientMutationId = uuidv4(); const userSchema = new Parse.Schema('_User'); parseServer = await global.reconfigureServer({ - publicServerURL: 'http://localhost:13377/parse', + publicServerURL: 'http://127.0.0.1:13377/parse', auth: { myAuth: { module: global.mockCustomAuthenticator('parse', 'graphql'), @@ -7273,7 +7273,7 @@ describe('ParseGraphQLServer', () => { parseServer = await global.reconfigureServer({ appName: 'test', emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:13377/parse', + publicServerURL: 'http://127.0.0.1:13377/parse', auth: { myAuth: { module: global.mockCustomAuthenticator('parse', 'graphql'), @@ -9094,7 +9094,7 @@ describe('ParseGraphQLServer', () => { it('should support files', async () => { try { parseServer = await global.reconfigureServer({ - publicServerURL: 'http://localhost:13377/parse', + publicServerURL: 'http://127.0.0.1:13377/parse', }); const body = new FormData(); @@ -9124,7 +9124,7 @@ describe('ParseGraphQLServer', () => { contentType: 'text/plain', }); - let res = await fetch('http://localhost:13377/graphql', { + let res = await fetch('http://127.0.0.1:13377/graphql', { method: 'POST', headers, body, @@ -9236,7 +9236,7 @@ describe('ParseGraphQLServer', () => { contentType: 'text/plain', }); - res = await fetch('http://localhost:13377/graphql', { + res = await fetch('http://127.0.0.1:13377/graphql', { method: 'POST', headers, body: body2, @@ -10401,7 +10401,7 @@ describe('ParseGraphQLServer', () => { parseGraphQLServer.applyGraphQL(expressApp); await new Promise(resolve => httpServer.listen({ port: 13377 }, resolve)); const httpLink = createUploadLink({ - uri: 'http://localhost:13377/graphql', + uri: 'http://127.0.0.1:13377/graphql', fetch, headers, }); @@ -10619,7 +10619,7 @@ describe('ParseGraphQLServer', () => { parseGraphQLServer.applyGraphQL(expressApp); await new Promise(resolve => httpServer.listen({ port: 13377 }, resolve)); const httpLink = createUploadLink({ - uri: 'http://localhost:13377/graphql', + uri: 'http://127.0.0.1:13377/graphql', fetch, headers, }); @@ -10803,7 +10803,7 @@ describe('ParseGraphQLServer', () => { parseGraphQLServer.applyGraphQL(expressApp); await new Promise(resolve => httpServer.listen({ port: 13377 }, resolve)); const httpLink = createUploadLink({ - uri: 'http://localhost:13377/graphql', + uri: 'http://127.0.0.1:13377/graphql', fetch, headers, }); diff --git a/spec/ParseHooks.spec.js b/spec/ParseHooks.spec.js index d5d980d3d0..490e3e3b89 100644 --- a/spec/ParseHooks.spec.js +++ b/spec/ParseHooks.spec.js @@ -9,7 +9,7 @@ const auth = require('../lib/Auth'); const Config = require('../lib/Config'); const port = 34567; -const hookServerURL = 'http://localhost:' + port; +const hookServerURL = 'http://127.0.0.1:' + port; describe('Hooks', () => { let server; diff --git a/spec/ParseInstallation.spec.js b/spec/ParseInstallation.spec.js index b11f1337e5..a1551770b3 100644 --- a/spec/ParseInstallation.spec.js +++ b/spec/ParseInstallation.spec.js @@ -1093,7 +1093,7 @@ describe('Installations', () => { }; return request({ headers: headers, - url: 'http://localhost:8378/1/installations/' + createResult.response.objectId, + url: 'http://127.0.0.1:8378/1/installations/' + createResult.response.objectId, }).then(response => { const body = response.data; expect(body.objectId).toEqual(createResult.response.objectId); @@ -1125,7 +1125,7 @@ describe('Installations', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/classes/_Installation', + url: 'http://127.0.0.1:8378/1/classes/_Installation', json: true, body: { date: new Date(), diff --git a/spec/ParseLiveQuery.spec.js b/spec/ParseLiveQuery.spec.js index b8b43f7a3d..37b9ab42d5 100644 --- a/spec/ParseLiveQuery.spec.js +++ b/spec/ParseLiveQuery.spec.js @@ -854,7 +854,7 @@ describe('ParseLiveQuery', function () { verifyUserEmails: true, emailAdapter: emailAdapter, emailVerifyTokenValidityDuration: 20, // 0.5 second - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { const user = new Parse.User(); user.set('password', 'asdf'); diff --git a/spec/ParseLiveQueryServer.spec.js b/spec/ParseLiveQueryServer.spec.js index 0d1a1e6387..b31b6704bd 100644 --- a/spec/ParseLiveQueryServer.spec.js +++ b/spec/ParseLiveQueryServer.spec.js @@ -121,7 +121,7 @@ describe('ParseLiveQueryServer', function () { masterKey: 'world', port: 22345, mountPath: '/1', - serverURL: 'http://localhost:12345/1', + serverURL: 'http://127.0.0.1:12345/1', liveQuery: { classNames: ['Yolo'], }, @@ -143,7 +143,7 @@ describe('ParseLiveQueryServer', function () { masterKey: 'world', port: 22346, mountPath: '/1', - serverURL: 'http://localhost:12345/1', + serverURL: 'http://127.0.0.1:12345/1', liveQuery: { classNames: ['Yolo'], }, diff --git a/spec/ParsePolygon.spec.js b/spec/ParsePolygon.spec.js index fd16832391..27eb3565bc 100644 --- a/spec/ParsePolygon.spec.js +++ b/spec/ParsePolygon.spec.js @@ -448,7 +448,7 @@ describe_only_db('mongo')('Parse.Polygon testing', () => { return reconfigureServer({ appId: 'test', restAPIKey: 'rest', - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', databaseAdapter, }) .then(() => { @@ -462,7 +462,7 @@ describe_only_db('mongo')('Parse.Polygon testing', () => { .then(() => { return request({ method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', body: { _method: 'POST', location, @@ -475,7 +475,7 @@ describe_only_db('mongo')('Parse.Polygon testing', () => { .then(resp => { return request({ method: 'POST', - url: `http://localhost:8378/1/classes/TestObject/${resp.data.objectId}`, + url: `http://127.0.0.1:8378/1/classes/TestObject/${resp.data.objectId}`, body: { _method: 'GET' }, headers: defaultHeaders, }); diff --git a/spec/ParseQuery.FullTextSearch.spec.js b/spec/ParseQuery.FullTextSearch.spec.js index e6614e5d81..0e744c4c4b 100644 --- a/spec/ParseQuery.FullTextSearch.spec.js +++ b/spec/ParseQuery.FullTextSearch.spec.js @@ -21,7 +21,7 @@ const fullTextHelper = async () => { await reconfigureServer({ appId: 'test', restAPIKey: 'test', - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', databaseAdapter, }); await Parse.Object.saveAll( @@ -97,7 +97,7 @@ describe('Parse.Query Full Text Search testing', () => { try { await request({ method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', body: { where, _method: 'GET' }, headers: { 'X-Parse-Application-Id': 'test', @@ -186,7 +186,7 @@ describe_only_db('mongo')('[mongodb] Parse.Query Full Text Search testing', () = expect(indexes.length).toEqual(1); return request({ method: 'PUT', - url: 'http://localhost:8378/1/schemas/TestObject', + url: 'http://127.0.0.1:8378/1/schemas/TestObject', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'test', @@ -216,7 +216,7 @@ describe_only_db('mongo')('[mongodb] Parse.Query Full Text Search testing', () = }; return request({ method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', body: { where, _method: 'GET' }, headers: { 'X-Parse-Application-Id': 'test', @@ -232,7 +232,7 @@ describe_only_db('mongo')('[mongodb] Parse.Query Full Text Search testing', () = .then(indexes => { expect(indexes.length).toEqual(2); request({ - url: 'http://localhost:8378/1/schemas/TestObject', + url: 'http://127.0.0.1:8378/1/schemas/TestObject', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Master-Key': 'test', @@ -284,7 +284,7 @@ describe_only_db('postgres')('[postgres] Parse.Query Full Text Search testing', }; return request({ method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', body: { where, _method: 'GET' }, headers: { 'X-Parse-Application-Id': 'test', @@ -318,7 +318,7 @@ describe_only_db('postgres')('[postgres] Parse.Query Full Text Search testing', }; return request({ method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', body: { where, _method: 'GET' }, headers: { 'X-Parse-Application-Id': 'test', diff --git a/spec/ParseQuery.spec.js b/spec/ParseQuery.spec.js index bf870c92b8..de080c07a2 100644 --- a/spec/ParseQuery.spec.js +++ b/spec/ParseQuery.spec.js @@ -44,7 +44,7 @@ describe('Parse.Query testing', () => { try { await request({ method: 'GET', - url: `http://localhost:8378/1/classes/_User?explain=${value}`, + url: `http://127.0.0.1:8378/1/classes/_User?explain=${value}`, json: true, headers: masterKeyHeaders, }); @@ -74,7 +74,7 @@ describe('Parse.Query testing', () => { for (const value of values) { const response = await request({ method: 'GET', - url: `http://localhost:8378/1/classes/_User?explain=${value}`, + url: `http://127.0.0.1:8378/1/classes/_User?explain=${value}`, json: true, headers: masterKeyHeaders, }); @@ -5108,7 +5108,7 @@ describe('Parse.Query testing', () => { it('can add new config to existing config', async () => { await request({ method: 'PUT', - url: 'http://localhost:8378/1/config', + url: 'http://127.0.0.1:8378/1/config', json: true, body: { params: { @@ -5120,7 +5120,7 @@ describe('Parse.Query testing', () => { await request({ method: 'PUT', - url: 'http://localhost:8378/1/config', + url: 'http://127.0.0.1:8378/1/config', json: true, body: { params: { newConfig: 'good' }, diff --git a/spec/ParseServer.spec.js b/spec/ParseServer.spec.js index fcb15f643f..1691f3b517 100644 --- a/spec/ParseServer.spec.js +++ b/spec/ParseServer.spec.js @@ -25,12 +25,12 @@ describe('Server Url Checks', () => { }); afterAll(done => { - Parse.serverURL = 'http://localhost:8378/1'; + Parse.serverURL = 'http://127.0.0.1:8378/1'; server.close(done); }); it('validate good server url', done => { - Parse.serverURL = 'http://localhost:13376'; + Parse.serverURL = 'http://127.0.0.1:13376'; ParseServer.verifyServerUrl(async result => { if (!result) { done.fail('Did not pass valid url'); diff --git a/spec/ParseServerRESTController.spec.js b/spec/ParseServerRESTController.spec.js index 90fe383257..2d08e56d6f 100644 --- a/spec/ParseServerRESTController.spec.js +++ b/spec/ParseServerRESTController.spec.js @@ -110,7 +110,7 @@ describe('ParseServerRESTController', () => { expect(status).toBe(201); expect(response).toEqual(resp); - expect(location).toBe(`http://localhost:8378/1/classes/MyObject/${resp.objectId}`); + expect(location).toBe(`http://127.0.0.1:8378/1/classes/MyObject/${resp.objectId}`); }); it('should handle response status in batch', async () => { diff --git a/spec/ParseUser.spec.js b/spec/ParseUser.spec.js index 80f6254be8..ce42f61dd9 100644 --- a/spec/ParseUser.spec.js +++ b/spec/ParseUser.spec.js @@ -54,7 +54,7 @@ describe('Parse.User testing', () => { await Parse.User.signUp('asdf', 'zxcv'); request({ method: 'POST', - url: 'http://localhost:8378/1/login', + url: 'http://127.0.0.1:8378/1/login', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -83,7 +83,7 @@ describe('Parse.User testing', () => { await Parse.User.signUp('asdf', 'zxcv'); request({ method: 'POST', - url: 'http://localhost:8378/1/login', + url: 'http://127.0.0.1:8378/1/login', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -112,7 +112,7 @@ describe('Parse.User testing', () => { await Parse.User.signUp('some_user', 'some_password'); request({ method: 'POST', - url: 'http://localhost:8378/1/login', + url: 'http://127.0.0.1:8378/1/login', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -280,7 +280,7 @@ describe('Parse.User testing', () => { it('should be let masterKey lock user out with authData', async () => { const response = await request({ method: 'POST', - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -304,7 +304,7 @@ describe('Parse.User testing', () => { // update the user const options = { method: 'POST', - url: `http://localhost:8378/1/classes/_User/`, + url: `http://127.0.0.1:8378/1/classes/_User/`, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -2117,7 +2117,7 @@ describe('Parse.User testing', () => { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/users', + url: 'http://127.0.0.1:8378/1/users', }).then(response => { const b = response.data; expect(b.results.length).toEqual(1); @@ -2364,7 +2364,7 @@ describe('Parse.User testing', () => { 'X-Parse-Session-Token': user.getSessionToken(), 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions', + url: 'http://127.0.0.1:8378/1/sessions', }).then(response => { const b = response.data; expect(typeof b.sessionToken).toEqual('string'); @@ -2385,7 +2385,7 @@ describe('Parse.User testing', () => { 'X-Parse-Session-Token': user.getSessionToken(), 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions/me', + url: 'http://127.0.0.1:8378/1/sessions/me', }); const data = response.data; expect(typeof data.sessionToken).toEqual('string'); @@ -2406,7 +2406,7 @@ describe('Parse.User testing', () => { 'X-Parse-Session-Token': user.getSessionToken(), 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions/me', + url: 'http://127.0.0.1:8378/1/sessions/me', }); const data = response.data; expect(typeof data.sessionToken).toEqual('string'); @@ -2425,7 +2425,7 @@ describe('Parse.User testing', () => { 'X-Parse-Session-Token': user.getSessionToken(), 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions/me', + url: 'http://127.0.0.1:8378/1/sessions/me', }); const data = response.data; expect(typeof data.sessionToken).toEqual('string'); @@ -2448,7 +2448,7 @@ describe('Parse.User testing', () => { 'X-Parse-Session-Token': user.getSessionToken(), 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions/me', + url: 'http://127.0.0.1:8378/1/sessions/me', }).then(response => { const b = response.data; request({ @@ -2458,7 +2458,7 @@ describe('Parse.User testing', () => { 'X-Parse-Session-Token': user.getSessionToken(), 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions/' + b.objectId, + url: 'http://127.0.0.1:8378/1/sessions/' + b.objectId, body: JSON.stringify({ foo: 'bar' }), }).then(() => { done(); @@ -2479,7 +2479,7 @@ describe('Parse.User testing', () => { 'X-Parse-Session-Token': user.getSessionToken(), 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions/me', + url: 'http://127.0.0.1:8378/1/sessions/me', }).then(response => { const b = response.data; request({ @@ -2490,7 +2490,7 @@ describe('Parse.User testing', () => { 'X-Parse-REST-API-Key': 'rest', 'Content-Type': 'application/json', }, - url: 'http://localhost:8378/1/sessions/' + b.objectId, + url: 'http://127.0.0.1:8378/1/sessions/' + b.objectId, body: JSON.stringify({ foo: 'bar' }), }).then(fail, response => { const b = response.data; @@ -2501,7 +2501,7 @@ describe('Parse.User testing', () => { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions/' + b.objectId, + url: 'http://127.0.0.1:8378/1/sessions/' + b.objectId, body: JSON.stringify({ foo: 'bar' }), }).then(fail, response => { const b = response.data; @@ -2528,7 +2528,7 @@ describe('Parse.User testing', () => { 'X-Parse-Session-Token': user.getSessionToken(), 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions', + url: 'http://127.0.0.1:8378/1/sessions', }).then(response => { const b = response.data; expect(b.results.length).toEqual(1); @@ -2554,7 +2554,7 @@ describe('Parse.User testing', () => { 'X-Parse-Session-Token': user.getSessionToken(), 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions', + url: 'http://127.0.0.1:8378/1/sessions', }).then(response => { const b = response.data; let objId; @@ -2573,7 +2573,7 @@ describe('Parse.User testing', () => { 'X-Parse-Session-Token': user.getSessionToken(), 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions/' + objId, + url: 'http://127.0.0.1:8378/1/sessions/' + objId, }).then(() => { request({ headers: { @@ -2581,7 +2581,7 @@ describe('Parse.User testing', () => { 'X-Parse-Session-Token': user.getSessionToken(), 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions', + url: 'http://127.0.0.1:8378/1/sessions', }).then(fail, response => { const b = response.data; expect(b.code).toEqual(209); @@ -2608,7 +2608,7 @@ describe('Parse.User testing', () => { 'X-Parse-Session-Token': user.getSessionToken(), 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions', + url: 'http://127.0.0.1:8378/1/sessions', }).then(response => { const b = response.data; expect(b.results.length).toEqual(1); @@ -2619,7 +2619,7 @@ describe('Parse.User testing', () => { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', }, - url: 'http://localhost:8378/1/sessions/' + objId, + url: 'http://127.0.0.1:8378/1/sessions/' + objId, }).then(fail, response => { const b = response.data; expect(b.code).toEqual(209); @@ -2747,7 +2747,7 @@ describe('Parse.User testing', () => { it('session expiresAt correct format', async done => { await Parse.User.signUp('asdf', 'zxcv'); request({ - url: 'http://localhost:8378/1/classes/_Session', + url: 'http://127.0.0.1:8378/1/classes/_Session', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Master-Key': 'test', @@ -2762,7 +2762,7 @@ describe('Parse.User testing', () => { it('Invalid session tokens are rejected', async done => { await Parse.User.signUp('asdf', 'zxcv'); request({ - url: 'http://localhost:8378/1/classes/AClass', + url: 'http://127.0.0.1:8378/1/classes/AClass', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Rest-API-Key': 'rest', @@ -2792,7 +2792,7 @@ describe('Parse.User testing', () => { ) .then(() => { return request({ - url: 'http://localhost:8378/1/login?username=user&password=test', + url: 'http://127.0.0.1:8378/1/login?username=user&password=test', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Master-Key': 'test', @@ -2851,7 +2851,7 @@ describe('Parse.User testing', () => { // Simulate anonymous user save request({ method: 'POST', - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -2870,7 +2870,7 @@ describe('Parse.User testing', () => { // Simulate registration return request({ method: 'PUT', - url: 'http://localhost:8378/1/classes/_User/' + user.objectId, + url: 'http://127.0.0.1:8378/1/classes/_User/' + user.objectId, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Session-Token': user.sessionToken, @@ -2894,7 +2894,7 @@ describe('Parse.User testing', () => { expect(user.sessionToken).not.toEqual(originalSessionToken); // test that the sessionToken is valid return request({ - url: 'http://localhost:8378/1/users/me', + url: 'http://127.0.0.1:8378/1/users/me', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Session-Token': user.sessionToken, @@ -2930,12 +2930,12 @@ describe('Parse.User testing', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); // Simulate anonymous user save return request({ method: 'POST', - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -2951,7 +2951,7 @@ describe('Parse.User testing', () => { const user = response.data; return request({ method: 'PUT', - url: 'http://localhost:8378/1/classes/_User/' + user.objectId, + url: 'http://127.0.0.1:8378/1/classes/_User/' + user.objectId, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Session-Token': user.sessionToken, @@ -2994,7 +2994,7 @@ describe('Parse.User testing', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); const user = new Parse.User(); user.set('username', 'asdf@jkl.com'); @@ -3003,7 +3003,7 @@ describe('Parse.User testing', () => { await user.signUp(); request({ method: 'POST', - url: 'http://localhost:8378/1/requestPasswordReset', + url: 'http://127.0.0.1:8378/1/requestPasswordReset', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Session-Token': user.sessionToken, @@ -3083,7 +3083,7 @@ describe('Parse.User testing', () => { .then(() => request({ method: 'GET', - url: 'http://localhost:8378/1/classes/_Session', + url: 'http://127.0.0.1:8378/1/classes/_Session', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Master-Key': 'test', @@ -3097,7 +3097,7 @@ describe('Parse.User testing', () => { token = body.results[0].sessionToken; return request({ method: 'PUT', - url: 'http://localhost:8378/1/classes/_Session/' + id, + url: 'http://127.0.0.1:8378/1/classes/_Session/' + id, headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Master-Key': 'test', @@ -3181,7 +3181,7 @@ describe('Parse.User testing', () => { it('should revoke sessions when converting anonymous user to "normal" user', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3225,7 +3225,7 @@ describe('Parse.User testing', () => { reconfigureServer({ revokeSessionOnPasswordReset: false }).then(() => { request({ method: 'POST', - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3298,7 +3298,7 @@ describe('Parse.User testing', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { return user.signUp(); @@ -3334,7 +3334,7 @@ describe('Parse.User testing', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { return user.signUp(); @@ -3342,7 +3342,7 @@ describe('Parse.User testing', () => { .then(() => request({ method: 'GET', - url: 'http://localhost:8378/1/users/me', + url: 'http://127.0.0.1:8378/1/users/me', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Session-Token': Parse.User.current().getSessionToken(), @@ -3377,7 +3377,7 @@ describe('Parse.User testing', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { return user.signUp(); @@ -3385,7 +3385,7 @@ describe('Parse.User testing', () => { .then(() => request({ method: 'GET', - url: 'http://localhost:8378/1/users/' + Parse.User.current().id, + url: 'http://127.0.0.1:8378/1/users/' + Parse.User.current().id, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3422,14 +3422,14 @@ describe('Parse.User testing', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { return user.signUp(); }) .then(() => request({ - url: 'http://localhost:8378/1/login?email=test@email.com&username=hello&password=world', + url: 'http://127.0.0.1:8378/1/login?email=test@email.com&username=hello&password=world', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3466,7 +3466,7 @@ describe('Parse.User testing', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { return user.signUp(); @@ -3517,7 +3517,7 @@ describe('Parse.User testing', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); const user = new Parse.User(); user.set('email', 'email1@host.com'); @@ -3540,7 +3540,7 @@ describe('Parse.User testing', () => { function validate(block) { return request({ - url: `http://localhost:8378/1/classes/_User/${objectId}`, + url: `http://127.0.0.1:8378/1/classes/_User/${objectId}`, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3551,7 +3551,7 @@ describe('Parse.User testing', () => { request({ method: 'POST', - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3577,7 +3577,7 @@ describe('Parse.User testing', () => { // update the user const options = { method: 'PUT', - url: `http://localhost:8378/1/classes/_User/${objectId}`, + url: `http://127.0.0.1:8378/1/classes/_User/${objectId}`, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3616,7 +3616,7 @@ describe('Parse.User testing', () => { }) .then(() => { const options = { - url: `http://localhost:8378/1/login`, + url: `http://127.0.0.1:8378/1/login`, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3640,7 +3640,7 @@ describe('Parse.User testing', () => { .then(() => { const options = { method: 'POST', - url: `http://localhost:8378/1/login`, + url: `http://127.0.0.1:8378/1/login`, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3664,7 +3664,7 @@ describe('Parse.User testing', () => { }) .then(() => { const options = { - url: `http://localhost:8378/1/login?email=yo@lo.com&password=yolopass`, + url: `http://127.0.0.1:8378/1/login?email=yo@lo.com&password=yolopass`, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3686,7 +3686,7 @@ describe('Parse.User testing', () => { }) .then(() => { const options = { - url: `http://localhost:8378/1/login?email=yo@lo.com&username=yolo&password=yolopass`, + url: `http://127.0.0.1:8378/1/login?email=yo@lo.com&username=yolo&password=yolopass`, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3708,7 +3708,7 @@ describe('Parse.User testing', () => { }) .then(() => { const options = { - url: `http://localhost:8378/1/login?email=yo@lo.com&username=yolo2&password=yolopass`, + url: `http://127.0.0.1:8378/1/login?email=yo@lo.com&username=yolo2&password=yolopass`, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3733,7 +3733,7 @@ describe('Parse.User testing', () => { }) .then(() => { const options = { - url: `http://localhost:8378/1/login?email=yo@lo2.com&username=yolo&password=yolopass`, + url: `http://127.0.0.1:8378/1/login?email=yo@lo2.com&username=yolo&password=yolopass`, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3758,7 +3758,7 @@ describe('Parse.User testing', () => { }) .then(() => { const options = { - url: `http://localhost:8378/1/login?password=yolopass`, + url: `http://127.0.0.1:8378/1/login?password=yolopass`, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -3849,7 +3849,7 @@ describe('Parse.User testing', () => { }) .then(() => { const options = { - url: `http://localhost:8378/1/login?username=yolo`, + url: `http://127.0.0.1:8378/1/login?username=yolo`, headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -4119,7 +4119,7 @@ describe('login as other user', () => { try { const response = await request({ method: 'POST', - url: 'http://localhost:8378/1/loginAs', + url: 'http://127.0.0.1:8378/1/loginAs', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -4147,7 +4147,7 @@ describe('login as other user', () => { try { await request({ method: 'POST', - url: 'http://localhost:8378/1/loginAs', + url: 'http://127.0.0.1:8378/1/loginAs', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -4179,7 +4179,7 @@ describe('login as other user', () => { try { await request({ method: 'POST', - url: 'http://localhost:8378/1/loginAs', + url: 'http://127.0.0.1:8378/1/loginAs', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', @@ -4213,7 +4213,7 @@ describe('login as other user', () => { try { await request({ method: 'POST', - url: 'http://localhost:8378/1/loginAs', + url: 'http://127.0.0.1:8378/1/loginAs', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-REST-API-Key': 'rest', diff --git a/spec/PasswordPolicy.spec.js b/spec/PasswordPolicy.spec.js index 6d00ddfa28..4c21458cb7 100644 --- a/spec/PasswordPolicy.spec.js +++ b/spec/PasswordPolicy.spec.js @@ -19,7 +19,7 @@ describe('Password Policy: ', () => { passwordPolicy: { resetTokenValidityDuration: 0.5, // 0.5 second }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('testResetTokenValidity'); @@ -48,7 +48,7 @@ describe('Password Policy: ', () => { .then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/invalid_link.html' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/invalid_link.html' ); done(); }) @@ -79,7 +79,7 @@ describe('Password Policy: ', () => { passwordPolicy: { resetTokenValidityDuration: 5, // 5 seconds }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('testResetTokenValidity'); @@ -137,7 +137,7 @@ describe('Password Policy: ', () => { passwordPolicy: { resetTokenValidityDuration: 5 * 60, // 5 minutes }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); const user = new Parse.User(); user.setUsername('testResetTokenValidity'); @@ -166,7 +166,7 @@ describe('Password Policy: ', () => { resetTokenValidityDuration: 5 * 60, // 5 minutes resetTokenReuseIfValid: true, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); const user = new Parse.User(); user.setUsername('testResetTokenValidity'); @@ -196,7 +196,7 @@ describe('Password Policy: ', () => { resetTokenValidityDuration: 5 * 60, // 5 minutes resetTokenReuseIfValid: [], }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); fail('should have thrown.'); } catch (e) { @@ -209,7 +209,7 @@ describe('Password Policy: ', () => { passwordPolicy: { resetTokenReuseIfValid: true, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); fail('should have thrown.'); } catch (e) { @@ -224,7 +224,7 @@ describe('Password Policy: ', () => { passwordPolicy: { resetTokenValidityDuration: 'not a number', }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { fail('passwordPolicy.resetTokenValidityDuration "not a number" test failed'); @@ -242,7 +242,7 @@ describe('Password Policy: ', () => { passwordPolicy: { resetTokenValidityDuration: 0, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { fail('resetTokenValidityDuration negative number test failed'); @@ -260,7 +260,7 @@ describe('Password Policy: ', () => { passwordPolicy: { validatorPattern: 1234, // number is not a valid setting }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { fail('passwordPolicy.validatorPattern type test failed'); @@ -280,7 +280,7 @@ describe('Password Policy: ', () => { passwordPolicy: { validatorCallback: 'abc', // string is not a valid setting }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { fail('passwordPolicy.validatorCallback type test failed'); @@ -299,7 +299,7 @@ describe('Password Policy: ', () => { passwordPolicy: { validatorPattern: /[0-9]+/, // password should contain at least one digit }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('nodigit'); @@ -324,7 +324,7 @@ describe('Password Policy: ', () => { passwordPolicy: { validatorPattern: '^.{8,}', // password should contain at least 8 char }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('less'); @@ -349,7 +349,7 @@ describe('Password Policy: ', () => { passwordPolicy: { validatorPattern: '^.{8,}', // password should contain at least 8 char }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword(''); @@ -374,7 +374,7 @@ describe('Password Policy: ', () => { passwordPolicy: { validatorPattern: /[0-9]+/, // password should contain at least one digit }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('1digit'); @@ -415,7 +415,7 @@ describe('Password Policy: ', () => { passwordPolicy: { validatorPattern: '[!@#$]+', // password should contain at least one special char }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('p@sswrod'); @@ -456,7 +456,7 @@ describe('Password Policy: ', () => { passwordPolicy: { validatorCallback: () => false, // just fail }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('any'); @@ -481,7 +481,7 @@ describe('Password Policy: ', () => { passwordPolicy: { validatorCallback: () => true, // never fail }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('oneUpper'); @@ -523,7 +523,7 @@ describe('Password Policy: ', () => { validatorPattern: /[A-Z]+/, // password should contain at least one UPPER case letter validatorCallback: () => true, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('all lower'); @@ -549,7 +549,7 @@ describe('Password Policy: ', () => { validatorPattern: /[A-Z]+/, // password should contain at least one UPPER case letter validatorCallback: () => false, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('oneUpper'); @@ -575,7 +575,7 @@ describe('Password Policy: ', () => { validatorPattern: /[A-Z]+/, // password should contain at least one digit validatorCallback: () => true, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('oneUpper'); @@ -633,7 +633,7 @@ describe('Password Policy: ', () => { request({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=has2init&token=${token}&username=user1`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -645,7 +645,7 @@ describe('Password Policy: ', () => { .then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/password_reset_success.html?username=user1' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/password_reset_success.html?username=user1' ); Parse.User.logIn('user1', 'has2init') @@ -679,7 +679,7 @@ describe('Password Policy: ', () => { passwordPolicy: { validatorPattern: /[0-9]+/, // password should contain at least one digit }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('has 1 digit'); @@ -725,7 +725,7 @@ describe('Password Policy: ', () => { request({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=hasnodigit&token=${token}&username=user1`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -737,7 +737,7 @@ describe('Password Policy: ', () => { .then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - `Found. Redirecting to http://localhost:8378/1/apps/choose_password?username=user1&token=${token}&id=test&error=Password%20should%20contain%20at%20least%20one%20digit.&app=passwordPolicy` + `Found. Redirecting to http://127.0.0.1:8378/1/apps/choose_password?username=user1&token=${token}&id=test&error=Password%20should%20contain%20at%20least%20one%20digit.&app=passwordPolicy` ); Parse.User.logIn('user1', 'has 1 digit') @@ -772,7 +772,7 @@ describe('Password Policy: ', () => { validatorPattern: /[0-9]+/, // password should contain at least one digit validationError: 'Password should contain at least one digit.', }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('has 1 digit'); @@ -800,7 +800,7 @@ describe('Password Policy: ', () => { passwordPolicy: { doNotAllowUsername: 'no', }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { fail('passwordPolicy.doNotAllowUsername type test failed'); @@ -820,7 +820,7 @@ describe('Password Policy: ', () => { validatorPattern: /[0-9]+/, doNotAllowUsername: true, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('@user11'); @@ -846,7 +846,7 @@ describe('Password Policy: ', () => { passwordPolicy: { doNotAllowUsername: true, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('r@nd0m'); @@ -870,7 +870,7 @@ describe('Password Policy: ', () => { passwordPolicy: { validatorPattern: /[0-9]+/, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('user1'); @@ -911,7 +911,7 @@ describe('Password Policy: ', () => { request({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=xuser12&token=${token}&username=user1`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -923,7 +923,7 @@ describe('Password Policy: ', () => { .then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - `Found. Redirecting to http://localhost:8378/1/apps/choose_password?username=user1&token=${token}&id=test&error=Password%20cannot%20contain%20your%20username.&app=passwordPolicy` + `Found. Redirecting to http://127.0.0.1:8378/1/apps/choose_password?username=user1&token=${token}&id=test&error=Password%20cannot%20contain%20your%20username.&app=passwordPolicy` ); Parse.User.logIn('user1', 'r@nd0m') @@ -957,7 +957,7 @@ describe('Password Policy: ', () => { passwordPolicy: { doNotAllowUsername: true, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('r@nd0m'); @@ -1002,7 +1002,7 @@ describe('Password Policy: ', () => { try { await request({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=xuser12&token=${token}&username=user1`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -1028,7 +1028,7 @@ describe('Password Policy: ', () => { passwordPolicy: { doNotAllowUsername: true, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); user.setUsername('user1'); user.setPassword('r@nd0m'); @@ -1062,7 +1062,7 @@ describe('Password Policy: ', () => { request({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=uuser11&token=${token}&username=user1`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -1074,7 +1074,7 @@ describe('Password Policy: ', () => { .then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/password_reset_success.html?username=user1' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/password_reset_success.html?username=user1' ); Parse.User.logIn('user1', 'uuser11') @@ -1107,7 +1107,7 @@ describe('Password Policy: ', () => { validatorPattern: /[0-9]+/, doNotAllowUsername: false, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setUsername('user1'); @@ -1134,7 +1134,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordAge: 'not a number', }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { fail('passwordPolicy.maxPasswordAge "not a number" test failed'); @@ -1152,7 +1152,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordAge: -100, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { fail('passwordPolicy.maxPasswordAge negative number test failed'); @@ -1171,7 +1171,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordAge: 1, // 1 day }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('user1'); @@ -1204,7 +1204,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordAge: 0.5 / (24 * 60 * 60), // 0.5 sec }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('user1'); @@ -1240,7 +1240,7 @@ describe('Password Policy: ', () => { const user = new Parse.User(); reconfigureServer({ appName: 'passwordPolicy', - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('user1'); @@ -1255,7 +1255,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordAge: 0.5 / (24 * 60 * 60), // 0.5 sec }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { Parse.User.logIn('user1', 'user1') .then(() => { @@ -1328,7 +1328,7 @@ describe('Password Policy: ', () => { request({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=uuser11&token=${token}&username=user1`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -1340,7 +1340,7 @@ describe('Password Policy: ', () => { .then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/password_reset_success.html?username=user1' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/password_reset_success.html?username=user1' ); Parse.User.logIn('user1', 'uuser11') @@ -1371,7 +1371,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordAge: 0.5 / (24 * 60 * 60), // 0.5 sec }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('user1'); @@ -1413,7 +1413,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordHistory: 'not a number', }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { fail('passwordPolicy.maxPasswordHistory "not a number" test failed'); @@ -1431,7 +1431,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordHistory: -10, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { fail('passwordPolicy.maxPasswordHistory negative number test failed'); @@ -1449,7 +1449,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordHistory: 21, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { fail('passwordPolicy.maxPasswordHistory negative number test failed'); @@ -1483,7 +1483,7 @@ describe('Password Policy: ', () => { .then(token => { return request({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=user1&token=${token}&username=user1`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -1500,7 +1500,7 @@ describe('Password Policy: ', () => { const token = data[1]; expect(response.status).toEqual(302); expect(response.text).toEqual( - `Found. Redirecting to http://localhost:8378/1/apps/choose_password?username=user1&token=${token}&id=test&error=New%20password%20should%20not%20be%20the%20same%20as%20last%201%20passwords.&app=passwordPolicy` + `Found. Redirecting to http://127.0.0.1:8378/1/apps/choose_password?username=user1&token=${token}&id=test&error=New%20password%20should%20not%20be%20the%20same%20as%20last%201%20passwords.&app=passwordPolicy` ); done(); return Promise.resolve(); @@ -1520,7 +1520,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordHistory: 1, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('user1'); @@ -1550,7 +1550,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordHistory: 5, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('user1'); @@ -1583,7 +1583,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordHistory: 5, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('user1'); @@ -1633,7 +1633,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordHistory: 5, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setUsername('user1'); user.setPassword('user1'); @@ -1686,7 +1686,7 @@ describe('Password Policy: ', () => { passwordPolicy: { maxPasswordHistory: 1, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); user.setUsername('user1'); user.setPassword('user1'); diff --git a/spec/PostgresInitOptions.spec.js b/spec/PostgresInitOptions.spec.js index 069d5a6437..aeff86d151 100644 --- a/spec/PostgresInitOptions.spec.js +++ b/spec/PostgresInitOptions.spec.js @@ -28,7 +28,7 @@ function createParseServer(options) { return new Promise((resolve, reject) => { const parseServer = new ParseServer.default( Object.assign({}, defaultConfiguration, options, { - serverURL: 'http://localhost:12668/parse', + serverURL: 'http://127.0.0.1:12668/parse', serverStartComplete: error => { if (error) { reject(error); @@ -38,7 +38,7 @@ function createParseServer(options) { app.use('/parse', parseServer.app); const server = app.listen(12668); - Parse.serverURL = 'http://localhost:12668/parse'; + Parse.serverURL = 'http://127.0.0.1:12668/parse'; resolve(server); } }, @@ -52,7 +52,7 @@ describe_only_db('postgres')('Postgres database init options', () => { afterAll(done => { if (server) { - Parse.serverURL = 'http://localhost:8378/1'; + Parse.serverURL = 'http://127.0.0.1:8378/1'; server.close(done); } }); diff --git a/spec/PublicAPI.spec.js b/spec/PublicAPI.spec.js index 545662914f..4d8ebb9485 100644 --- a/spec/PublicAPI.spec.js +++ b/spec/PublicAPI.spec.js @@ -12,13 +12,13 @@ const request = function (url, callback) { describe('public API', () => { it('should return missing username error on ajax request without username provided', async () => { await reconfigureServer({ - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); try { await req({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=user1&token=43634643&username=`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -34,13 +34,13 @@ describe('public API', () => { it('should return missing token error on ajax request without token provided', async () => { await reconfigureServer({ - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); try { await req({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=user1&token=&username=Johnny`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -56,13 +56,13 @@ describe('public API', () => { it('should return missing password error on ajax request without password provided', async () => { await reconfigureServer({ - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); try { await req({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=&token=132414&username=Johnny`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -77,7 +77,7 @@ describe('public API', () => { }); it('should get invalid_link.html', done => { - request('http://localhost:8378/1/apps/invalid_link.html', (err, httpResponse) => { + request('http://127.0.0.1:8378/1/apps/invalid_link.html', (err, httpResponse) => { expect(httpResponse.status).toBe(200); done(); }); @@ -86,9 +86,9 @@ describe('public API', () => { it('should get choose_password', done => { reconfigureServer({ appName: 'unused', - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { - request('http://localhost:8378/1/apps/choose_password?id=test', (err, httpResponse) => { + request('http://127.0.0.1:8378/1/apps/choose_password?id=test', (err, httpResponse) => { expect(httpResponse.status).toBe(200); done(); }); @@ -96,14 +96,14 @@ describe('public API', () => { }); it('should get verify_email_success.html', done => { - request('http://localhost:8378/1/apps/verify_email_success.html', (err, httpResponse) => { + request('http://127.0.0.1:8378/1/apps/verify_email_success.html', (err, httpResponse) => { expect(httpResponse.status).toBe(200); done(); }); }); it('should get password_reset_success.html', done => { - request('http://localhost:8378/1/apps/password_reset_success.html', (err, httpResponse) => { + request('http://127.0.0.1:8378/1/apps/password_reset_success.html', (err, httpResponse) => { expect(httpResponse.status).toBe(200); done(); }); @@ -115,21 +115,21 @@ describe('public API without publicServerURL', () => { reconfigureServer({ appName: 'unused' }).then(done, fail); }); it('should get 404 on verify_email', done => { - request('http://localhost:8378/1/apps/test/verify_email', (err, httpResponse) => { + request('http://127.0.0.1:8378/1/apps/test/verify_email', (err, httpResponse) => { expect(httpResponse.status).toBe(404); done(); }); }); it('should get 404 choose_password', done => { - request('http://localhost:8378/1/apps/choose_password?id=test', (err, httpResponse) => { + request('http://127.0.0.1:8378/1/apps/choose_password?id=test', (err, httpResponse) => { expect(httpResponse.status).toBe(404); done(); }); }); it('should get 404 on request_password_reset', done => { - request('http://localhost:8378/1/apps/test/request_password_reset', (err, httpResponse) => { + request('http://127.0.0.1:8378/1/apps/test/request_password_reset', (err, httpResponse) => { expect(httpResponse.status).toBe(404); done(); }); @@ -142,21 +142,21 @@ describe('public API supplied with invalid application id', () => { }); it('should get 403 on verify_email', done => { - request('http://localhost:8378/1/apps/invalid/verify_email', (err, httpResponse) => { + request('http://127.0.0.1:8378/1/apps/invalid/verify_email', (err, httpResponse) => { expect(httpResponse.status).toBe(403); done(); }); }); it('should get 403 choose_password', done => { - request('http://localhost:8378/1/apps/choose_password?id=invalid', (err, httpResponse) => { + request('http://127.0.0.1:8378/1/apps/choose_password?id=invalid', (err, httpResponse) => { expect(httpResponse.status).toBe(403); done(); }); }); it('should get 403 on get of request_password_reset', done => { - request('http://localhost:8378/1/apps/invalid/request_password_reset', (err, httpResponse) => { + request('http://127.0.0.1:8378/1/apps/invalid/request_password_reset', (err, httpResponse) => { expect(httpResponse.status).toBe(403); done(); }); @@ -164,7 +164,7 @@ describe('public API supplied with invalid application id', () => { it('should get 403 on post of request_password_reset', done => { req({ - url: 'http://localhost:8378/1/apps/invalid/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/invalid/request_password_reset', method: 'POST', }).then(done.fail, httpResponse => { expect(httpResponse.status).toBe(403); @@ -174,7 +174,7 @@ describe('public API supplied with invalid application id', () => { it('should get 403 on resendVerificationEmail', done => { request( - 'http://localhost:8378/1/apps/invalid/resend_verification_email', + 'http://127.0.0.1:8378/1/apps/invalid/resend_verification_email', (err, httpResponse) => { expect(httpResponse.status).toBe(403); done(); diff --git a/spec/PurchaseValidation.spec.js b/spec/PurchaseValidation.spec.js index f139b1fd04..b82f1dd1d3 100644 --- a/spec/PurchaseValidation.spec.js +++ b/spec/PurchaseValidation.spec.js @@ -40,7 +40,7 @@ describe('test validate_receipt endpoint', () => { 'Content-Type': 'application/json', }, method: 'POST', - url: 'http://localhost:8378/1/validate_purchase', + url: 'http://127.0.0.1:8378/1/validate_purchase', body: { productIdentifier: 'a-product', receipt: { @@ -70,7 +70,7 @@ describe('test validate_receipt endpoint', () => { 'X-Parse-REST-API-Key': 'rest', 'Content-Type': 'application/json', }, - url: 'http://localhost:8378/1/validate_purchase', + url: 'http://127.0.0.1:8378/1/validate_purchase', method: 'POST', body: { productIdentifier: 'a-product', @@ -88,7 +88,7 @@ describe('test validate_receipt endpoint', () => { 'X-Parse-REST-API-Key': 'rest', 'Content-Type': 'application/json', }, - url: 'http://localhost:8378/1/validate_purchase', + url: 'http://127.0.0.1:8378/1/validate_purchase', method: 'POST', body: { receipt: { @@ -109,7 +109,7 @@ describe('test validate_receipt endpoint', () => { 'X-Parse-REST-API-Key': 'rest', 'Content-Type': 'application/json', }, - url: 'http://localhost:8378/1/validate_purchase', + url: 'http://127.0.0.1:8378/1/validate_purchase', method: 'POST', body: { productIdentifier: 'another-product', @@ -136,7 +136,7 @@ describe('test validate_receipt endpoint', () => { 'X-Parse-REST-API-Key': 'rest', 'Content-Type': 'application/json', }, - url: 'http://localhost:8378/1/validate_purchase', + url: 'http://127.0.0.1:8378/1/validate_purchase', method: 'POST', body: { productIdentifier: 'a-product', diff --git a/spec/PushController.spec.js b/spec/PushController.spec.js index 4626b5e0a7..1af919e00e 100644 --- a/spec/PushController.spec.js +++ b/spec/PushController.spec.js @@ -557,7 +557,7 @@ describe('PushController', () => { }; await installation.save(); await reconfigureServer({ - serverURL: 'http://localhost:8378/', // server with borked URL + serverURL: 'http://127.0.0.1:8378/', // server with borked URL push: { adapter: pushAdapter }, }); const pushStatusId = await sendPush(payload, {}, config, auth); @@ -567,7 +567,7 @@ describe('PushController', () => { resolve(); }, 1000); }); - Parse.serverURL = 'http://localhost:8378/1'; // GOOD url + Parse.serverURL = 'http://127.0.0.1:8378/1'; // GOOD url const result = await Parse.Push.getPushStatus(pushStatusId); expect(result).toBeDefined(); await pushCompleted(pushStatusId); diff --git a/spec/ReadPreferenceOption.spec.js b/spec/ReadPreferenceOption.spec.js index f2bc328d99..80e14770bb 100644 --- a/spec/ReadPreferenceOption.spec.js +++ b/spec/ReadPreferenceOption.spec.js @@ -410,7 +410,7 @@ describe_only_db('mongo')('Read preference option', () => { const response = await request({ method: 'GET', - url: 'http://localhost:8378/1/classes/MyObject/' + obj0.id, + url: 'http://127.0.0.1:8378/1/classes/MyObject/' + obj0.id, headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -444,7 +444,7 @@ describe_only_db('mongo')('Read preference option', () => { const response = await request({ method: 'GET', - url: 'http://localhost:8378/1/classes/MyObject/' + obj0.id + '?readPreference=SECONDARY', + url: 'http://127.0.0.1:8378/1/classes/MyObject/' + obj0.id + '?readPreference=SECONDARY', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -481,7 +481,7 @@ describe_only_db('mongo')('Read preference option', () => { const response = await request({ method: 'GET', - url: 'http://localhost:8378/1/classes/MyObject/' + obj0.id + '?readPreference=SECONDARY', + url: 'http://127.0.0.1:8378/1/classes/MyObject/' + obj0.id + '?readPreference=SECONDARY', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -518,7 +518,7 @@ describe_only_db('mongo')('Read preference option', () => { const response = await request({ method: 'GET', - url: 'http://localhost:8378/1/classes/MyObject/', + url: 'http://127.0.0.1:8378/1/classes/MyObject/', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -551,7 +551,7 @@ describe_only_db('mongo')('Read preference option', () => { const response = await request({ method: 'GET', - url: 'http://localhost:8378/1/classes/MyObject?readPreference=SECONDARY', + url: 'http://127.0.0.1:8378/1/classes/MyObject?readPreference=SECONDARY', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -588,7 +588,7 @@ describe_only_db('mongo')('Read preference option', () => { const response = await request({ method: 'GET', - url: 'http://localhost:8378/1/classes/MyObject/?readPreference=SECONDARY', + url: 'http://127.0.0.1:8378/1/classes/MyObject/?readPreference=SECONDARY', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -854,7 +854,7 @@ describe_only_db('mongo')('Read preference option', () => { const response = await request({ method: 'GET', url: - 'http://localhost:8378/1/classes/MyObject2/' + + 'http://127.0.0.1:8378/1/classes/MyObject2/' + obj2.id + '?include=' + JSON.stringify(['myObject1', 'myObject1.myObject0']) + @@ -909,7 +909,7 @@ describe_only_db('mongo')('Read preference option', () => { const response = await request({ method: 'GET', url: - 'http://localhost:8378/1/classes/MyObject2?where=' + + 'http://127.0.0.1:8378/1/classes/MyObject2?where=' + JSON.stringify({ boolKey: false }) + '&include=' + JSON.stringify(['myObject1', 'myObject1.myObject0']) + @@ -1200,7 +1200,7 @@ describe_only_db('mongo')('Read preference option', () => { const response = await request({ method: 'GET', url: - 'http://localhost:8378/1/classes/MyObject2/?where=' + + 'http://127.0.0.1:8378/1/classes/MyObject2/?where=' + whereString + '&readPreference=SECONDARY_PREFERRED&subqueryReadPreference=SECONDARY', headers: { diff --git a/spec/RegexVulnerabilities.spec.js b/spec/RegexVulnerabilities.spec.js index 62af4f04e2..082b36a7b5 100644 --- a/spec/RegexVulnerabilities.spec.js +++ b/spec/RegexVulnerabilities.spec.js @@ -1,6 +1,6 @@ const request = require('../lib/request'); -const serverURL = 'http://localhost:8378/1'; +const serverURL = 'http://127.0.0.1:8378/1'; const headers = { 'Content-Type': 'application/json', }; @@ -14,7 +14,7 @@ const emailAdapter = { sendMail: () => {}, }; const appName = 'test'; -const publicServerURL = 'http://localhost:8378/1'; +const publicServerURL = 'http://127.0.0.1:8378/1'; describe('Regex Vulnerabilities', function () { beforeEach(async function () { diff --git a/spec/RestQuery.spec.js b/spec/RestQuery.spec.js index c8e3adb49d..1af6b4b58a 100644 --- a/spec/RestQuery.spec.js +++ b/spec/RestQuery.spec.js @@ -208,7 +208,7 @@ describe('rest query', () => { const p0 = request({ headers: headers, url: - 'http://localhost:8378/1/classes/TestParameterEncode?' + + 'http://127.0.0.1:8378/1/classes/TestParameterEncode?' + querystring .stringify({ where: '{"foo":{"$ne": "baz"}}', @@ -223,7 +223,7 @@ describe('rest query', () => { const p1 = request({ headers: headers, url: - 'http://localhost:8378/1/classes/TestParameterEncode?' + + 'http://127.0.0.1:8378/1/classes/TestParameterEncode?' + querystring .stringify({ limit: 1, diff --git a/spec/SecurityCheck.spec.js b/spec/SecurityCheck.spec.js index 647ed909c0..6bd96b60f4 100644 --- a/spec/SecurityCheck.spec.js +++ b/spec/SecurityCheck.spec.js @@ -15,7 +15,7 @@ describe('Security Check', () => { let checkSuccess; let checkFail; let config; - const publicServerURL = 'http://localhost:8378/1'; + const publicServerURL = 'http://127.0.0.1:8378/1'; const securityUrl = publicServerURL + '/security'; async function reconfigureServerWithSecurityConfig(security) { diff --git a/spec/SecurityCheckGroups.spec.js b/spec/SecurityCheckGroups.spec.js index 43d523c214..9da4186949 100644 --- a/spec/SecurityCheckGroups.spec.js +++ b/spec/SecurityCheckGroups.spec.js @@ -12,7 +12,7 @@ describe('Security Check Groups', () => { config = { appId: 'test', appName: 'ExampleAppName', - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', security: { enableCheck: true, enableCheckLog: false, diff --git a/spec/UserPII.spec.js b/spec/UserPII.spec.js index 87bfe15e4e..ea9fb5821d 100644 --- a/spec/UserPII.spec.js +++ b/spec/UserPII.spec.js @@ -126,7 +126,7 @@ describe('Personally Identifiable Information', () => { it('should not get PII via REST', done => { return request({ - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Javascript-Key': 'test', @@ -144,7 +144,7 @@ describe('Personally Identifiable Information', () => { it('should get PII via REST with self credentials', done => { return request({ - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -164,7 +164,7 @@ describe('Personally Identifiable Information', () => { it('should get PII via REST using master key', done => { request({ - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -183,7 +183,7 @@ describe('Personally Identifiable Information', () => { it('should not get PII via REST by ID', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Javascript-Key': 'test', @@ -202,7 +202,7 @@ describe('Personally Identifiable Information', () => { it('should get PII via REST by ID with self credentials', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -222,7 +222,7 @@ describe('Personally Identifiable Information', () => { it('should get PII via REST by ID with master key', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -355,7 +355,7 @@ describe('Personally Identifiable Information', () => { it('should not get PII via REST', done => { request({ - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Javascript-Key': 'test', @@ -374,7 +374,7 @@ describe('Personally Identifiable Information', () => { it('should get PII via REST with self credentials', done => { request({ - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -395,7 +395,7 @@ describe('Personally Identifiable Information', () => { it('should get PII via REST using master key', done => { request({ - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -418,7 +418,7 @@ describe('Personally Identifiable Information', () => { it('should not get PII via REST by ID', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -439,7 +439,7 @@ describe('Personally Identifiable Information', () => { it('should get PII via REST by ID with self credentials', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -461,7 +461,7 @@ describe('Personally Identifiable Information', () => { it('should get PII via REST by ID with master key', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Javascript-Key': 'test', @@ -545,7 +545,7 @@ describe('Personally Identifiable Information', () => { it('privileged user should not get user PII via REST by ID', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -619,7 +619,7 @@ describe('Personally Identifiable Information', () => { it('should not get user PII via REST by ID', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -804,7 +804,7 @@ describe('Personally Identifiable Information', () => { it('should not get PII via REST', done => { request({ - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Javascript-Key': 'test', @@ -823,7 +823,7 @@ describe('Personally Identifiable Information', () => { it('should get PII via REST with self credentials', done => { request({ - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -847,7 +847,7 @@ describe('Personally Identifiable Information', () => { it('should get PII via REST using master key', done => { request({ - url: 'http://localhost:8378/1/classes/_User', + url: 'http://127.0.0.1:8378/1/classes/_User', json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -870,7 +870,7 @@ describe('Personally Identifiable Information', () => { it('should not get PII via REST by ID', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -891,7 +891,7 @@ describe('Personally Identifiable Information', () => { it('should get PII via REST by ID with self credentials', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -913,7 +913,7 @@ describe('Personally Identifiable Information', () => { it('should get PII via REST by ID with master key', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Javascript-Key': 'test', @@ -997,7 +997,7 @@ describe('Personally Identifiable Information', () => { it('privileged user should get user PII via REST by ID', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -1071,7 +1071,7 @@ describe('Personally Identifiable Information', () => { it('should not get user PII via REST by ID', done => { request({ - url: `http://localhost:8378/1/classes/_User/${user.id}`, + url: `http://127.0.0.1:8378/1/classes/_User/${user.id}`, json: true, headers: { 'X-Parse-Application-Id': 'test', diff --git a/spec/ValidationAndPasswordsReset.spec.js b/spec/ValidationAndPasswordsReset.spec.js index d7cc72c7b0..0e21ffd315 100644 --- a/spec/ValidationAndPasswordsReset.spec.js +++ b/spec/ValidationAndPasswordsReset.spec.js @@ -43,7 +43,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(async () => { spyOn(emailAdapter, 'sendVerificationEmail'); const user = new Parse.User(); @@ -69,7 +69,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(async () => { spyOn(emailAdapter, 'sendVerificationEmail'); const user = new Parse.User(); @@ -94,7 +94,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(async () => { spyOn(emailAdapter, 'sendVerificationEmail'); const user = new Parse.User(); @@ -132,7 +132,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); spyOn(emailAdapter, 'sendVerificationEmail').and.callFake(options => { expect(options.link).not.toBeNull(); @@ -176,7 +176,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { appName: 'My Cool App', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(async () => { const user = new Parse.User(); user.setPassword('asdf'); @@ -205,7 +205,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { it('prevents user from login if email is not verified but preventLoginWithUnverifiedEmail is set to true', done => { reconfigureServer({ appName: 'test', - publicServerURL: 'http://localhost:1337/1', + publicServerURL: 'http://127.0.0.1:1337/1', verifyUserEmails: true, preventLoginWithUnverifiedEmail: true, emailAdapter: MockEmailAdapterWithOptions({ @@ -257,7 +257,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { verifyUserEmails: true, preventLoginWithUnverifiedEmail: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setPassword('other-password'); @@ -273,7 +273,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/verify_email_success.html?username=user' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/verify_email_success.html?username=user' ); user .fetch() @@ -310,7 +310,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { it('allows user to login if email is not verified but preventLoginWithUnverifiedEmail is set to false', done => { reconfigureServer({ appName: 'test', - publicServerURL: 'http://localhost:1337/1', + publicServerURL: 'http://127.0.0.1:1337/1', verifyUserEmails: true, preventLoginWithUnverifiedEmail: false, emailAdapter: MockEmailAdapterWithOptions({ @@ -348,7 +348,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { it('fails if you include an emailAdapter, set a publicServerURL, but have no appName and send a password reset email', done => { reconfigureServer({ appName: undefined, - publicServerURL: 'http://localhost:1337/1', + publicServerURL: 'http://127.0.0.1:1337/1', emailAdapter: MockEmailAdapterWithOptions({ fromAddress: 'parse@example.com', apiKey: 'k', @@ -421,7 +421,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { it('fails if you set a publicServerURL, have an appName, but no emailAdapter and send a password reset email', done => { reconfigureServer({ appName: 'unused', - publicServerURL: 'http://localhost:1337/1', + publicServerURL: 'http://127.0.0.1:1337/1', emailAdapter: undefined, }) .then(() => { @@ -454,7 +454,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { it('succeeds sending a password reset email if appName, publicServerURL, and email adapter are provided', done => { reconfigureServer({ appName: 'coolapp', - publicServerURL: 'http://localhost:1337/1', + publicServerURL: 'http://127.0.0.1:1337/1', emailAdapter: MockEmailAdapterWithOptions({ fromAddress: 'parse@example.com', apiKey: 'k', @@ -501,7 +501,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { spyOn(adapter, 'sendMail').and.callThrough(); reconfigureServer({ appName: 'coolapp', - publicServerURL: 'http://localhost:1337/1', + publicServerURL: 'http://127.0.0.1:1337/1', emailAdapter: adapter, }) .then(() => { @@ -535,7 +535,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { }; reconfigureServer({ appName: 'unused', - publicServerURL: 'http://localhost:1337/1', + publicServerURL: 'http://127.0.0.1:1337/1', verifyUserEmails: false, emailAdapter: emailAdapter, }).then(async () => { @@ -566,7 +566,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { appName: 'emailing app', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(async () => { const user = new Parse.User(); user.setPassword('asdf'); @@ -592,7 +592,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { appName: 'emailing app', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }) .then(() => { user.setPassword('other-password'); @@ -608,7 +608,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/verify_email_success.html?username=user' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/verify_email_success.html?username=user' ); user .fetch() @@ -640,15 +640,15 @@ describe('Custom Pages, Email Verification, Password Reset', () => { sendPasswordResetEmail: () => Promise.resolve(), sendMail: () => {}, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { request({ - url: 'http://localhost:8378/1/apps/test/verify_email', + url: 'http://127.0.0.1:8378/1/apps/test/verify_email', followRedirects: false, }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/invalid_link.html' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/invalid_link.html' ); done(); }); @@ -664,15 +664,15 @@ describe('Custom Pages, Email Verification, Password Reset', () => { sendPasswordResetEmail: () => Promise.resolve(), sendMail: () => {}, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { request({ - url: 'http://localhost:8378/1/apps/test/verify_email?token=asdfasdf&username=sadfasga', + url: 'http://127.0.0.1:8378/1/apps/test/verify_email?token=asdfasdf&username=sadfasga', followRedirects: false, }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/invalid_verification_link.html?username=sadfasga&appId=test' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/invalid_verification_link.html?username=sadfasga&appId=test' ); done(); }); @@ -688,10 +688,10 @@ describe('Custom Pages, Email Verification, Password Reset', () => { sendPasswordResetEmail: () => Promise.resolve(), sendMail: () => {}, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { request({ - url: 'http://localhost:8378/1/apps/test/resend_verification_email', + url: 'http://127.0.0.1:8378/1/apps/test/resend_verification_email', method: 'POST', followRedirects: false, body: { @@ -700,7 +700,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/link_send_fail.html' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/link_send_fail.html' ); done(); }); @@ -712,12 +712,12 @@ describe('Custom Pages, Email Verification, Password Reset', () => { const emailAdapter = { sendVerificationEmail: () => { request({ - url: 'http://localhost:8378/1/apps/test/verify_email?token=invalid&username=zxcv', + url: 'http://127.0.0.1:8378/1/apps/test/verify_email?token=invalid&username=zxcv', followRedirects: false, }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/invalid_verification_link.html?username=zxcv&appId=test' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/invalid_verification_link.html?username=zxcv&appId=test' ); user.fetch().then(() => { expect(user.get('emailVerified')).toEqual(false); @@ -732,7 +732,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { appName: 'emailing app', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setPassword('asdf'); user.setUsername('zxcv'); @@ -768,7 +768,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { appName: 'emailing app', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setPassword('asdf'); user.setUsername('zxcv+zxcv'); @@ -794,16 +794,16 @@ describe('Custom Pages, Email Verification, Password Reset', () => { sendPasswordResetEmail: () => Promise.resolve(), sendMail: () => {}, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { request({ url: - 'http://localhost:8378/1/apps/test/request_password_reset?token=asdfasdf&username=sadfasga', + 'http://127.0.0.1:8378/1/apps/test/request_password_reset?token=asdfasdf&username=sadfasga', followRedirects: false, }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/invalid_link.html' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/invalid_link.html' ); done(); }); @@ -830,7 +830,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { const token = match[1]; request({ - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', method: 'POST', body: { new_password: 'hello', token, username: 'zxcv' }, headers: { @@ -840,7 +840,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/password_reset_success.html?username=zxcv' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/password_reset_success.html?username=zxcv' ); Parse.User.logIn('zxcv', 'hello').then( @@ -870,7 +870,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { appName: 'emailing app', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setPassword('asdf'); user.setUsername('zxcv'); @@ -907,7 +907,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { const token = match[1]; request({ - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', method: 'POST', body: { new_password: 'hello', token, username: 'zxcv+1' }, headers: { @@ -917,7 +917,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { }).then(response => { expect(response.status).toEqual(302); expect(response.text).toEqual( - 'Found. Redirecting to http://localhost:8378/1/apps/password_reset_success.html?username=zxcv%2B1' + 'Found. Redirecting to http://127.0.0.1:8378/1/apps/password_reset_success.html?username=zxcv%2B1' ); done(); }); @@ -929,7 +929,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { appName: 'emailing app', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(() => { user.setPassword('asdf'); user.setUsername('zxcv+1'); @@ -965,7 +965,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { const token = match[1]; const resetResponse = await request({ - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', method: 'POST', body: { new_password: 'hello', token, username: 'zxcv' }, headers: { @@ -996,7 +996,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { appName: 'emailing app', verifyUserEmails: true, emailAdapter: emailAdapter, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); user.setPassword('asdf'); user.setUsername('zxcv'); @@ -1007,13 +1007,13 @@ describe('Custom Pages, Email Verification, Password Reset', () => { it('should return ajax failure error on ajax request with wrong data provided', async () => { await reconfigureServer({ - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); try { await request({ method: 'POST', - url: 'http://localhost:8378/1/apps/test/request_password_reset', + url: 'http://127.0.0.1:8378/1/apps/test/request_password_reset', body: `new_password=user1&token=12345&username=Johnny`, headers: { 'Content-Type': 'application/x-www-form-urlencoded', @@ -1032,7 +1032,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { it('deletes password reset token on email address change', done => { reconfigureServer({ appName: 'coolapp', - publicServerURL: 'http://localhost:1337/1', + publicServerURL: 'http://127.0.0.1:1337/1', emailAdapter: MockEmailAdapterWithOptions({ fromAddress: 'parse@example.com', apiKey: 'k', diff --git a/spec/VerifyUserPassword.spec.js b/spec/VerifyUserPassword.spec.js index 6734dcdb71..50082cfffa 100644 --- a/spec/VerifyUserPassword.spec.js +++ b/spec/VerifyUserPassword.spec.js @@ -355,7 +355,7 @@ describe('Verify User Password', () => { }); it('fails to verify password when preventLoginWithUnverifiedEmail is set to true REST API', done => { reconfigureServer({ - publicServerURL: 'http://localhost:8378/', + publicServerURL: 'http://127.0.0.1:8378/', appName: 'emailVerify', verifyUserEmails: true, preventLoginWithUnverifiedEmail: true, @@ -393,7 +393,7 @@ describe('Verify User Password', () => { duration: 1, threshold: 2, }, - publicServerURL: 'http://localhost:8378/', + publicServerURL: 'http://127.0.0.1:8378/', }) .then(() => { const user = new Parse.User(); diff --git a/spec/WinstonLoggerAdapter.spec.js b/spec/WinstonLoggerAdapter.spec.js index 4ceff47d5f..654c117420 100644 --- a/spec/WinstonLoggerAdapter.spec.js +++ b/spec/WinstonLoggerAdapter.spec.js @@ -196,7 +196,7 @@ describe_only(() => { }; request({ headers: headers, - url: 'http://localhost:8378/1/login?username=test&password=moon-y', + url: 'http://127.0.0.1:8378/1/login?username=test&password=moon-y', }).then(() => { const winstonLoggerAdapter = new WinstonLoggerAdapter(); return winstonLoggerAdapter diff --git a/spec/batch.spec.js b/spec/batch.spec.js index 98050254ba..6441dc7203 100644 --- a/spec/batch.spec.js +++ b/spec/batch.spec.js @@ -4,9 +4,9 @@ const semver = require('semver'); const TestUtils = require('../lib/TestUtils'); const originalURL = '/parse/batch'; -const serverURL = 'http://localhost:1234/parse'; -const serverURL1 = 'http://localhost:1234/1'; -const serverURLNaked = 'http://localhost:1234/'; +const serverURL = 'http://127.0.0.1:1234/parse'; +const serverURL1 = 'http://127.0.0.1:1234/1'; +const serverURLNaked = 'http://127.0.0.1:1234/'; const publicServerURL = 'http://domain.com/parse'; const publicServerURLNaked = 'http://domain.com/'; const publicServerURLLong = 'https://domain.com/something/really/long'; @@ -95,7 +95,7 @@ describe('batch', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/batch', + url: 'http://127.0.0.1:8378/1/batch', body: JSON.stringify({ requests: [ { @@ -134,7 +134,7 @@ describe('batch', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/batch', + url: 'http://127.0.0.1:8378/1/batch', body: JSON.stringify({ requests: [ { @@ -205,7 +205,7 @@ describe('batch', () => { request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/batch', + url: 'http://127.0.0.1:8378/1/batch', body: JSON.stringify({ requests: [ { @@ -253,7 +253,7 @@ describe('batch', () => { await request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/batch', + url: 'http://127.0.0.1:8378/1/batch', body: JSON.stringify({ requests: [ { @@ -378,7 +378,7 @@ describe('batch', () => { await request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/batch', + url: 'http://127.0.0.1:8378/1/batch', body: JSON.stringify({ requests: [ { @@ -485,7 +485,7 @@ describe('batch', () => { const response = await request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/batch', + url: 'http://127.0.0.1:8378/1/batch', body: JSON.stringify({ requests: [ { @@ -512,7 +512,7 @@ describe('batch', () => { await request({ method: 'POST', headers: headers, - url: 'http://localhost:8378/1/batch', + url: 'http://127.0.0.1:8378/1/batch', body: JSON.stringify({ requests: [ { diff --git a/spec/features.spec.js b/spec/features.spec.js index f138fe4cf6..f598bc90de 100644 --- a/spec/features.spec.js +++ b/spec/features.spec.js @@ -5,7 +5,7 @@ const request = require('../lib/request'); describe('features', () => { it('should return the serverInfo', async () => { const response = await request({ - url: 'http://localhost:8378/1/serverInfo', + url: 'http://127.0.0.1:8378/1/serverInfo', json: true, headers: { 'X-Parse-Application-Id': 'test', @@ -22,7 +22,7 @@ describe('features', () => { it('requires the master key to get features', async done => { try { await request({ - url: 'http://localhost:8378/1/serverInfo', + url: 'http://127.0.0.1:8378/1/serverInfo', json: true, headers: { 'X-Parse-Application-Id': 'test', diff --git a/spec/helper.js b/spec/helper.js index 612c716202..098e4b5cb6 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -85,7 +85,7 @@ if (process.env.PARSE_SERVER_LOG_LEVEL) { // Default server configuration for tests. const defaultConfiguration = { filesAdapter, - serverURL: 'http://localhost:' + port + '/1', + serverURL: 'http://127.0.0.1:' + port + '/1', databaseAdapter, appId: 'test', javascriptKey: 'test', @@ -187,7 +187,7 @@ const reconfigureServer = (changedConfiguration = {}) => { // Set up a Parse client to talk to our test API server const Parse = require('parse/node'); -Parse.serverURL = 'http://localhost:' + port + '/1'; +Parse.serverURL = 'http://127.0.0.1:' + port + '/1'; beforeAll(async () => { try { @@ -200,7 +200,7 @@ beforeAll(async () => { await reconfigureServer(); Parse.initialize('test', 'test', 'test'); - Parse.serverURL = 'http://localhost:' + port + '/1'; + Parse.serverURL = 'http://127.0.0.1:' + port + '/1'; }); afterEach(function (done) { diff --git a/spec/index.spec.js b/spec/index.spec.js index dd9be1792b..3c756ea6d7 100644 --- a/spec/index.spec.js +++ b/spec/index.spec.js @@ -36,7 +36,7 @@ describe('server', () => { it('support http basic authentication with masterkey', done => { reconfigureServer({ appId: 'test' }).then(() => { request({ - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', headers: { Authorization: 'Basic ' + Buffer.from('test:' + 'test').toString('base64'), }, @@ -50,7 +50,7 @@ describe('server', () => { it('support http basic authentication with javascriptKey', done => { reconfigureServer({ appId: 'test' }).then(() => { request({ - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', headers: { Authorization: 'Basic ' + Buffer.from('test:javascript-key=' + 'test').toString('base64'), }, @@ -75,7 +75,7 @@ describe('server', () => { //Need to use rest api because saving via JS SDK results in fail() not getting called request({ method: 'POST', - url: 'http://localhost:8378/1/classes/NewClass', + url: 'http://127.0.0.1:8378/1/classes/NewClass', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-REST-API-Key': 'rest', @@ -101,7 +101,7 @@ describe('server', () => { apiKey: 'k', domain: 'd', }), - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(done, fail); }); @@ -117,7 +117,7 @@ describe('server', () => { domain: 'd', }, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }).then(done, fail); }); @@ -129,7 +129,7 @@ describe('server', () => { module: 'mock-mail-adapter', options: {}, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }; await reconfigureServer(options); const config = Config.get('test'); @@ -142,7 +142,7 @@ describe('server', () => { appName: 'unused', verifyUserEmails: true, emailAdapter: 'mock-mail-adapter', - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }; await reconfigureServer(options); const config = Config.get('test'); @@ -158,7 +158,7 @@ describe('server', () => { module: 'mock-mail-adapter', options: { throw: true }, }, - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }; expectAsync(reconfigureServer(options)).toBeRejected('MockMailAdapterConstructor'); }); @@ -167,7 +167,7 @@ describe('server', () => { it('can report the server version', async done => { await reconfigureServer(); request({ - url: 'http://localhost:8378/1/serverInfo', + url: 'http://127.0.0.1:8378/1/serverInfo', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Master-Key': 'test', @@ -186,7 +186,7 @@ describe('server', () => { expect(config.hasPushSupport).toEqual(true); expect(config.hasPushScheduledSupport).toEqual(false); request({ - url: 'http://localhost:8378/1/serverInfo', + url: 'http://127.0.0.1:8378/1/serverInfo', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Master-Key': 'test', @@ -209,7 +209,7 @@ describe('server', () => { expect(config.hasPushSupport).toEqual(false); expect(config.hasPushScheduledSupport).toEqual(false); request({ - url: 'http://localhost:8378/1/serverInfo', + url: 'http://127.0.0.1:8378/1/serverInfo', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Master-Key': 'test', @@ -239,7 +239,7 @@ describe('server', () => { expect(config.hasPushSupport).toEqual(true); expect(config.hasPushScheduledSupport).toEqual(false); request({ - url: 'http://localhost:8378/1/serverInfo', + url: 'http://127.0.0.1:8378/1/serverInfo', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Master-Key': 'test', @@ -270,7 +270,7 @@ describe('server', () => { expect(config.hasPushSupport).toEqual(true); expect(config.hasPushScheduledSupport).toEqual(true); request({ - url: 'http://localhost:8378/1/serverInfo', + url: 'http://127.0.0.1:8378/1/serverInfo', headers: { 'X-Parse-Application-Id': 'test', 'X-Parse-Master-Key': 'test', @@ -288,7 +288,7 @@ describe('server', () => { it('can respond 200 on path health', done => { request({ - url: 'http://localhost:8378/1/health', + url: 'http://127.0.0.1:8378/1/health', }).then(response => { expect(response.status).toBe(200); done(); @@ -300,7 +300,7 @@ describe('server', () => { Object.assign({}, defaultConfiguration, { appId: 'aTestApp', masterKey: 'aTestMasterKey', - serverURL: 'http://localhost:12666/parse', + serverURL: 'http://127.0.0.1:12666/parse', serverStartComplete: () => { expect(Parse.applicationId).toEqual('aTestApp'); const app = express(); @@ -341,7 +341,7 @@ describe('server', () => { Object.assign({}, defaultConfiguration, { appId: 'anOtherTestApp', masterKey: 'anOtherTestMasterKey', - serverURL: 'http://localhost:12667/parse', + serverURL: 'http://127.0.0.1:12667/parse', serverStartComplete: error => { const promise = error ? Promise.reject(error) : Promise.resolve(); promise @@ -405,7 +405,7 @@ describe('server', () => { it('properly gives publicServerURL when set', done => { reconfigureServer({ publicServerURL: 'https://myserver.com/1' }).then(() => { - const config = Config.get('test', 'http://localhost:8378/1'); + const config = Config.get('test', 'http://127.0.0.1:8378/1'); expect(config.mount).toEqual('https://myserver.com/1'); done(); }); @@ -413,8 +413,8 @@ describe('server', () => { it('properly removes trailing slash in mount', done => { reconfigureServer({}).then(() => { - const config = Config.get('test', 'http://localhost:8378/1/'); - expect(config.mount).toEqual('http://localhost:8378/1'); + const config = Config.get('test', 'http://127.0.0.1:8378/1/'); + expect(config.mount).toEqual('http://127.0.0.1:8378/1'); done(); }); }); @@ -522,7 +522,7 @@ describe('server', () => { middleware: 'spec/support/CustomMiddleware', }) .then(() => { - return request({ url: 'http://localhost:8378/1' }).then(fail, res => { + return request({ url: 'http://127.0.0.1:8378/1' }).then(fail, res => { // Just check that the middleware set the header expect(res.headers['x-yolo']).toBe('1'); done(); diff --git a/spec/rest.spec.js b/spec/rest.spec.js index db3082ec74..e4982a2e5e 100644 --- a/spec/rest.spec.js +++ b/spec/rest.spec.js @@ -496,7 +496,7 @@ describe('rest create', () => { request({ headers: headers, method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', body: JSON.stringify({ foo: 'bar', objectId: 'hello', @@ -518,7 +518,7 @@ describe('rest create', () => { request({ headers: headers, method: 'POST', - url: 'http://localhost:8378/1/classes/TestObject', + url: 'http://127.0.0.1:8378/1/classes/TestObject', body: JSON.stringify({ foo: 'bar', id: 'hello', @@ -675,14 +675,14 @@ describe('rest create', () => { let sessionId; return request({ headers: headers, - url: 'http://localhost:8378/1/sessions/me', + url: 'http://127.0.0.1:8378/1/sessions/me', }) .then(response => { sessionId = response.data.objectId; return request({ headers, method: 'PUT', - url: 'http://localhost:8378/1/sessions/' + sessionId, + url: 'http://127.0.0.1:8378/1/sessions/' + sessionId, body: { installationId: 'yolo', }, @@ -694,7 +694,7 @@ describe('rest create', () => { return request({ headers, method: 'PUT', - url: 'http://localhost:8378/1/sessions/' + sessionId, + url: 'http://127.0.0.1:8378/1/sessions/' + sessionId, body: { sessionToken: 'yolo', }, @@ -711,7 +711,7 @@ describe('rest create', () => { return request({ headers, method: 'PUT', - url: 'http://localhost:8378/1/sessions/' + sessionId, + url: 'http://127.0.0.1:8378/1/sessions/' + sessionId, body: { user: Parse._encode(user), }, @@ -725,7 +725,7 @@ describe('rest create', () => { return request({ headers, method: 'PUT', - url: 'http://localhost:8378/1/sessions/' + sessionId, + url: 'http://127.0.0.1:8378/1/sessions/' + sessionId, body: { user: Parse._encode(user), }, @@ -752,7 +752,7 @@ describe('rest create', () => { return request({ headers, method: 'POST', - url: 'http://localhost:8378/1/sessions', + url: 'http://127.0.0.1:8378/1/sessions', body: { user: { __type: 'Pointer', className: '_User', objectId: 'fakeId' }, }, diff --git a/spec/schemas.spec.js b/spec/schemas.spec.js index e8dcc41e4d..c73e380f5b 100644 --- a/spec/schemas.spec.js +++ b/spec/schemas.spec.js @@ -147,7 +147,7 @@ describe('schemas', () => { it('requires the master key to get all schemas', done => { request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', json: true, headers: noAuthHeaders, }).then(fail, response => { @@ -161,7 +161,7 @@ describe('schemas', () => { it('requires the master key to get one schema', done => { request({ - url: 'http://localhost:8378/1/schemas/SomeSchema', + url: 'http://127.0.0.1:8378/1/schemas/SomeSchema', json: true, headers: restKeyHeaders, }).then(fail, response => { @@ -173,7 +173,7 @@ describe('schemas', () => { it('asks for the master key if you use the rest key', done => { request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', json: true, headers: restKeyHeaders, }).then(fail, response => { @@ -185,7 +185,7 @@ describe('schemas', () => { it('creates _User schema when server starts', done => { request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', json: true, headers: masterKeyHeaders, }).then(response => { @@ -218,7 +218,7 @@ describe('schemas', () => { }) .then(() => { request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', json: true, headers: masterKeyHeaders, }).then(response => { @@ -243,7 +243,7 @@ describe('schemas', () => { const obj = hasAllPODobject(); obj.save().then(() => { request({ - url: 'http://localhost:8378/1/schemas/HasAllPOD', + url: 'http://127.0.0.1:8378/1/schemas/HasAllPOD', json: true, headers: masterKeyHeaders, }).then(response => { @@ -257,7 +257,7 @@ describe('schemas', () => { const obj = hasAllPODobject(); obj.save().then(() => { request({ - url: 'http://localhost:8378/1/schemas/HASALLPOD', + url: 'http://127.0.0.1:8378/1/schemas/HASALLPOD', json: true, headers: masterKeyHeaders, }).then(fail, response => { @@ -273,7 +273,7 @@ describe('schemas', () => { it('requires the master key to create a schema', done => { request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', json: true, headers: noAuthHeaders, @@ -289,7 +289,7 @@ describe('schemas', () => { it('sends an error if you use mismatching class names', done => { request({ - url: 'http://localhost:8378/1/schemas/A', + url: 'http://127.0.0.1:8378/1/schemas/A', method: 'POST', headers: masterKeyHeaders, json: true, @@ -308,7 +308,7 @@ describe('schemas', () => { it('sends an error if you use no class name', done => { request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -325,7 +325,7 @@ describe('schemas', () => { it('sends an error if you try to create the same class twice', done => { request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -334,7 +334,7 @@ describe('schemas', () => { }, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -354,7 +354,7 @@ describe('schemas', () => { it('responds with all fields when you create a class', done => { request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -384,7 +384,7 @@ describe('schemas', () => { it('responds with all fields and options when you create a class with field options', done => { request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -465,7 +465,7 @@ describe('schemas', () => { it('try to set a relation field as a required field', async done => { try { await request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -491,7 +491,7 @@ describe('schemas', () => { it('try to set a relation field with a default value', async done => { try { await request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -516,7 +516,7 @@ describe('schemas', () => { it('try to update schemas with a relation field with options', async done => { await request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -529,7 +529,7 @@ describe('schemas', () => { }); try { await request({ - url: 'http://localhost:8378/1/schemas/NewClassRelationWithOptions', + url: 'http://127.0.0.1:8378/1/schemas/NewClassRelationWithOptions', method: 'POST', headers: masterKeyHeaders, json: true, @@ -552,7 +552,7 @@ describe('schemas', () => { try { await request({ - url: 'http://localhost:8378/1/schemas/NewClassRelationWithOptions', + url: 'http://127.0.0.1:8378/1/schemas/NewClassRelationWithOptions', method: 'POST', headers: masterKeyHeaders, json: true, @@ -578,7 +578,7 @@ describe('schemas', () => { it('validated the data type of default values when creating a new class', async () => { try { await request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -600,7 +600,7 @@ describe('schemas', () => { it('validated the data type of default values when adding new fields', async () => { try { await request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -612,7 +612,7 @@ describe('schemas', () => { }, }); await request({ - url: 'http://localhost:8378/1/schemas/NewClassWithValidation', + url: 'http://127.0.0.1:8378/1/schemas/NewClassWithValidation', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -639,7 +639,7 @@ describe('schemas', () => { ) .then(() => { request({ - url: 'http://localhost:8378/1/schemas/_Installation', + url: 'http://127.0.0.1:8378/1/schemas/_Installation', headers: masterKeyHeaders, json: true, }).then(response => { @@ -679,7 +679,7 @@ describe('schemas', () => { it('lets you specify class name in both places', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, @@ -703,14 +703,14 @@ describe('schemas', () => { it('requires the master key to modify schemas', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, body: {}, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: noAuthHeaders, json: true, @@ -725,7 +725,7 @@ describe('schemas', () => { it('rejects class name mis-matches in put', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -742,7 +742,7 @@ describe('schemas', () => { it('refuses to add fields to non-existent classes', done => { request({ - url: 'http://localhost:8378/1/schemas/NoClass', + url: 'http://127.0.0.1:8378/1/schemas/NoClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -763,7 +763,7 @@ describe('schemas', () => { const obj = hasAllPODobject(); obj.save().then(() => { request({ - url: 'http://localhost:8378/1/schemas/HasAllPOD', + url: 'http://127.0.0.1:8378/1/schemas/HasAllPOD', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -785,7 +785,7 @@ describe('schemas', () => { const obj = hasAllPODobject(); obj.save().then(() => { request({ - url: 'http://localhost:8378/1/schemas/HasAllPOD', + url: 'http://127.0.0.1:8378/1/schemas/HasAllPOD', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -807,7 +807,7 @@ describe('schemas', () => { const obj = hasAllPODobject(); obj.save().then(() => { request({ - url: 'http://localhost:8378/1/schemas/HasAllPOD', + url: 'http://127.0.0.1:8378/1/schemas/HasAllPOD', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -832,7 +832,7 @@ describe('schemas', () => { obj.set('aString', 'aString'); obj.save().then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -858,7 +858,7 @@ describe('schemas', () => { obj.set('geo1', new Parse.GeoPoint({ latitude: 0, longitude: 0 })); obj.save().then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -891,7 +891,7 @@ describe('schemas', () => { const obj = hasAllPODobject(); obj.save().then(() => { request({ - url: 'http://localhost:8378/1/schemas/HasAllPOD', + url: 'http://127.0.0.1:8378/1/schemas/HasAllPOD', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -905,7 +905,7 @@ describe('schemas', () => { it('lets you add fields', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, @@ -913,7 +913,7 @@ describe('schemas', () => { }).then(() => { request({ method: 'PUT', - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', headers: masterKeyHeaders, json: true, body: { @@ -936,7 +936,7 @@ describe('schemas', () => { }) ).toEqual(undefined); request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', headers: masterKeyHeaders, json: true, }).then(response => { @@ -959,7 +959,7 @@ describe('schemas', () => { it('lets you add fields with options', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, @@ -967,7 +967,7 @@ describe('schemas', () => { }).then(() => { request({ method: 'PUT', - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', headers: masterKeyHeaders, json: true, body: { @@ -998,7 +998,7 @@ describe('schemas', () => { }) ).toEqual(undefined); request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', headers: masterKeyHeaders, json: true, }).then(response => { @@ -1025,7 +1025,7 @@ describe('schemas', () => { it('should validate required fields', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, @@ -1033,7 +1033,7 @@ describe('schemas', () => { }).then(() => { request({ method: 'PUT', - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', headers: masterKeyHeaders, json: true, body: { @@ -1149,7 +1149,7 @@ describe('schemas', () => { it('should validate required fields and set default values after before save trigger', async () => { await request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -1255,12 +1255,12 @@ describe('schemas', () => { it('lets you add fields to system schema', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/_User', + url: 'http://127.0.0.1:8378/1/schemas/_User', headers: masterKeyHeaders, json: true, }).then(fail, () => { request({ - url: 'http://localhost:8378/1/schemas/_User', + url: 'http://127.0.0.1:8378/1/schemas/_User', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -1295,7 +1295,7 @@ describe('schemas', () => { }) ).toBeUndefined(); request({ - url: 'http://localhost:8378/1/schemas/_User', + url: 'http://127.0.0.1:8378/1/schemas/_User', headers: masterKeyHeaders, json: true, }).then(response => { @@ -1337,7 +1337,7 @@ describe('schemas', () => { .save() .then(() => { request({ - url: 'http://localhost:8378/1/schemas/SimpleOne', + url: 'http://127.0.0.1:8378/1/schemas/SimpleOne', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -1371,7 +1371,7 @@ describe('schemas', () => { const obj1 = hasAllPODobject(); obj1.save().then(() => { request({ - url: 'http://localhost:8378/1/schemas/HasAllPOD', + url: 'http://127.0.0.1:8378/1/schemas/HasAllPOD', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -1421,7 +1421,7 @@ describe('schemas', () => { const obj = hasAllPODobject(); obj.save().then(() => { request({ - url: 'http://localhost:8378/1/schemas/HasAllPOD', + url: 'http://127.0.0.1:8378/1/schemas/HasAllPOD', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -1436,7 +1436,7 @@ describe('schemas', () => { expect(response.data.error).toEqual('invalid field type: fake type'); request({ method: 'PUT', - url: 'http://localhost:8378/1/schemas/HasAllPOD', + url: 'http://127.0.0.1:8378/1/schemas/HasAllPOD', headers: masterKeyHeaders, json: true, }).then(response => { @@ -1449,7 +1449,7 @@ describe('schemas', () => { it('requires the master key to delete schemas', done => { request({ - url: 'http://localhost:8378/1/schemas/DoesntMatter', + url: 'http://127.0.0.1:8378/1/schemas/DoesntMatter', method: 'DELETE', headers: noAuthHeaders, json: true, @@ -1464,7 +1464,7 @@ describe('schemas', () => { const obj = hasAllPODobject(); obj.save().then(() => { request({ - url: 'http://localhost:8378/1/schemas/HasAllPOD', + url: 'http://127.0.0.1:8378/1/schemas/HasAllPOD', method: 'DELETE', headers: masterKeyHeaders, json: true, @@ -1480,7 +1480,7 @@ describe('schemas', () => { it('fails when deleting collections with invalid class names', done => { request({ - url: 'http://localhost:8378/1/schemas/_GlobalConfig', + url: 'http://127.0.0.1:8378/1/schemas/_GlobalConfig', method: 'DELETE', headers: masterKeyHeaders, json: true, @@ -1496,7 +1496,7 @@ describe('schemas', () => { it('does not fail when deleting nonexistant collections', done => { request({ - url: 'http://localhost:8378/1/schemas/Missing', + url: 'http://127.0.0.1:8378/1/schemas/Missing', method: 'DELETE', headers: masterKeyHeaders, json: true, @@ -1521,7 +1521,7 @@ describe('schemas', () => { .then(obj2 => obj2.destroy()) .then(() => { request({ - url: 'http://localhost:8378/1/schemas/MyOtherClass', + url: 'http://127.0.0.1:8378/1/schemas/MyOtherClass', method: 'DELETE', headers: masterKeyHeaders, json: true, @@ -1545,7 +1545,7 @@ describe('schemas', () => { }) .then(() => { request({ - url: 'http://localhost:8378/1/schemas/MyOtherClass', + url: 'http://127.0.0.1:8378/1/schemas/MyOtherClass', headers: masterKeyHeaders, json: true, }).then(fail, response => { @@ -1570,7 +1570,7 @@ describe('schemas', () => { it('deletes schema when actual collection does not exist', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/NewClassForDelete', + url: 'http://127.0.0.1:8378/1/schemas/NewClassForDelete', headers: masterKeyHeaders, json: true, body: { @@ -1579,7 +1579,7 @@ describe('schemas', () => { }).then(response => { expect(response.data.className).toEqual('NewClassForDelete'); request({ - url: 'http://localhost:8378/1/schemas/NewClassForDelete', + url: 'http://127.0.0.1:8378/1/schemas/NewClassForDelete', method: 'DELETE', headers: masterKeyHeaders, json: true, @@ -1599,7 +1599,7 @@ describe('schemas', () => { it('deletes schema when actual collection exists', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/NewClassForDelete', + url: 'http://127.0.0.1:8378/1/schemas/NewClassForDelete', headers: masterKeyHeaders, json: true, body: { @@ -1608,7 +1608,7 @@ describe('schemas', () => { }).then(response => { expect(response.data.className).toEqual('NewClassForDelete'); request({ - url: 'http://localhost:8378/1/classes/NewClassForDelete', + url: 'http://127.0.0.1:8378/1/classes/NewClassForDelete', method: 'POST', headers: restKeyHeaders, json: true, @@ -1616,13 +1616,13 @@ describe('schemas', () => { expect(typeof response.data.objectId).toEqual('string'); request({ method: 'DELETE', - url: 'http://localhost:8378/1/classes/NewClassForDelete/' + response.data.objectId, + url: 'http://127.0.0.1:8378/1/classes/NewClassForDelete/' + response.data.objectId, headers: restKeyHeaders, json: true, }).then(() => { request({ method: 'DELETE', - url: 'http://localhost:8378/1/schemas/NewClassForDelete', + url: 'http://127.0.0.1:8378/1/schemas/NewClassForDelete', headers: masterKeyHeaders, json: true, }).then(response => { @@ -1643,7 +1643,7 @@ describe('schemas', () => { it('should set/get schema permissions', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/AClass', + url: 'http://127.0.0.1:8378/1/schemas/AClass', headers: masterKeyHeaders, json: true, body: { @@ -1658,7 +1658,7 @@ describe('schemas', () => { }, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/AClass', + url: 'http://127.0.0.1:8378/1/schemas/AClass', headers: masterKeyHeaders, json: true, }).then(response => { @@ -1687,7 +1687,7 @@ describe('schemas', () => { object.save().then(() => { request({ method: 'PUT', - url: 'http://localhost:8378/1/schemas/AClass', + url: 'http://127.0.0.1:8378/1/schemas/AClass', headers: masterKeyHeaders, json: true, body: { @@ -1716,7 +1716,7 @@ describe('schemas', () => { it('should not be able to add a field', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/AClass', + url: 'http://127.0.0.1:8378/1/schemas/AClass', headers: masterKeyHeaders, json: true, body: { @@ -1751,7 +1751,7 @@ describe('schemas', () => { it('should be able to add a field', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/AClass', + url: 'http://127.0.0.1:8378/1/schemas/AClass', headers: masterKeyHeaders, json: true, body: { @@ -1816,7 +1816,7 @@ describe('schemas', () => { const { data } = await request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/AClass', + url: 'http://127.0.0.1:8378/1/schemas/AClass', headers: masterKeyHeaders, json: true, body: { @@ -1842,7 +1842,7 @@ describe('schemas', () => { const shortId = '1'; const { data } = await request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/AClass', + url: 'http://127.0.0.1:8378/1/schemas/AClass', headers: masterKeyHeaders, json: true, body: { @@ -1872,7 +1872,7 @@ describe('schemas', () => { const { data } = await request({ method: 'POST', - url: 'http://localhost:8378/1/classes/AClass', + url: 'http://127.0.0.1:8378/1/classes/AClass', headers: masterKeyHeaders, json: true, body: { @@ -1886,7 +1886,7 @@ describe('schemas', () => { const { data: created } = await request({ method: 'GET', - url: `http://localhost:8378/1/classes/AClass/${data.objectId}`, + url: `http://127.0.0.1:8378/1/classes/AClass/${data.objectId}`, headers: masterKeyHeaders, json: true, }); @@ -1900,7 +1900,7 @@ describe('schemas', () => { it('should throw with invalid userId (invalid char)', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/AClass', + url: 'http://127.0.0.1:8378/1/schemas/AClass', headers: masterKeyHeaders, json: true, body: { @@ -1921,7 +1921,7 @@ describe('schemas', () => { it('should throw with invalid * (spaces before)', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/AClass', + url: 'http://127.0.0.1:8378/1/schemas/AClass', headers: masterKeyHeaders, json: true, body: { @@ -1940,7 +1940,7 @@ describe('schemas', () => { it('should throw with invalid * (spaces after)', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/AClass', + url: 'http://127.0.0.1:8378/1/schemas/AClass', headers: masterKeyHeaders, json: true, body: { @@ -1959,7 +1959,7 @@ describe('schemas', () => { it('should throw if permission is number', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/AClass', + url: 'http://127.0.0.1:8378/1/schemas/AClass', headers: masterKeyHeaders, json: true, body: { @@ -1980,7 +1980,7 @@ describe('schemas', () => { it('should throw if permission is empty string', done => { request({ method: 'POST', - url: 'http://localhost:8378/1/schemas/AClass', + url: 'http://127.0.0.1:8378/1/schemas/AClass', headers: masterKeyHeaders, json: true, body: { @@ -2000,7 +2000,7 @@ describe('schemas', () => { function setPermissionsOnClass(className, permissions, doPut) { return request({ - url: 'http://localhost:8378/1/schemas/' + className, + url: 'http://127.0.0.1:8378/1/schemas/' + className, method: doPut ? 'PUT' : 'POST', headers: masterKeyHeaders, json: true, @@ -2544,7 +2544,7 @@ describe('schemas', () => { .then(() => { request({ method: 'DELETE', - url: 'http://localhost:8378/1/schemas/MyClass', + url: 'http://127.0.0.1:8378/1/schemas/MyClass', headers: masterKeyHeaders, json: true, }).then(response => { @@ -2616,7 +2616,7 @@ describe('schemas', () => { }) .then(() => { return request({ - url: 'http://localhost:8378/1/schemas/_Role', + url: 'http://127.0.0.1:8378/1/schemas/_Role', headers: masterKeyHeaders, json: true, }); @@ -2849,14 +2849,14 @@ describe('schemas', () => { it('cannot create index if field does not exist', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, body: {}, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -2875,14 +2875,14 @@ describe('schemas', () => { it('can create index on default field', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, body: {}, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -2900,14 +2900,14 @@ describe('schemas', () => { it('cannot create compound index if field does not exist', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, body: {}, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -2929,7 +2929,7 @@ describe('schemas', () => { it('allows add index when you create a class', done => { request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -2966,7 +2966,7 @@ describe('schemas', () => { it('empty index returns nothing', done => { request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -2995,14 +2995,14 @@ describe('schemas', () => { it('lets you add indexes', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, body: {}, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3033,7 +3033,7 @@ describe('schemas', () => { }) ).toEqual(undefined); request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', headers: masterKeyHeaders, json: true, }).then(response => { @@ -3063,14 +3063,14 @@ describe('schemas', () => { it_only_db('mongo')('lets you add index with with pointer like structure', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, body: {}, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3101,7 +3101,7 @@ describe('schemas', () => { }) ).toEqual(undefined); request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', headers: masterKeyHeaders, json: true, }).then(response => { @@ -3131,14 +3131,14 @@ describe('schemas', () => { it('lets you add multiple indexes', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, body: {}, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3179,7 +3179,7 @@ describe('schemas', () => { }) ).toEqual(undefined); request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', headers: masterKeyHeaders, json: true, }).then(response => { @@ -3214,14 +3214,14 @@ describe('schemas', () => { it('lets you delete indexes', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, body: {}, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3252,7 +3252,7 @@ describe('schemas', () => { }) ).toEqual(undefined); request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3287,14 +3287,14 @@ describe('schemas', () => { it('lets you delete multiple indexes', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, body: {}, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3333,7 +3333,7 @@ describe('schemas', () => { }) ).toEqual(undefined); request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3375,7 +3375,7 @@ describe('schemas', () => { const waitForIndexBuild = new Promise(r => setTimeout(r, 500)); await request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, @@ -3383,7 +3383,7 @@ describe('schemas', () => { }); let response = await request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3427,7 +3427,7 @@ describe('schemas', () => { await waitForIndexBuild; response = await request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3460,7 +3460,7 @@ describe('schemas', () => { await waitForIndexBuild; response = await request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3498,14 +3498,14 @@ describe('schemas', () => { it('cannot delete index that does not exist', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, body: {}, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3524,14 +3524,14 @@ describe('schemas', () => { it('cannot update index that exist', done => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'POST', headers: masterKeyHeaders, json: true, body: {}, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3545,7 +3545,7 @@ describe('schemas', () => { }, }).then(() => { request({ - url: 'http://localhost:8378/1/schemas/NewClass', + url: 'http://127.0.0.1:8378/1/schemas/NewClass', method: 'PUT', headers: masterKeyHeaders, json: true, @@ -3571,12 +3571,12 @@ describe('schemas', () => { return reconfigureServer({ appId: 'test', restAPIKey: 'test', - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); }) .then(() => { request({ - url: 'http://localhost:8378/1/schemas/TestObject', + url: 'http://127.0.0.1:8378/1/schemas/TestObject', headers: masterKeyHeaders, json: true, }).then(response => { @@ -3602,12 +3602,12 @@ describe('schemas', () => { return reconfigureServer({ appId: 'test', restAPIKey: 'test', - publicServerURL: 'http://localhost:8378/1', + publicServerURL: 'http://127.0.0.1:8378/1', }); }) .then(() => { request({ - url: 'http://localhost:8378/1/schemas/TestObject', + url: 'http://127.0.0.1:8378/1/schemas/TestObject', headers: masterKeyHeaders, json: true, }).then(response => { diff --git a/src/ParseServer.js b/src/ParseServer.js index e6b30d1918..4fbf7933ab 100644 --- a/src/ParseServer.js +++ b/src/ParseServer.js @@ -386,7 +386,7 @@ function injectDefaults(options: ParseServerOptions) { }); if (!Object.prototype.hasOwnProperty.call(options, 'serverURL')) { - options.serverURL = `http://localhost:${options.port}${options.mountPath}`; + options.serverURL = `http://127.0.0.1:${options.port}${options.mountPath}`; } // Reserved Characters diff --git a/src/cli/parse-server.js b/src/cli/parse-server.js index 4ee9dc4c03..6129372332 100755 --- a/src/cli/parse-server.js +++ b/src/cli/parse-server.js @@ -86,7 +86,7 @@ runner({ console.log( '[' + process.pid + - '] GraphQL running on http://localhost:' + + '] GraphQL running on http://127.0.0.1:' + options.port + options.graphQLPath ); @@ -95,7 +95,7 @@ runner({ console.log( '[' + process.pid + - '] Playground running on http://localhost:' + + '] Playground running on http://127.0.0.1:' + options.port + options.playgroundPath ); From a79d9d855d5e026d9e263ad1c3ae4828dc58a4c3 Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Fri, 17 Dec 2021 16:05:41 +0100 Subject: [PATCH 08/13] Replace all mongodb localhost to 127.0.0.1 --- README.md | 10 +++++----- spec/CLI.spec.js | 6 +++--- spec/FilesController.spec.js | 12 ++++++------ spec/GridFSBucketStorageAdapter.spec.js | 4 ++-- spec/GridStoreAdapter.spec.js | 4 ++-- spec/MongoStorageAdapter.spec.js | 4 ++-- spec/ParseServer.spec.js | 2 +- spec/ParseServerRESTController.spec.js | 2 +- spec/ParseUser.spec.js | 2 +- spec/ReadPreferenceOption.spec.js | 2 +- spec/batch.spec.js | 2 +- spec/helper.js | 2 +- src/Options/Definitions.js | 2 +- src/Options/index.js | 2 +- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index ac0a7ca2db..a7cfa17650 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ Parse Server is continuously tested with the most recent releases of PostgreSQL ```bash $ npm install -g parse-server mongodb-runner $ mongodb-runner start -$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test +$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://127.0.0.1/test ``` ***Note:*** *If installation with* `-g` *fails due to permission problems* (`npm ERR! code 'EACCES'`), *please refer to [this link](https://docs.npmjs.com/getting-started/fixing-npm-permissions).* @@ -270,7 +270,7 @@ var ParseServer = require('parse-server').ParseServer; var app = express(); var api = new ParseServer({ - databaseURI: 'mongodb://localhost:27017/dev', // Connection string for your MongoDB database + databaseURI: 'mongodb://127.0.0.1:27017/dev', // Connection string for your MongoDB database cloud: './cloud/main.js', // Path to your Cloud Code appId: 'myAppId', masterKey: 'myMasterKey', // Keep this key secret! @@ -766,7 +766,7 @@ The easiest way to run the Parse GraphQL API is through the CLI: ```bash $ npm install -g parse-server mongodb-runner $ mongodb-runner start -$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://127.0.0.1:1337/parse --mountGraphQL --mountPlayground +$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://127.0.0.1/test --publicServerURL http://127.0.0.1:1337/parse --mountGraphQL --mountPlayground ``` After starting the server, you can visit http://127.0.0.1:1337/playground in your browser to start playing with your GraphQL API. @@ -815,7 +815,7 @@ const { default: ParseServer, ParseGraphQLServer } = require('parse-server'); const app = express(); const parseServer = new ParseServer({ - databaseURI: 'mongodb://localhost:27017/test', + databaseURI: 'mongodb://127.0.0.1:27017/test', appId: 'APPLICATION_ID', masterKey: 'MASTER_KEY', serverURL: 'http://127.0.0.1:1337/parse', @@ -1028,7 +1028,7 @@ Parse GraphQL Server allows you to create a custom GraphQL schema with own queri To start creating your custom schema, you need to code a `schema.graphql` file and initialize Parse Server with `--graphQLSchema` and `--cloud` options: ```bash -$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://127.0.0.1:1337/parse --cloud ./cloud/main.js --graphQLSchema ./cloud/schema.graphql --mountGraphQL --mountPlayground +$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://127.0.0.1/test --publicServerURL http://127.0.0.1:1337/parse --cloud ./cloud/main.js --graphQLSchema ./cloud/schema.graphql --mountGraphQL --mountPlayground ``` ### Creating your first custom query diff --git a/spec/CLI.spec.js b/spec/CLI.spec.js index 540f02abf6..4e9e821083 100644 --- a/spec/CLI.spec.js +++ b/spec/CLI.spec.js @@ -226,7 +226,7 @@ describe('execution', () => { '--masterKey', 'test', '--databaseURI', - 'mongodb://localhost/test', + 'mongodb://127.0.0.1/test', '--port', '1339', ]); @@ -248,7 +248,7 @@ describe('execution', () => { '--masterKey', 'test', '--databaseURI', - 'mongodb://localhost/test', + 'mongodb://127.0.0.1/test', '--port', '1340', '--mountGraphQL', @@ -274,7 +274,7 @@ describe('execution', () => { '--masterKey', 'test', '--databaseURI', - 'mongodb://localhost/test', + 'mongodb://127.0.0.1/test', '--port', '1341', '--mountGraphQL', diff --git a/spec/FilesController.spec.js b/spec/FilesController.spec.js index 996e4c3961..edf6821928 100644 --- a/spec/FilesController.spec.js +++ b/spec/FilesController.spec.js @@ -6,7 +6,7 @@ const GridFSBucketAdapter = require('../lib/Adapters/Files/GridFSBucketAdapter') const GridStoreAdapter = require('../lib/Adapters/Files/GridStoreAdapter').GridStoreAdapter; const Config = require('../lib/Config'); const FilesController = require('../lib/Controllers/FilesController').default; -const databaseURI = 'mongodb://localhost:27017/parse'; +const databaseURI = 'mongodb://127.0.0.1:27017/parse'; const mockAdapter = { createFile: () => { @@ -24,7 +24,7 @@ const mockAdapter = { describe('FilesController', () => { it('should properly expand objects', done => { const config = Config.get(Parse.applicationId); - const gridStoreAdapter = new GridFSBucketAdapter('mongodb://localhost:27017/parse'); + const gridStoreAdapter = new GridFSBucketAdapter('mongodb://127.0.0.1:27017/parse'); const filesController = new FilesController(gridStoreAdapter); const result = filesController.expandFilesInObject(config, function () {}); @@ -88,7 +88,7 @@ describe('FilesController', () => { it('should add a unique hash to the file name when the preserveFileName option is false', done => { const config = Config.get(Parse.applicationId); - const gridStoreAdapter = new GridFSBucketAdapter('mongodb://localhost:27017/parse'); + const gridStoreAdapter = new GridFSBucketAdapter('mongodb://127.0.0.1:27017/parse'); spyOn(gridStoreAdapter, 'createFile'); gridStoreAdapter.createFile.and.returnValue(Promise.resolve()); const fileName = 'randomFileName.pdf'; @@ -109,7 +109,7 @@ describe('FilesController', () => { it('should not add a unique hash to the file name when the preserveFileName option is true', done => { const config = Config.get(Parse.applicationId); - const gridStoreAdapter = new GridFSBucketAdapter('mongodb://localhost:27017/parse'); + const gridStoreAdapter = new GridFSBucketAdapter('mongodb://127.0.0.1:27017/parse'); spyOn(gridStoreAdapter, 'createFile'); gridStoreAdapter.createFile.and.returnValue(Promise.resolve()); const fileName = 'randomFileName.pdf'; @@ -135,14 +135,14 @@ describe('FilesController', () => { }); it('should reject slashes in file names', done => { - const gridStoreAdapter = new GridFSBucketAdapter('mongodb://localhost:27017/parse'); + const gridStoreAdapter = new GridFSBucketAdapter('mongodb://127.0.0.1:27017/parse'); const fileName = 'foo/randomFileName.pdf'; expect(gridStoreAdapter.validateFilename(fileName)).not.toBe(null); done(); }); it('should also reject slashes in file names', done => { - const gridStoreAdapter = new GridStoreAdapter('mongodb://localhost:27017/parse'); + const gridStoreAdapter = new GridStoreAdapter('mongodb://127.0.0.1:27017/parse'); const fileName = 'foo/randomFileName.pdf'; expect(gridStoreAdapter.validateFilename(fileName)).not.toBe(null); done(); diff --git a/spec/GridFSBucketStorageAdapter.spec.js b/spec/GridFSBucketStorageAdapter.spec.js index cede195d14..e80f2c5deb 100644 --- a/spec/GridFSBucketStorageAdapter.spec.js +++ b/spec/GridFSBucketStorageAdapter.spec.js @@ -2,7 +2,7 @@ const GridStoreAdapter = require('../lib/Adapters/Files/GridStoreAdapter').GridS const GridFSBucketAdapter = require('../lib/Adapters/Files/GridFSBucketAdapter') .GridFSBucketAdapter; const { randomString } = require('../lib/cryptoUtils'); -const databaseURI = 'mongodb://localhost:27017/parse'; +const databaseURI = 'mongodb://127.0.0.1:27017/parse'; const request = require('../lib/request'); async function expectMissingFile(gfsAdapter, name) { @@ -439,7 +439,7 @@ describe_only_db('mongo')('GridFSBucket and GridStore interop', () => { }); it('handleShutdown, close connection', async () => { - const databaseURI = 'mongodb://localhost:27017/parse'; + const databaseURI = 'mongodb://127.0.0.1:27017/parse'; const gfsAdapter = new GridFSBucketAdapter(databaseURI); const db = await gfsAdapter._connect(); diff --git a/spec/GridStoreAdapter.spec.js b/spec/GridStoreAdapter.spec.js index 145b8e0e6d..c5bf65a2d8 100644 --- a/spec/GridStoreAdapter.spec.js +++ b/spec/GridStoreAdapter.spec.js @@ -8,7 +8,7 @@ const FilesController = require('../lib/Controllers/FilesController').default; // Small additional tests to improve overall coverage describe_only_db('mongo')('GridStoreAdapter', () => { it('should properly instanciate the GridStore when deleting a file', async done => { - const databaseURI = 'mongodb://localhost:27017/parse'; + const databaseURI = 'mongodb://127.0.0.1:27017/parse'; const config = Config.get(Parse.applicationId); const gridStoreAdapter = new GridStoreAdapter(databaseURI); const db = await gridStoreAdapter._connect(); @@ -93,7 +93,7 @@ describe_only_db('mongo')('GridStoreAdapter', () => { }); it('handleShutdown, close connection', async () => { - const databaseURI = 'mongodb://localhost:27017/parse'; + const databaseURI = 'mongodb://127.0.0.1:27017/parse'; const gridStoreAdapter = new GridStoreAdapter(databaseURI); const db = await gridStoreAdapter._connect(); diff --git a/spec/MongoStorageAdapter.spec.js b/spec/MongoStorageAdapter.spec.js index 50c2f60af0..6917722e79 100644 --- a/spec/MongoStorageAdapter.spec.js +++ b/spec/MongoStorageAdapter.spec.js @@ -2,7 +2,7 @@ const MongoStorageAdapter = require('../lib/Adapters/Storage/Mongo/MongoStorageAdapter').default; const { MongoClient } = require('mongodb'); -const databaseURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase'; +const databaseURI = 'mongodb://127.0.0.1:27017/parseServerMongoAdapterTestDatabase'; const request = require('../lib/request'); const Config = require('../lib/Config'); const TestUtils = require('../lib/TestUtils'); @@ -383,7 +383,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { await reconfigureServer({ databaseAdapter: undefined, databaseURI: - 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase?replicaSet=replicaset', + 'mongodb://127.0.0.1:27017/parseServerMongoAdapterTestDatabase?replicaSet=replicaset', }); await TestUtils.destroyAllDataPermanently(true); }); diff --git a/spec/ParseServer.spec.js b/spec/ParseServer.spec.js index 1691f3b517..55466dad2a 100644 --- a/spec/ParseServer.spec.js +++ b/spec/ParseServer.spec.js @@ -53,7 +53,7 @@ describe('Server Url Checks', () => { }); xit('handleShutdown, close connection', done => { - const mongoURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase'; + const mongoURI = 'mongodb://127.0.0.1:27017/parseServerMongoAdapterTestDatabase'; const postgresURI = 'postgres://localhost:5432/parse_server_postgres_adapter_test_database'; let databaseAdapter; if (process.env.PARSE_SERVER_TEST_DB === 'postgres') { diff --git a/spec/ParseServerRESTController.spec.js b/spec/ParseServerRESTController.spec.js index 2d08e56d6f..531a6f3d1e 100644 --- a/spec/ParseServerRESTController.spec.js +++ b/spec/ParseServerRESTController.spec.js @@ -179,7 +179,7 @@ describe('ParseServerRESTController', () => { await reconfigureServer({ databaseAdapter: undefined, databaseURI: - 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase?replicaSet=replicaset', + 'mongodb://127.0.0.1:27017/parseServerMongoAdapterTestDatabase?replicaSet=replicaset', }); } else { await reconfigureServer(); diff --git a/spec/ParseUser.spec.js b/spec/ParseUser.spec.js index ce42f61dd9..0096b462f1 100644 --- a/spec/ParseUser.spec.js +++ b/spec/ParseUser.spec.js @@ -239,7 +239,7 @@ describe('Parse.User testing', () => { it_only_db('mongo')('should let legacy users without ACL login', async () => { await reconfigureServer(); - const databaseURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase'; + const databaseURI = 'mongodb://127.0.0.1:27017/parseServerMongoAdapterTestDatabase'; const adapter = new MongoStorageAdapter({ collectionPrefix: 'test_', uri: databaseURI, diff --git a/spec/ReadPreferenceOption.spec.js b/spec/ReadPreferenceOption.spec.js index 80e14770bb..ffe6ccb999 100644 --- a/spec/ReadPreferenceOption.spec.js +++ b/spec/ReadPreferenceOption.spec.js @@ -49,7 +49,7 @@ describe_only_db('mongo')('Read preference option', () => { xit('should preserve the read preference set (#4831)', async () => { const { MongoStorageAdapter } = require('../lib/Adapters/Storage/Mongo/MongoStorageAdapter'); const adapterOptions = { - uri: 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase', + uri: 'mongodb://127.0.0.1:27017/parseServerMongoAdapterTestDatabase', mongoOptions: { readPreference: ReadPreference.NEAREST, }, diff --git a/spec/batch.spec.js b/spec/batch.spec.js index 6441dc7203..1137c5960d 100644 --- a/spec/batch.spec.js +++ b/spec/batch.spec.js @@ -184,7 +184,7 @@ describe('batch', () => { await reconfigureServer({ databaseAdapter: undefined, databaseURI: - 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase?replicaSet=replicaset', + 'mongodb://127.0.0.1:27017/parseServerMongoAdapterTestDatabase?replicaSet=replicaset', }); } else { await reconfigureServer(); diff --git a/spec/helper.js b/spec/helper.js index 098e4b5cb6..47ec859d7b 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -41,7 +41,7 @@ const RedisCacheAdapter = require('../lib/Adapters/Cache/RedisCacheAdapter').def const RESTController = require('parse/lib/node/RESTController'); const { VolatileClassesSchemas } = require('../lib/Controllers/SchemaController'); -const mongoURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase'; +const mongoURI = 'mongodb://127.0.0.1:27017/parseServerMongoAdapterTestDatabase'; const postgresURI = 'postgres://localhost:5432/parse_server_postgres_adapter_test_database'; let databaseAdapter; // need to bind for mocking mocha diff --git a/src/Options/Definitions.js b/src/Options/Definitions.js index e2cbd17920..063c170e41 100644 --- a/src/Options/Definitions.js +++ b/src/Options/Definitions.js @@ -107,7 +107,7 @@ module.exports.ParseServerOptions = { env: 'PARSE_SERVER_DATABASE_URI', help: 'The full URI to your database. Supported databases are mongodb or postgres.', required: true, - default: 'mongodb://localhost:27017/parse', + default: 'mongodb://127.0.0.1:27017/parse', }, directAccess: { env: 'PARSE_SERVER_DIRECT_ACCESS', diff --git a/src/Options/index.js b/src/Options/index.js index 31b9e10d41..bd757b5985 100644 --- a/src/Options/index.js +++ b/src/Options/index.js @@ -62,7 +62,7 @@ export interface ParseServerOptions { :ENV: SILENT */ silent: ?boolean; /* The full URI to your database. Supported databases are mongodb or postgres. - :DEFAULT: mongodb://localhost:27017/parse */ + :DEFAULT: mongodb://127.0.0.1:27017/parse */ databaseURI: string; /* Options to pass to the database client :ENV: PARSE_SERVER_DATABASE_OPTIONS */ From 83aba63db721a05466d17e858b0a5661630722e8 Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Fri, 17 Dec 2021 16:19:26 +0100 Subject: [PATCH 09/13] Change remaining localhost to 127.0.0.1 --- .github/workflows/ci.yml | 2 +- CONTRIBUTING.md | 2 +- scripts/before_script_postgres.sh | 2 +- scripts/before_script_postgres_conf.sh | 2 +- spec/CloudCode.spec.js | 2 +- spec/LdapAuth.spec.js | 24 +++++++++---------- spec/MongoStorageAdapter.spec.js | 8 +++---- spec/OAuth1.spec.js | 2 +- spec/ParseGraphQLServer.spec.js | 2 +- spec/ParseServer.spec.js | 2 +- spec/PostgresConfigParser.spec.js | 2 +- spec/PostgresInitOptions.spec.js | 2 +- spec/PostgresStorageAdapter.spec.js | 2 +- spec/helper.js | 2 +- spec/index.spec.js | 2 +- .../Storage/Postgres/PostgresConfigParser.js | 2 +- 16 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b70807549b..dbc1250f83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -223,7 +223,7 @@ jobs: --health-retries 5 env: PARSE_SERVER_TEST_DB: postgres - PARSE_SERVER_TEST_DATABASE_URI: postgres://postgres:postgres@localhost:5432/parse_server_postgres_adapter_test_database + PARSE_SERVER_TEST_DATABASE_URI: postgres://postgres:postgres@127.0.0.1:5432/parse_server_postgres_adapter_test_database NODE_VERSION: ${{ matrix.NODE_VERSION }} steps: - uses: actions/checkout@v2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7e620fbc78..24b1f068b0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -129,7 +129,7 @@ Once you have babel running in watch mode, you can start making changes to parse If your pull request introduces a change that may affect the storage or retrieval of objects, you may want to make sure it plays nice with Postgres. -* Run the tests against the postgres database with `PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://postgres:password@localhost:5432/parse_server_postgres_adapter_test_database npm run testonly`. You'll need to have postgres running on your machine and setup [appropriately](https://github.com/parse-community/parse-server/blob/master/scripts/before_script_postgres.sh) or use [`Docker`](#run-a-parse-postgres-with-docker). +* Run the tests against the postgres database with `PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://postgres:password@127.0.0.1:5432/parse_server_postgres_adapter_test_database npm run testonly`. You'll need to have postgres running on your machine and setup [appropriately](https://github.com/parse-community/parse-server/blob/master/scripts/before_script_postgres.sh) or use [`Docker`](#run-a-parse-postgres-with-docker). * The Postgres adapter has a special debugger that traces all the sql commands. You can enable it with setting the environment variable `PARSE_SERVER_LOG_LEVEL=debug` * If your feature is intended to only work with MongoDB, you should disable PostgreSQL-specific tests with: diff --git a/scripts/before_script_postgres.sh b/scripts/before_script_postgres.sh index 5c445c4df1..5889036183 100755 --- a/scripts/before_script_postgres.sh +++ b/scripts/before_script_postgres.sh @@ -4,7 +4,7 @@ set -e echo "[SCRIPT] Before Script :: Setup Parse DB for Postgres" -PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h localhost -U postgres <<-EOSQL +PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h 127.0.0.1 -U postgres <<-EOSQL CREATE DATABASE parse_server_postgres_adapter_test_database; \c parse_server_postgres_adapter_test_database; CREATE EXTENSION pgcrypto; diff --git a/scripts/before_script_postgres_conf.sh b/scripts/before_script_postgres_conf.sh index ec471d9c3f..77cd64b1e3 100755 --- a/scripts/before_script_postgres_conf.sh +++ b/scripts/before_script_postgres_conf.sh @@ -11,7 +11,7 @@ echo "[SCRIPT] Before Script :: Setup Parse Postgres configuration file" # CPUs num: 1 # Data Storage: ssd -PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h localhost -U postgres <<-EOSQL +PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h 127.0.0.1 -U postgres <<-EOSQL ALTER SYSTEM SET max_connections TO '200'; ALTER SYSTEM SET shared_buffers TO '1536MB'; ALTER SYSTEM SET effective_cache_size TO '4608MB'; diff --git a/spec/CloudCode.spec.js b/spec/CloudCode.spec.js index c6a5193631..3a99aec5c7 100644 --- a/spec/CloudCode.spec.js +++ b/spec/CloudCode.spec.js @@ -1665,7 +1665,7 @@ describe('Cloud Code', () => { request({ method: 'POST', - url: `http://${Parse.applicationId}:${Parse.masterKey}@localhost:8378/1/jobs/myJob`, + url: `http://${Parse.applicationId}:${Parse.masterKey}@127.0.0.1:8378/1/jobs/myJob`, }) .then(async response => { const jobStatusId = response.headers['x-parse-job-status-id']; diff --git a/spec/LdapAuth.spec.js b/spec/LdapAuth.spec.js index ea30f59f0c..d2ffbacdbc 100644 --- a/spec/LdapAuth.spec.js +++ b/spec/LdapAuth.spec.js @@ -23,7 +23,7 @@ describe('Ldap Auth', () => { const server = await mockLdapServer(port, 'uid=testuser, o=example'); const options = { suffix: 'o=example', - url: `ldap://localhost:${port}`, + url: `ldap://127.0.0.1:${port}`, dn: 'uid={{id}}, o=example', }; await ldap.validateAuthData({ id: 'testuser', password: 'secret' }, options); @@ -34,7 +34,7 @@ describe('Ldap Auth', () => { const server = await mockLdapServer(sslport, 'uid=testuser, o=example', false, true); const options = { suffix: 'o=example', - url: `ldaps://localhost:${sslport}`, + url: `ldaps://127.0.0.1:${sslport}`, dn: 'uid={{id}}, o=example', tlsOptions: { rejectUnauthorized: false }, }; @@ -46,7 +46,7 @@ describe('Ldap Auth', () => { const server = await mockLdapServer(sslport, 'uid=testuser, o=example', false, true); const options = { suffix: 'o=example', - url: `ldaps://localhost:${sslport}`, + url: `ldaps://127.0.0.1:${sslport}`, dn: 'uid={{id}}, o=example', tlsOptions: { ca: fs.readFileSync(__dirname + '/support/cert/cert.pem'), @@ -61,7 +61,7 @@ describe('Ldap Auth', () => { const server = await mockLdapServer(sslport, 'uid=testuser, o=example', false, true); const options = { suffix: 'o=example', - url: `ldaps://localhost:${sslport}`, + url: `ldaps://127.0.0.1:${sslport}`, dn: 'uid={{id}}, o=example', tlsOptions: { ca: fs.readFileSync(__dirname + '/support/cert/anothercert.pem'), @@ -81,7 +81,7 @@ describe('Ldap Auth', () => { const server = await mockLdapServer(sslport, 'uid=testuser, o=example', false, true); const options = { suffix: 'o=example', - url: `ldaps://localhost:${sslport}`, + url: `ldaps://127.0.0.1:${sslport}`, dn: 'uid={{id}}, o=example', tlsOptions: { ca: fs.readFileSync(__dirname + '/support/cert/cert.pem'), @@ -101,7 +101,7 @@ describe('Ldap Auth', () => { const server = await mockLdapServer(port, 'uid=testuser, o=example'); const options = { suffix: 'o=example', - url: `ldap://localhost:${port}`, + url: `ldap://127.0.0.1:${port}`, dn: 'uid={{id}}, o=example', }; try { @@ -117,7 +117,7 @@ describe('Ldap Auth', () => { const server = await mockLdapServer(port, 'uid=testuser, o=example'); const options = { suffix: 'o=example', - url: `ldap://localhost:${port}`, + url: `ldap://127.0.0.1:${port}`, dn: 'uid={{id}}, o=example', groupCn: 'powerusers', groupFilter: '(&(uniqueMember=uid={{id}}, o=example)(objectClass=groupOfUniqueNames))', @@ -130,7 +130,7 @@ describe('Ldap Auth', () => { const server = await mockLdapServer(port, 'uid=testuser, o=example'); const options = { suffix: 'o=example', - url: `ldap://localhost:${port}`, + url: `ldap://127.0.0.1:${port}`, dn: 'uid={{id}}, o=example', groupCn: 'groupTheUserIsNotIn', groupFilter: '(&(uniqueMember=uid={{id}}, o=example)(objectClass=groupOfUniqueNames))', @@ -148,7 +148,7 @@ describe('Ldap Auth', () => { const server = await mockLdapServer(port, 'uid=testuser, o=example'); const options = { suffix: 'o=invalid', - url: `ldap://localhost:${port}`, + url: `ldap://127.0.0.1:${port}`, dn: 'uid={{id}}, o=example', groupCn: 'powerusers', groupFilter: '(&(uniqueMember=uid={{id}}, o=example)(objectClass=groupOfUniqueNames))', @@ -166,7 +166,7 @@ describe('Ldap Auth', () => { const server = await mockLdapServer(port, 'uid=testuser, o=example', true); const options = { suffix: 'o=example', - url: `ldap://localhost:${port}`, + url: `ldap://127.0.0.1:${port}`, dn: 'uid={{id}}, o=example', groupCn: 'powerusers', groupFilter: '(&(uniqueMember=uid={{id}}, o=example)(objectClass=groupOfUniqueNames))', @@ -184,7 +184,7 @@ describe('Ldap Auth', () => { const server = await mockLdapServer(port, 'uid=testuser, o=example', true); const options = { suffix: 'o=example', - url: `ldap://localhost:${port}`, + url: `ldap://127.0.0.1:${port}`, dn: 'uid={{id}}, o=example', }; const authData = { id: 'testuser', password: 'secret' }; @@ -197,7 +197,7 @@ describe('Ldap Auth', () => { const server = await mockLdapServer(port, 'uid=testuser, o=example', true); const options = { suffix: 'o=example', - url: `ldap://localhost:${port}`, + url: `ldap://127.0.0.1:${port}`, dn: 'uid={{id}}, o=example', }; await reconfigureServer({ auth: { ldap: options } }); diff --git a/spec/MongoStorageAdapter.spec.js b/spec/MongoStorageAdapter.spec.js index 6917722e79..5546e8c9c2 100644 --- a/spec/MongoStorageAdapter.spec.js +++ b/spec/MongoStorageAdapter.spec.js @@ -24,10 +24,10 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { it('auto-escapes symbols in auth information', () => { spyOn(MongoClient, 'connect').and.returnValue(Promise.resolve(fakeClient)); new MongoStorageAdapter({ - uri: 'mongodb://user!with@+ symbols:password!with@+ symbols@localhost:1234/parse', + uri: 'mongodb://user!with@+ symbols:password!with@+ symbols@127.0.0.1:1234/parse', }).connect(); expect(MongoClient.connect).toHaveBeenCalledWith( - 'mongodb://user!with%40%2B%20symbols:password!with%40%2B%20symbols@localhost:1234/parse', + 'mongodb://user!with%40%2B%20symbols:password!with%40%2B%20symbols@127.0.0.1:1234/parse', jasmine.any(Object) ); }); @@ -35,10 +35,10 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { it("doesn't double escape already URI-encoded information", () => { spyOn(MongoClient, 'connect').and.returnValue(Promise.resolve(fakeClient)); new MongoStorageAdapter({ - uri: 'mongodb://user!with%40%2B%20symbols:password!with%40%2B%20symbols@localhost:1234/parse', + uri: 'mongodb://user!with%40%2B%20symbols:password!with%40%2B%20symbols@127.0.0.1:1234/parse', }).connect(); expect(MongoClient.connect).toHaveBeenCalledWith( - 'mongodb://user!with%40%2B%20symbols:password!with%40%2B%20symbols@localhost:1234/parse', + 'mongodb://user!with%40%2B%20symbols:password!with%40%2B%20symbols@127.0.0.1:1234/parse', jasmine.any(Object) ); }); diff --git a/spec/OAuth1.spec.js b/spec/OAuth1.spec.js index 21ae7d9517..058d30ea86 100644 --- a/spec/OAuth1.spec.js +++ b/spec/OAuth1.spec.js @@ -128,7 +128,7 @@ describe('OAuth', function () { it('Should fail a request', done => { const options = { - host: 'localhost', + host: '127.0.0.1', consumer_key: 'XXXXXXXXXXXXXXXXXXXXXXXXX', consumer_secret: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', }; diff --git a/spec/ParseGraphQLServer.spec.js b/spec/ParseGraphQLServer.spec.js index 546c7c98a8..c755ddc95c 100644 --- a/spec/ParseGraphQLServer.spec.js +++ b/spec/ParseGraphQLServer.spec.js @@ -411,7 +411,7 @@ describe('ParseGraphQLServer', () => { await new Promise(resolve => httpServer.listen({ port: 13377 }, resolve)); const subscriptionClient = new SubscriptionClient( - 'ws://localhost:13377/subscriptions', + 'ws://127.0.0.1:13377/subscriptions', { reconnect: true, connectionParams: headers, diff --git a/spec/ParseServer.spec.js b/spec/ParseServer.spec.js index 55466dad2a..9cb0060bc4 100644 --- a/spec/ParseServer.spec.js +++ b/spec/ParseServer.spec.js @@ -54,7 +54,7 @@ describe('Server Url Checks', () => { xit('handleShutdown, close connection', done => { const mongoURI = 'mongodb://127.0.0.1:27017/parseServerMongoAdapterTestDatabase'; - const postgresURI = 'postgres://localhost:5432/parse_server_postgres_adapter_test_database'; + const postgresURI = 'postgres://127.0.0.1:5432/parse_server_postgres_adapter_test_database'; let databaseAdapter; if (process.env.PARSE_SERVER_TEST_DB === 'postgres') { databaseAdapter = new PostgresStorageAdapter({ diff --git a/spec/PostgresConfigParser.spec.js b/spec/PostgresConfigParser.spec.js index 412e7b20b9..3c5995b7e8 100644 --- a/spec/PostgresConfigParser.spec.js +++ b/spec/PostgresConfigParser.spec.js @@ -23,7 +23,7 @@ describe('PostgresConfigParser.parseQueryParams', () => { }); }); -const baseURI = 'postgres://username:password@localhost:5432/db-name'; +const baseURI = 'postgres://username:password@127.0.0.1:5432/db-name'; const testfile = fs.readFileSync('./Dockerfile').toString(); const dbOptionsTest = {}; dbOptionsTest[ diff --git a/spec/PostgresInitOptions.spec.js b/spec/PostgresInitOptions.spec.js index aeff86d151..518718cc44 100644 --- a/spec/PostgresInitOptions.spec.js +++ b/spec/PostgresInitOptions.spec.js @@ -3,7 +3,7 @@ const PostgresStorageAdapter = require('../lib/Adapters/Storage/Postgres/Postgre .default; const postgresURI = process.env.PARSE_SERVER_TEST_DATABASE_URI || - 'postgres://localhost:5432/parse_server_postgres_adapter_test_database'; + 'postgres://127.0.0.1:5432/parse_server_postgres_adapter_test_database'; const ParseServer = require('../lib/index'); const express = require('express'); //public schema diff --git a/spec/PostgresStorageAdapter.spec.js b/spec/PostgresStorageAdapter.spec.js index b042206db2..039092c64b 100644 --- a/spec/PostgresStorageAdapter.spec.js +++ b/spec/PostgresStorageAdapter.spec.js @@ -2,7 +2,7 @@ const PostgresStorageAdapter = require('../lib/Adapters/Storage/Postgres/Postgre .default; const databaseURI = process.env.PARSE_SERVER_TEST_DATABASE_URI || - 'postgres://localhost:5432/parse_server_postgres_adapter_test_database'; + 'postgres://127.0.0.1:5432/parse_server_postgres_adapter_test_database'; const Config = require('../lib/Config'); const getColumns = (client, className) => { diff --git a/spec/helper.js b/spec/helper.js index 47ec859d7b..4dce40115f 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -42,7 +42,7 @@ const RESTController = require('parse/lib/node/RESTController'); const { VolatileClassesSchemas } = require('../lib/Controllers/SchemaController'); const mongoURI = 'mongodb://127.0.0.1:27017/parseServerMongoAdapterTestDatabase'; -const postgresURI = 'postgres://localhost:5432/parse_server_postgres_adapter_test_database'; +const postgresURI = 'postgres://127.0.0.1:5432/parse_server_postgres_adapter_test_database'; let databaseAdapter; // need to bind for mocking mocha diff --git a/spec/index.spec.js b/spec/index.spec.js index 3c756ea6d7..96ed1f3b89 100644 --- a/spec/index.spec.js +++ b/spec/index.spec.js @@ -64,7 +64,7 @@ describe('server', () => { it('fails if database is unreachable', done => { reconfigureServer({ databaseAdapter: new MongoStorageAdapter({ - uri: 'mongodb://fake:fake@localhost:43605/drew3', + uri: 'mongodb://fake:fake@127.0.0.1:43605/drew3', mongoOptions: { serverSelectionTimeoutMS: 2000, }, diff --git a/src/Adapters/Storage/Postgres/PostgresConfigParser.js b/src/Adapters/Storage/Postgres/PostgresConfigParser.js index 170e76282a..c89a5d2f36 100644 --- a/src/Adapters/Storage/Postgres/PostgresConfigParser.js +++ b/src/Adapters/Storage/Postgres/PostgresConfigParser.js @@ -7,7 +7,7 @@ function getDatabaseOptionsFromURI(uri) { const queryParams = parseQueryParams(parsedURI.query); const authParts = parsedURI.auth ? parsedURI.auth.split(':') : []; - databaseOptions.host = parsedURI.hostname || 'localhost'; + databaseOptions.host = parsedURI.hostname || '127.0.0.1'; databaseOptions.port = parsedURI.port ? parseInt(parsedURI.port) : 5432; databaseOptions.database = parsedURI.pathname ? parsedURI.pathname.substr(1) : undefined; From 5af81066f3d133421458355c340b06a446c38d10 Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Fri, 17 Dec 2021 16:22:58 +0100 Subject: [PATCH 10/13] Replace localhost regexes to 127.0.0.1 --- spec/ParseFile.spec.js | 12 ++++++------ spec/PasswordPolicy.spec.js | 16 ++++++++-------- spec/ValidationAndPasswordsReset.spec.js | 8 ++++---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/spec/ParseFile.spec.js b/spec/ParseFile.spec.js index a43c307382..afe30eab71 100644 --- a/spec/ParseFile.spec.js +++ b/spec/ParseFile.spec.js @@ -28,7 +28,7 @@ describe('Parse.File testing', () => { }).then(response => { const b = response.data; expect(b.name).toMatch(/_file.txt$/); - expect(b.url).toMatch(/^http:\/\/localhost:8378\/1\/files\/test\/.*file.txt$/); + expect(b.url).toMatch(/^http:\/\/127\.0\.0\.1:8378\/1\/files\/test\/.*file.txt$/); request({ url: b.url }).then(response => { const body = response.text; expect(body).toEqual('argle bargle'); @@ -50,7 +50,7 @@ describe('Parse.File testing', () => { }).then(response => { const b = response.data; expect(b.name).toMatch(/_file.html/); - expect(b.url).toMatch(/^http:\/\/localhost:8378\/1\/files\/test\/.*file.html$/); + expect(b.url).toMatch(/^http:\/\/127\.0\.0\.1:8378\/1\/files\/test\/.*file.html$/); request({ url: b.url }).then(response => { const body = response.text; try { @@ -77,7 +77,7 @@ describe('Parse.File testing', () => { }).then(response => { const b = response.data; expect(b.name).toMatch(/_file.txt$/); - expect(b.url).toMatch(/^http:\/\/localhost:8378\/1\/files\/test\/.*file.txt$/); + expect(b.url).toMatch(/^http:\/\/127\.0\.0\.1:8378\/1\/files\/test\/.*file.txt$/); request({ url: b.url }).then(response => { expect(response.text).toEqual('argle bargle'); done(); @@ -99,7 +99,7 @@ describe('Parse.File testing', () => { }).then(response => { const b = response.data; expect(b.name).toMatch(/_testfile.txt$/); - expect(b.url).toMatch(/^http:\/\/localhost:8378\/1\/files\/test\/.*testfile.txt$/); + expect(b.url).toMatch(/^http:\/\/127\.0\.0\.1:8378\/1\/files\/test\/.*testfile.txt$/); request({ url: b.url }).then(response => { const body = response.text; expect(body).toEqual('check one two'); @@ -141,7 +141,7 @@ describe('Parse.File testing', () => { body: 'the file body', }).then(response => { const b = response.data; - expect(b.url).toMatch(/^http:\/\/localhost:8378\/1\/files\/test\/.*thefile.jpg$/); + expect(b.url).toMatch(/^http:\/\/127\.0\.0\.1:8378\/1\/files\/test\/.*thefile.jpg$/); // missing X-Parse-Master-Key header request({ method: 'DELETE', @@ -187,7 +187,7 @@ describe('Parse.File testing', () => { }).then(response => { const b = response.data; expect(b.name).toMatch(/_file.jpg$/); - expect(b.url).toMatch(/^http:\/\/localhost:8378\/1\/files\/.*file.jpg$/); + expect(b.url).toMatch(/^http:\/\/127\.0\.0\.1:8378\/1\/files\/.*file.jpg$/); request({ url: b.url }).then(response => { const body = response.text; expect(body).toEqual('argle bargle'); diff --git a/spec/PasswordPolicy.spec.js b/spec/PasswordPolicy.spec.js index 4c21458cb7..3892f036cf 100644 --- a/spec/PasswordPolicy.spec.js +++ b/spec/PasswordPolicy.spec.js @@ -107,7 +107,7 @@ describe('Password Policy: ', () => { }) .then(response => { expect(response.status).toEqual(302); - const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=[a-zA-Z0-9]+\&id=test\&username=testResetTokenValidity/; + const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=[a-zA-Z0-9]+\&id=test\&username=testResetTokenValidity/; expect(response.text.match(re)).not.toBe(null); done(); }) @@ -622,7 +622,7 @@ describe('Password Policy: ', () => { }) .then(response => { expect(response.status).toEqual(302); - const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; + const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; const match = response.text.match(re); if (!match) { fail('should have a token'); @@ -714,7 +714,7 @@ describe('Password Policy: ', () => { }) .then(response => { expect(response.status).toEqual(302); - const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; + const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; const match = response.text.match(re); if (!match) { fail('should have a token'); @@ -900,7 +900,7 @@ describe('Password Policy: ', () => { }) .then(response => { expect(response.status).toEqual(302); - const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; + const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; const match = response.text.match(re); if (!match) { fail('should have a token'); @@ -991,7 +991,7 @@ describe('Password Policy: ', () => { resolveWithFullResponse: true, }); expect(response.status).toEqual(302); - const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; + const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; const match = response.text.match(re); if (!match) { fail('should have a token'); @@ -1051,7 +1051,7 @@ describe('Password Policy: ', () => { }) .then(response => { expect(response.status).toEqual(302); - const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; + const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; const match = response.text.match(re); if (!match) { fail('should have a token'); @@ -1317,7 +1317,7 @@ describe('Password Policy: ', () => { }) .then(response => { expect(response.status).toEqual(302); - const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; + const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; const match = response.text.match(re); if (!match) { fail('should have a token'); @@ -1472,7 +1472,7 @@ describe('Password Policy: ', () => { }) .then(response => { expect(response.status).toEqual(302); - const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; + const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=user1/; const match = response.text.match(re); if (!match) { fail('should have a token'); diff --git a/spec/ValidationAndPasswordsReset.spec.js b/spec/ValidationAndPasswordsReset.spec.js index 0e21ffd315..e735449eab 100644 --- a/spec/ValidationAndPasswordsReset.spec.js +++ b/spec/ValidationAndPasswordsReset.spec.js @@ -757,7 +757,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { followRedirects: false, }).then(response => { expect(response.status).toEqual(302); - const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=[a-zA-Z0-9]+\&id=test\&username=zxcv%2Bzxcv/; + const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=[a-zA-Z0-9]+\&id=test\&username=zxcv%2Bzxcv/; expect(response.text.match(re)).not.toBe(null); done(); }); @@ -820,7 +820,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { followRedirects: false, }).then(response => { expect(response.status).toEqual(302); - const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=zxcv/; + const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=zxcv/; const match = response.text.match(re); if (!match) { fail('should have a token'); @@ -897,7 +897,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { followRedirects: false, }).then(response => { expect(response.status).toEqual(302); - const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=zxcv%2B1/; + const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=zxcv%2B1/; const match = response.text.match(re); if (!match) { fail('should have a token'); @@ -956,7 +956,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => { followRedirects: false, }); expect(response.status).toEqual(302); - const re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=zxcv/; + const re = /http:\/\/127\.0\.0\.1:8378\/1\/apps\/choose_password\?token=([a-zA-Z0-9]+)\&id=test\&username=zxcv/; const match = response.text.match(re); if (!match) { fail('should have a token'); From 53412f128e1df8af6091c93c3451935a2c2648b8 Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Fri, 17 Dec 2021 17:01:42 +0100 Subject: [PATCH 11/13] Create new certificates with 127.0.0.1 as altname --- spec/support/cert/anothercert.pem | 53 ++++++++------- spec/support/cert/cert.pem | 53 ++++++++------- spec/support/cert/key.pem | 103 +++++++++++++++--------------- 3 files changed, 104 insertions(+), 105 deletions(-) diff --git a/spec/support/cert/anothercert.pem b/spec/support/cert/anothercert.pem index 488b1cdb94..8d1e7a2281 100644 --- a/spec/support/cert/anothercert.pem +++ b/spec/support/cert/anothercert.pem @@ -1,29 +1,28 @@ -----BEGIN CERTIFICATE----- -MIIE8DCCAtgCCQDjXCYv/hK1rjANBgkqhkiG9w0BAQsFADA5MRIwEAYDVQQDDAls -b2NhbGhvc3QxIzAhBgkqhkiG9w0BCQEWFG5vLXJlcGx5QGV4YW1wbGUuY29tMCAX -DTIwMTExNzEzMTAwMFoYDzIxMjAxMDI0MTMxMDAwWjA5MRIwEAYDVQQDDAlsb2Nh -bGhvc3QxIzAhBgkqhkiG9w0BCQEWFG5vLXJlcGx5QGV4YW1wbGUuY29tMIICIjAN -BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAmsOhxCNw3cEA3TLyqZXMI5p/LNSu -W9doIvLEs1Ah8L/Gbl7xmSagkTZYzkTJDxITy0d45NVfmDsm0ctQrPV5MEbFE571 -lLQRnCFMpB3dqejfqQWpVCMfJKR1p8p5FTtcC5u5g7bcf2YeujwbUVDEtbeHwUeo -XBnKfmv0UdGiLQf0uel5dcGWNp8dFo+hO4wCTA/risIdWawG8RHtzfhRIT2PqUa8 -ljgPyuPU2NQ19gUkV1LkXKJby+6VHhD6pSfzptbsJjalaGawTku7ZgBoZiax8wRk -Bdwyd3ScMQg2VLGIn7YaMwb4ANtHqREekl0q7tPTu+PBmYqGXqa3lKa/s1OebUyS -GQQXZB5T/Brm2fvJWqO9oJjZiTZzZIkBWDP0Cn+pmW/T4dADUms/vONEJE9IPFn1 -id5Q8vjSf5V1MaZJjWek38Y98xfYlKecHIqBAYQAydxdxuzG/DJu+2GzOZeffETD -lzNwrLZp5lBzSrOwVntonvFo04lIq+DepVF+OqK8qV+7pnKCij5bGvdwxaY290pW -+VTzK8kw0VUmpyYrDWIr7C52txaleY/AqsHy6wlVgdMbwXDjQ00twkJJT3tecL9I -eWtLOuh7BeokvDFOXRVI2ZB2KN0sOBXsPfM6G4o9RK305Q9TFEXARnly9cwoV/i9 -8yeJ5teQHw3dm7kCAwEAATANBgkqhkiG9w0BAQsFAAOCAgEAIWUqZSMCGlzWsCtU -Xayr4qshfhqhm6PzgCWGjg8Xsm8gwrbYtQRwsKdJvw7ynLhbeX65i7p3/3AO0W6k -8Zpf58MHgepMOHmVT/KVBy7tUb83wJuoEvZzH50sO0rcA32c3p2FFUvt3JW+Dfo5 -BMX6GDlymtZPAplD9Rw5S5CXkZAgraDCbx1JMGFh0FfbP9v7jdo+so35y8UqmJ10 -3U0NX2UJoWGE6RvV2P/1TE0v4pWyFzz1dF2k/gcmzYtMgIkJGGO8qhIGo2rSVJhC -gVlYxyW/Rxogxz4wN0EqPIJNnkRby/g40OkPN8ATkHs09F4Jyax+cU0iJ3Hbn5t/ -0Ou5oaAs4t1+u11iahUMP6evaXooZONawM7h0RT4HHHZkXT95+kmaMz/+JZRp9DA -Cafp9IsTjLzHvRy5DLX2kithqXaKRdpgTylx0qwW+8HxRjCcJEsFN3lXWqX12R8D -OM8DnVsFX61Ygp7kTj2CQ+Y3Wqrj+jEkyJLRvMeTNPlxfazwudgFuDYsDErMCUwG -U67vPoCkvIShFrnR9X4ojpG8aqWF8M/o8nvKIQp+FEW0Btm6rZT9lGba6nZw76Yj -+48bsJCQ7UzhKkeFO4Bmj0fDkBTAElV2oEJXbHbB6+0DQE48uLWAr4xb7Vswph8c -wHgxPsgsd2h0gr21doWB1BsdAu8= +MIIEwDCCAqigAwIBAgIJALYqCNOJ6f4qMA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV +BAMMCWxvY2FsaG9zdDAgFw0yMTEyMTcxNTU4NTlaGA8yMTIxMTIxODE1NTg1OVow +FDESMBAGA1UEAwwJbG9jYWxob3N0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +CgKCAgEAyrNGVSHLxFTD06u5xsw8H6orVJFE27Jw3+iEuomN3Ry7LFBqmbD5KLPE +99hXSKkVynRJ79SGMJNCnnSlgC4fVdgvZbtGCH3+tHM1gem5uImCiLCvHGXi7z48 +1LW8l37iDxnhTvcbOF9eaXfGYBPpJ8xYgHzf20hLIM2YDPmUhK1gpbc0gf0o54Ql +udx0VCDphCcGOJYa/XHVPQwwnvX2f7zghls9qTQm9BVAA5XVo5V6hU7arklMt5w9 +I0ym90rZFVQD9NUliZd4d0GtWOyBFI+uIuNuJp1trI1cEzkgdUPdlRtDTtxV/JsQ +KYAJBzJdD4hFeJT6OH5VG420czW0ZmPPPaFpGJmAxgNpRN5z5oU8H7FWkWQqLtbx +yxfiE8eN7LBFFG6MZALGerUxVmAH6ivUy0Fdb66u36V2YzPZfrGXiO/e6PP06RH5 +GjOtiiUK/FV4uQYHDEyX/VafHnCgQeR8LVI+75IiBgDkyhkIVp6AUq+WnPeiK21F +5XhD0itquxqEsYbfSniN5433j4FjFeZ3MJ4mQXXoUZAIO37jIII9RFIzd2jHCMjx +hvcD5ckf2g4Tahz52fHePfe63K6I+KAL1Wjd7bmSrd54F6rzM9egyitjIjVTzETw +jLPEBTtg+e/hpORNE2zH2uYYowcJOXIzmHIxMoZFfG8HvQ2ixhECAwEAAaMTMBEw +DwYDVR0RBAgwBocEfwAAATANBgkqhkiG9w0BAQsFAAOCAgEAI8XPrOZb16y+oEXA +0I1gUi8Ld/XiB9tW+KawZPF3Hv9cBTlIOUD5xvQYJAZPmsOrDYDBtKAp3z2ZD4Rz +xPqV3MQFIfKBEruk2eLaRL3eHpxfs3KLPqQraH1hcG0ngB+rDyv2QEuJs41Ia49X +B9Vf/6I2dbdINo8VgQse0f/c41qneMm+7b2WhKiNtVyJrNjjo/IwWwPiSbf4mzFp +p8BGZWsG7ep7lm5RR4m1rD86D6Fp4tSF9ezZQz48wwrFhXdw8jPens/GO6l0Easu +zDbq55qeSSsDqd7UZEkaAzXozRCYpwb/74pxgVsTfYH04HMVjpPwEICTaCOONYGX +axJof7bYFNanvqFrK1TGrceuobQjgPQQhKa+arZlGcKxYOfuVmc4JK/bIA5iaxHC +jBfLFZIcJBRLIjuvwxFNHbbuZ+PJYGbF7Q45Wjck9nlaW3jlV5LZtHm3luosmj+R +9BI36ISEfrtLz4356PhSQWSfOzw1y+oQe67em4BRTHGzl5LXASg85ue3PUTfOutA +fWUpk9yZ4FhhBKcCr5feBo0Rd2MknVINchYoCTnWdnWhV0N8UKR23i8bc64IPGCr +w+TCVu6S2RG1rEaswCDm/+cR2AtsgFGyx2D1UOm3M+YbwKOY9j4KoiXeV6bCSK+k +iOyAWIgBS6MaWIClvc4rul2byHg= -----END CERTIFICATE----- diff --git a/spec/support/cert/cert.pem b/spec/support/cert/cert.pem index ba66211f28..d5c04d189e 100644 --- a/spec/support/cert/cert.pem +++ b/spec/support/cert/cert.pem @@ -1,29 +1,28 @@ -----BEGIN CERTIFICATE----- -MIIE8DCCAtgCCQDaLjopNQCJuTANBgkqhkiG9w0BAQsFADA5MRIwEAYDVQQDDAls -b2NhbGhvc3QxIzAhBgkqhkiG9w0BCQEWFG5vLXJlcGx5QGV4YW1wbGUuY29tMCAX -DTIwMTExNzExNDEzM1oYDzIxMjAxMDI0MTE0MTMzWjA5MRIwEAYDVQQDDAlsb2Nh -bGhvc3QxIzAhBgkqhkiG9w0BCQEWFG5vLXJlcGx5QGV4YW1wbGUuY29tMIICIjAN -BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvFf3I2RnIbp82Dd0AooAMamxMCgu -g4zurMdA40mV8G+MA4Y5XFcGmOYT7LC94Z2nZ4tI+MNSiLKQY3Zq+OYGGmn/zVkr -e8+02afxTjGmLVJWJXxXV2rsf8+UuJMOPbmVq87nJmD2gs9T6czOE3eQdDTRUzTg -ubWhp3hV291gMfCIQeBbSqfbBscz0Nboj8NHStWDif5Io94l08tdW9oHIu99NYE0 -DMWIfBeztHpmSfkgPKH8lNar1dMsuCRW2Q/b01TNPKCNp8ZxyIhzkOq2gC5l60i5 -/iALWeEJii8g71V3DMbU5KoPEB+jFZ/z7qAi8TH9VqgaUycs/M96VXMIZbDhXywJ -pg7qHxG/RT16bXwFotreThcla2M3VxsZEnYPEVmQEyVQeG7XyvqFMC3DhGCflW35 -dumJlkuGn9e9Lg6oiidp2RMnZuTsie+y3e3XJz2ZjFihGQNy2VzUrDz4ymi2fosV -GMeHn3iK2nEqxf1mx021j3v40/8I5gtkS+zZuchclae0gRHaNN1tO0osedUdlV7D -0dvi9xezsfelqSqJjChLfl4R3HqC8k7cwUfK4RmKXhI5GX4ESr+1KWPIaqH5AxYB -+ee2WYBQGhi6aXKpVcj9dvq+OAmDMPCJr0xnWMMZqR5dnxY1eEq2x28n2b1SyIw1 -+IctNX0nLwGAMgUCAwEAATANBgkqhkiG9w0BAQsFAAOCAgEAEYTLXvHWmNuYlG6e -CAiK1ubJ98nO6PSJsl+qosB1kWKlPeWPOLLAeZxSDh0tKRPvQoXoH/AtMRGHFGLS -lk7fbCAbgEqvfA9+8VhgpWSRXD2iodt444P+m93NiMNeusiRFzozXKZZvU4Ie97H -mDuwLjpGgi8DUShebM2Ngif8t4DmSgSfLQ3OEac7oKUP6ffHMXbqnDwjh8ZCCh1m -DN+0i4Y5WpKD7Z+JjGHJRm1Cx/G5pwP16Et6YejQMnNU70VDOzGSvNABmiexiR5p -m8pOTkyxrYViYqamLZG5to5vpI6RmEoA/5vbU59dZ5DzPmSoyNbIeaz+dkSGoy6D -SWKZMwGTf++xS5y+oy2lNS2iddc845qCcDy4jeel3N9JPlJPwrArfapATcrX3Rpy -GsVPvWsKA3q7kwIQo3qscg0CkYwHo5VCnWHDNqgOeFo35J7y+CKxYRolD9/lCtAU -Pw8CBGp1x8jgIv7yKNiPVDtWYztqfsFrplLf/yiZSH53zghSY3v5qnFRkmGq1HRC -G6lz0yjI7RUEA2a/XA2dv9Hv6CdmWUzrsXvocH5VgQz2RtkyvSaLFzRv8gnESrY1 -7qq55D1QIkO8UzzmCSpYPi5tUTGAYE1aHP/B1S5LpBrpaJ8Q9nfqA/9Bb+aho2ze -N0vpdSSemKGQcrzquNqDJhUoXgQ= +MIIEwDCCAqigAwIBAgIJAOxXmMOrn6wDMA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV +BAMMCWxvY2FsaG9zdDAgFw0yMTEyMTcxNTU3NDdaGA8yMTIxMTIxODE1NTc0N1ow +FDESMBAGA1UEAwwJbG9jYWxob3N0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +CgKCAgEA7agA58aaGMOgoSDcIlv9A3W1/kp2JSJeZoySADm1L0f86P0f8tRHWtry +RFALFpZqDRzHW3I578OAMESm5vvZVrcLEITPlpNoKMndiSrcaYBkreFYo2Sc9Owl +yMJHenDXspuOTEpq7x1MiHO7mENNRcVHFe2NDSvxQSvpgsxGHjMRnVU/POdfg+QJ +ZkGD1RJpBu7hpXBQ7Ith3GrlEwAw81pNEgiR0MDu5SlmXcQGEvznAaLABOKRo2A4 +id25V4pWqZRRymFRBTfPVWBb64FLpPYXWQR0jdWtEe/Ja8KyCA73io1VkNqND9St +vufQ6tmpRNNSCsFmHZh/b/sSHtaf2U2DSEpE3MjKbd5rbcXJieaglmQ0/F4XZ8J0 +F2EhNNowxkG9ye9lSdvByLF61JjOt/bXz4t9YGe4OTqp6xISMiyxMX1HcBAjvqq1 +/P7nY+5q+1jQEAfG842wUmE+cwCFvoXrFW0ER6xJv3H4gkUHKj1DpdmUNvj2hmcR +Q8gPmNLzfKSmPb3Yp3dYFIVw0eUQYQB5WlMplPpXjaDqOYqGTe+H+WFujOfg/SK3 +MEAUT6u9Dte/MbDb2kJgG6xWrdxOvK4iOaCFRmwlzXxe4gEJhPfLSldFKezzbBnG +LbwK2VdUgfxsOfVTpkMG1yLNkz8J4egv4X4vuGnslyaaqcnRcdMCAwEAAaMTMBEw +DwYDVR0RBAgwBocEfwAAATANBgkqhkiG9w0BAQsFAAOCAgEAydtIY/iSKocCXJNX +YR1lPDtn9dqGiGC6wMKdwqaWTPPeyj5jy6G/zJRrujyd3hVV9twUHU2f7iyG4LZ2 +Rg/nLHfeVJMCcFCXZYZIR5B86sDQKKkykQ2Ou720hFdMpWpRx8xUBzwpwcdVicm9 +eeuTOh32LETtZ3d57u6vnx/ueHZ6vn+GWic0TtQ7swGrNMrbq3ONYe19/wlf1JdZ +NEEQ7028ItSvcW7ev4hyJM8mttNjGH6taxlhgo7zS45Q26+h7p1pKBTNRx9ohEM8 +VC2jIeFGvuMlSWAQtosoo+dlS1uRMYTwqObd9JHNGMUMfnkrPvRVsBnG6n/k7bsE ++31rtx4q7ymNh4CR3LJBpLHFLozYt4SoUdOHg9AwnnXVg2eVcsZStUOW/AdYWYnR +0Eam0kLcDsbXQztRckH2kaU7tc6g62HYYbjY84uDvqe/hC6te9wgxdWX9DzLKiUk +h/shWzstuF6jYqVzuIA1g+kSfCCf2FnRFCteIiIz3dequ8Uh+2cm/Rt9Dx47YbIT +7Rh7LQTBDMkIC/z1ERd5P+tAdhkvmAaiaEU3Xo6pi6j6EeKheau3LdaDJHHhvfyg +yttEShMT3HvEJ7shI7VIzNif93HFgu2bnwhhd+2uNxzY0Mk2g3VFVVS6c0kPfzwb +kPA49amvndsuXB9hsgkestfmRwM= -----END CERTIFICATE----- diff --git a/spec/support/cert/key.pem b/spec/support/cert/key.pem index 1330bc9629..438e598a19 100644 --- a/spec/support/cert/key.pem +++ b/spec/support/cert/key.pem @@ -1,51 +1,52 @@ ------BEGIN RSA PRIVATE KEY----- -MIIJKQIBAAKCAgEAvFf3I2RnIbp82Dd0AooAMamxMCgug4zurMdA40mV8G+MA4Y5 -XFcGmOYT7LC94Z2nZ4tI+MNSiLKQY3Zq+OYGGmn/zVkre8+02afxTjGmLVJWJXxX -V2rsf8+UuJMOPbmVq87nJmD2gs9T6czOE3eQdDTRUzTgubWhp3hV291gMfCIQeBb -SqfbBscz0Nboj8NHStWDif5Io94l08tdW9oHIu99NYE0DMWIfBeztHpmSfkgPKH8 -lNar1dMsuCRW2Q/b01TNPKCNp8ZxyIhzkOq2gC5l60i5/iALWeEJii8g71V3DMbU -5KoPEB+jFZ/z7qAi8TH9VqgaUycs/M96VXMIZbDhXywJpg7qHxG/RT16bXwFotre -Thcla2M3VxsZEnYPEVmQEyVQeG7XyvqFMC3DhGCflW35dumJlkuGn9e9Lg6oiidp -2RMnZuTsie+y3e3XJz2ZjFihGQNy2VzUrDz4ymi2fosVGMeHn3iK2nEqxf1mx021 -j3v40/8I5gtkS+zZuchclae0gRHaNN1tO0osedUdlV7D0dvi9xezsfelqSqJjChL -fl4R3HqC8k7cwUfK4RmKXhI5GX4ESr+1KWPIaqH5AxYB+ee2WYBQGhi6aXKpVcj9 -dvq+OAmDMPCJr0xnWMMZqR5dnxY1eEq2x28n2b1SyIw1+IctNX0nLwGAMgUCAwEA -AQKCAgAEsuEche24vrFMp52CTrUQiB4+iFIYwBRYRSROR1CxTecdU2Ts89LbT6oh -los2LLu3bpckdaMCfAn0IUkr6nkugYR7OAVIsnbdkz4G6GAv80To7IA1UxqRWblp -HWoWiiG8xo2nvHWJ7+g1BgICJFJ7Q7IRNFmC6JAe4Har5Ir40/piQlmktClXsvKM -/D+TDpkhuc/tSmW/iNRCw2kR2I+jBHyIMC//PZJZHjJCh2cz4z41pQjrIavpyrnr -4iQ0iBvA2vW/1HWUQPQnv5e6ftCMxBuQ0iCpwVznIiEdzG0y61vr+q3nAoMbsN5d -tL7eLiqQ/+FFHy6A8pJBwF9Z8GO+MsN0GbD4Ttd2WkXVM4AJwWsB6SWx7znrgWhy -JHy/5r20/0J0VniX63qjt8RRUG9VyHxr8Vx0/jkd+3z23cn/ecBf41sLFy30HsIN -Gg2KJf4Wf1kFaEgdT2xO2fahBWOeN7uKJokNaSkocE6NRdfoxhj/r/RLcJJqE4V9 -a4FOMmdZtCgxvNN2Cb3GS76ImQjfJpA8wrBOWxW+XFuQi5ohory9mdLjbnk9/w/v -6yT76DN+gcgfrgHW1w5ttwfnyQF9fQ2hRobbGqbYFOMaxE1Qds46Vl+GN9KlMhhO -S0zK7ZSKE9pqaLTo5Hb4po/0A4TXAL0v2iap+9bD3NKoRnDBoQKCAQEA5IDHxRGu -mgAuW29PidvrNcRDQBMmkm89BvPr1Om50l6Zk/DuwgE7/73eiCBA/yXuqkjUTJXT -iAuQE0yLjU6YFGdl7lNncfD+Zl9CztOkNpfO6z5vyvvvkLXU3pL0ytTW4RNaV0fQ -ccGF0gnzOp6DoWCSkNz1Pz3VLyn1m4rnOaFu2a2O2Ljs1Nrc+FGP1LFrsiQnpPP9 -ArXpjSqTs5tUMKNJ1y3Y1bkpfx9B+LWXLTP2eLNlIjiCEzbyEtAldSZFfz30Tjmx -3Yr4aqgdHGcMm66MeLCXGdnuoBLpll6UpDC6oZT9Nh8uFlQXrhiy+0Gsxw4UjAZd -ilY+jqHQqmqFSQKCAQEA0wIKnmKYIc76niu3fUAN3iuO3bZ5Q0k/OBonVMNnwBc4 -1YWG4p2ecEQrA2CJmoz0J6rEm+y+DHRw6LH1zBjl3riCDbomwIVGZ/puub7Ibcbc -t0P6DzUeP0jz2o+JaPWClZxFOlikhjkWwmAWl+iyx3hh/sRXtrmkKkhSxEk8CUAa -yM78AG3maI36LpGEYf3sP5EZV/EsyEAV0uKJpmuHGcgkytq/x893R37HfzDdMlN6 -ejk6rbCbCOaXO8AXrKwWpUuudlfDBzPgQ/kl8dKJwgv8u5NlshjknkhKi6Hoprsi -N/zhR7Rns/Z/N4g5zNtKTrQXh4reFF2CWREssMwS3QKCAQA6tvyeHtUGrVU8GXYO -rnvZ7Px60nDu37aGuta2dvhQng5IfXhcUYThSiCMSf1pko2pI92pcDZSluYGj3ys -aq2ZUJhYjQXfuVUlaQT5sFhZzthUik6fke0U+iQgrRJJrDcqzpZAJyvgjyGbvwLI -5UJdjTscDirWfUTyQY3i0eZoYJrjRD2YYqw4ZaSyCgMzXAOYWsH1GNzCfYvtwisB -07/mX47xw84b3OBU0etZxQ97hganLTGngW2rEktRmjqFx7fD4l+MWjbh/numrFwO -mEwdFNTzjizFb8JpT3LGOLdpGTxbmLUX2xs0kZckHSSge1eyLmQJNvmCOncIn3vG -zmhBAoIBAQDBZxyegZYZXuIdOcqr9ZsAaQJAu3C4OJnGbUphid09lstUAlhYu8mt -8v1N0h0t2EYtWXttw3eKaOvYjMzTLnr7QjiKJnZAfafDxCna/EAvRlelbpvzdmdr -8Az65hc3adgwExTs3rSmBguTS4lJ4VKEPBXt8r7Gz67lxnZ+TPXHMMecCQO3zQOk -D4YhSuWA/8Gbnf4Rug+m1/5o1ZT/QY2KFwWKHSgtFz6n/E8UiJAmAZfAEVZ0PuxL -Ize431+TuAPlq9GTzOsIXgcPpnyeArCbeGtE7lwG+oQJhA83nsZklB9QG+vM0lE/ -BQ8jsivwVYrtSmpKpQDav76qrnA8+D/NAoIBAQCm80sB4L+2gIb/Qg/rvTW7atc2 -q7GCZ/YHmHb3TeV8QiKEr7lXIAS9tFrCbWLUwBqXJIkOJUFmk2BQg/78OPJyorcE -7qTptaO0qnp9BjxvZimE3wwM7WVa8pQCAYt96unHlQoQoT9xeyti/ZKMzHaoMVuL -J0DfPa71yW7uTCWoyVCNQwqIourHFv6sKsiERE/OjhRVLyXG/5uLZjc0lYY/qaQ1 -ax/UxjyTOakil8MBnta/q1NpSv8SQmFXCWjrREepkJF0/CzC7/1AULBdy0h1132C -B5CWnSKpHPePuczojgXjmw+Xg6vAXwsA4CXVJF1AUBlg7q91PtZYpCAqMPwA ------END RSA PRIVATE KEY----- +-----BEGIN PRIVATE KEY----- +MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDtqADnxpoYw6Ch +INwiW/0DdbX+SnYlIl5mjJIAObUvR/zo/R/y1Eda2vJEUAsWlmoNHMdbcjnvw4Aw +RKbm+9lWtwsQhM+Wk2goyd2JKtxpgGSt4VijZJz07CXIwkd6cNeym45MSmrvHUyI +c7uYQ01FxUcV7Y0NK/FBK+mCzEYeMxGdVT8851+D5AlmQYPVEmkG7uGlcFDsi2Hc +auUTADDzWk0SCJHQwO7lKWZdxAYS/OcBosAE4pGjYDiJ3blXilaplFHKYVEFN89V +YFvrgUuk9hdZBHSN1a0R78lrwrIIDveKjVWQ2o0P1K2+59Dq2alE01IKwWYdmH9v ++xIe1p/ZTYNISkTcyMpt3mttxcmJ5qCWZDT8XhdnwnQXYSE02jDGQb3J72VJ28HI +sXrUmM639tfPi31gZ7g5OqnrEhIyLLExfUdwECO+qrX8/udj7mr7WNAQB8bzjbBS +YT5zAIW+hesVbQRHrEm/cfiCRQcqPUOl2ZQ2+PaGZxFDyA+Y0vN8pKY9vdind1gU +hXDR5RBhAHlaUymU+leNoOo5ioZN74f5YW6M5+D9IrcwQBRPq70O178xsNvaQmAb +rFat3E68riI5oIVGbCXNfF7iAQmE98tKV0Up7PNsGcYtvArZV1SB/Gw59VOmQwbX +Is2TPwnh6C/hfi+4aeyXJpqpydFx0wIDAQABAoICAFjLGnt+gniaLtvE0TqtL90p +D7RQ0c+SBb8+6hXXedCOjvnmCRfLJFXX1Aid92abEEiR5hJOnULtwmlGXS2UD2IM +xb+IP588t//1XCYxs2Rfqj4lId76aoI/8OYPYHFo085RvFrYuxdX1Q5uXzrGeoqE +6MhSlw7CykLVS0upUtFZt00XWqdAszkt7C0ecUkctcz3V6teSX33nbqi3a+5tJBX +vs/sD771Nsy8KRkDclmJ0C2WRzQMCuoFu1oXU3ZXo4V8ewqoTYMrlPWLKQzWpBKg +N5z0wy9zFFTNSG5Qsf+8x9Qmdj/GyEmP5tKa/j2g0VN7uP13wNVx8rs+DUkkW1g2 +5tVNQyLgcGmoJHYbciFW7DvCRhid/xyaWgpvtJQtOwSJeBc0UZFZM8Q+u4LL1riI +dTR1R0iNu1+TawrXuaiwbiJjC9kWHx4YauhD43mh2q/QC/nFqYya02Y5lnZ6m68J +EqYkwOtgfq9Ow4EA33BsF/psxZ1+bKBLw/dmRzMa4tzb65jxtaGsQ+V95qkmAqHC +W7zHhIsR0+NW+RG/DiIBNkdHq7M21C9nX837L00/Aeho3j/uquGYT+0SIO8xH7Qr +6V0E6gLUcwvg02Czq/gnLX55MzPfAp4tmFpCeMjz/3kmd3yOkVIKKuAm+6iVYrrj +T8HfIae9QkyPDNqYROUxAoIBAQD/UTL4hJr5QaGM+25Xc3u6l7u6pUCQ0EdvjSx/ +fcMK+SSeMp/TDpD0eJZ06o53ue7Z3Q34GLmgzXLj1eXXR5GzeCxJIdq1VirDQg7g +EQtKWQDEVS64OA8Y8W9zOJdr7oOhs1VREWQi2A1Rnuu1gxaTfgJUjOdZwNh1beDV +Y1W/xVEhSTibO330hPilDWKeFG4/6CS6N7ZgppEKypbcKoODJoD74KfQclYFyokz +l1NznJu0FEpfYPkEqD/toIcikf2aPSBSQhtOMOYwyG7ddDWX6j3AZjnVX954TQOE +ESgS5tqZolexVTMyhm1KL58ZBw5w477j9f6cmoE1vhdhUpsvAoIBAQDuSraIoorq +iVc83GRij7d38Sf2AnT6ol7vB5IPC04o+Jcoa2UypD0hMdh8bMt1JOHhDfEerUCf +Gvq10MF5OSb8bH3yMcsdSLFpsK/tEw1/aW1zjJJhMTvwbX59Okc2pA0yBt8KimaQ +gtK1s3DAZg67ur1AfEc8k46zTZS7XCRGE02r9zNfz6qBXY5RjR45NPN5RQsoejzh +FrN/TnyvvWhyRj2Ohwb1xghpUQw4swMNtZsx0ROjQAlgKW0xlyt+DRGXnH1rYQ0l +92jFT+I+RzagSQms9IF0ns+u1EVZ4Vv9DvDdKuqA5+Ge2MElgTUFYLrFXkXI1q/2 +/mKf0imYkpqdAoIBABKdLuQjdtD5UfffVNoXV0vxSASBi8WDCdI+LqJU3uVr6JmI +A1L12ueX6xA3EY/1BE7p6NzPoKjykY++xnT9iMfW2ROz3igeUhvOMxtu4q3W81Fd +DHztyVv+LivuUkvSJdKiKnQwmmZX7hCnT3P6TKkQJMdZRnyqrJ1TF3M3PMcwcYvF +tNTMb5BmKWKPKUNxJeCO4i6ZZTiCrExnHLyMdO4Y3op+hH2T+GWPsJUMUU86ebeV +Sx7NCRqn0ZFXhMKmdiDKmBKnMypuMjoYQszubgHXWA0w5sKBrMyEgN8eCRfnsMRG +q7IIDiV+23TvJ+BBPXJJiF9CTf/I2+a5Jyc3SI0CggEBAIJyyixQdyXf268Io7fF +H1X84bhuLeXLH5dRGKc9tCL/u5g3+qVXfdN/OxkaYeMWNsWCYV4+0CKJnXgM+O1I +2UvUhLoigiPc2KqYPCbXiEsYxv87lCK61ipPdrBNSBDkjAi39EAL9gvkYj9wJShe +dnBU0SfNIR5LVRJZRTOwRHdMN/gNEsW/pIK/WZrRWxtMHoFjx7D4Af3i9I6bw+xd +DyGHzEkLKEdBivdElCEx9lj58yS5ZTu4YamP5CQCsp+Fvfy2gX5YGd+P6n4htiQL +zh6+/Rn+nCPgkKcPs4t5sGb/V+JrjQbWahAQbuP+MK1p/7TuX9uLk7buGcWOQpEw +qI0CggEBAJIoTK5M9fP+V97tFJxhwCA6VKmBXKm0BLScsWoBXGRtEBse/Rjm4WMU +F0EHderKz6/pWjLyNPB/SUSOH9g/s7VJPmflvWzOE2rnnQzkc+LWdtcXuVaDlZxD +ZkNR3VhFg5HvWCC7OYTlRBuWuk1gn/Y/SrCFszaQKmzMgf25zrgeP2ZiYFXkFAsY +kvfUrPNLismWrH/HzPyhWRPLlK4r+gc5gIVwHvDcWvfgS3KB2/7Y3co2zdR/Q7em +2V66VbR8i8fVPfUw3z7C3w9egkcok4+1645ufQQ6q5f8ChrAWKRao63g0Udcb6Ea +MtUwzf6SjAmaf7NlZHqLxuKCmFTBqbw= +-----END PRIVATE KEY----- From 641f57c245273d60127ba94895d4a1b84a5a89a4 Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Fri, 17 Dec 2021 17:17:19 +0100 Subject: [PATCH 12/13] Fix missing await --- spec/ParseUser.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/ParseUser.spec.js b/spec/ParseUser.spec.js index 0096b462f1..164c9dc56f 100644 --- a/spec/ParseUser.spec.js +++ b/spec/ParseUser.spec.js @@ -2926,7 +2926,7 @@ describe('Parse.User testing', () => { sendPasswordResetEmail: () => Promise.resolve(), sendMail: () => Promise.resolve(), }; - reconfigureServer({ + await reconfigureServer({ appName: 'unused', verifyUserEmails: true, emailAdapter: emailAdapter, From ffb7edc31d0da767cba42152dc5f7bd70efd69cf Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Wed, 19 Jan 2022 15:58:45 +0100 Subject: [PATCH 13/13] Replace new localhost occurences with 127.0.0.1 --- spec/Idempotency.spec.js | 2 +- spec/schemas.spec.js | 10 +++++----- src/Controllers/LoggerController.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/Idempotency.spec.js b/spec/Idempotency.spec.js index 32a7e471e9..3f12127ada 100644 --- a/spec/Idempotency.spec.js +++ b/spec/Idempotency.spec.js @@ -103,7 +103,7 @@ describe('Idempotency', () => { }); const params = { method: 'POST', - url: 'http://localhost:8378/1/functions/myFunction', + url: 'http://127.0.0.1:8378/1/functions/myFunction', headers: { 'X-Parse-Application-Id': Parse.applicationId, 'X-Parse-Master-Key': Parse.masterKey, diff --git a/spec/schemas.spec.js b/spec/schemas.spec.js index 20518ed134..62760eb07d 100644 --- a/spec/schemas.spec.js +++ b/spec/schemas.spec.js @@ -243,7 +243,7 @@ describe('schemas', () => { it('ensure refresh cache after creating a class', async done => { spyOn(SchemaController.prototype, 'reloadData').and.callFake(() => Promise.resolve()); await request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -252,7 +252,7 @@ describe('schemas', () => { }, }); const response = await request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'GET', headers: masterKeyHeaders, json: true, @@ -1559,7 +1559,7 @@ describe('schemas', () => { spyOn(config.schemaCache, 'del').and.callFake(() => {}); spyOn(SchemaController.prototype, 'reloadData').and.callFake(() => Promise.resolve()); await request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'POST', headers: masterKeyHeaders, json: true, @@ -1569,12 +1569,12 @@ describe('schemas', () => { }); await request({ method: 'DELETE', - url: 'http://localhost:8378/1/schemas/A', + url: 'http://127.0.0.1:8378/1/schemas/A', headers: masterKeyHeaders, json: true, }); const response = await request({ - url: 'http://localhost:8378/1/schemas', + url: 'http://127.0.0.1:8378/1/schemas', method: 'GET', headers: masterKeyHeaders, json: true, diff --git a/src/Controllers/LoggerController.js b/src/Controllers/LoggerController.js index 8ee492cf4b..e8261722dc 100644 --- a/src/Controllers/LoggerController.js +++ b/src/Controllers/LoggerController.js @@ -38,7 +38,7 @@ export class LoggerController extends AdaptableController { } maskSensitiveUrl(path) { - const urlString = 'http://localhost' + path; // prepend dummy string to make a real URL + const urlString = 'http://127.0.0.1' + path; // prepend dummy string to make a real URL const urlObj = new URL(urlString); const query = urlObj.searchParams; let sanitizedQuery = '?';