Skip to content

Commit c82c360

Browse files
nearnshawgonpombo8
andauthored
Remove domain checks (#243)
* fix ui * fix other UI screens * minor adjustments * fix reward-claim * make boat and other items multiplayer * updates * make smart items multiplayer * remove domain checks --------- Co-authored-by: Gonzalo DCL <gonzalo@decentraland.org>
1 parent 6eed53c commit c82c360

File tree

3 files changed

+0
-37
lines changed

3 files changed

+0
-37
lines changed

guest-book-api/server/src/security/securityChecks.ts

-12
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import * as dcl from 'decentraland-crypto-middleware'
44
import { denyListedIPS, TESTS_ENABLED, Metadata, realmWhiteList } from './utils'
55
import { checkCoords } from './verifyOnMap'
66

7-
export function checkOrigin(req: Request) {
8-
const validOrigins = ['https://decentraland.org', 'https://decentraland.zone']
9-
return validOrigins.includes(req.header('origin')!)
10-
}
117

128
export function checkBannedIPs(req: Request) {
139
const ip = req.header('X-Forwarded-For')
@@ -32,14 +28,6 @@ export async function runChecks(req: Request & dcl.DecentralandSignatureData<Met
3228
return parseInt(item, 10)
3329
})
3430

35-
// check that the request comes from a decentraland domain
36-
const validOrigin =
37-
TESTS_ENABLED && (metadata.realm.hostname === 'localhost' || metadata.realm.serverName === 'LocalPreview')
38-
? true
39-
: checkOrigin(req)
40-
if (!validOrigin) {
41-
throw new Error('INVALID ORIGIN')
42-
}
4331

4432
// filter against a denylist of malicious ips
4533
const validIP = checkBannedIPs(req)

leader-board/server/src/security/securityChecks.ts

-12
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import * as dcl from 'decentraland-crypto-middleware'
44
import { denyListedIPS, TESTS_ENABLED, Metadata, realmWhiteList } from './utils'
55
import { checkCoords } from './verifyOnMap'
66

7-
export function checkOrigin(req: Request) {
8-
const validOrigins = ['https://decentraland.org', 'https://decentraland.zone']
9-
return validOrigins.includes(req.header('origin')!)
10-
}
117

128
export function checkBannedIPs(req: Request) {
139
const ip = req.header('X-Forwarded-For')
@@ -32,14 +28,6 @@ export async function runChecks(req: Request & dcl.DecentralandSignatureData<Met
3228
return parseInt(item, 10)
3329
})
3430

35-
// check that the request comes from a decentraland domain
36-
const validOrigin =
37-
TESTS_ENABLED && (metadata.realm.hostname === 'localhost' || metadata.realm.serverName === 'LocalPreview')
38-
? true
39-
: checkOrigin(req)
40-
if (!validOrigin) {
41-
throw new Error('INVALID ORIGIN')
42-
}
4331

4432
// filter against a denylist of malicious ips
4533
const validIP = checkBannedIPs(req)

validate-player-authenticity/server/src/security/securityChecks.ts

-13
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import dcl from 'decentraland-crypto-middleware'
44
import { denyListedIPS, TESTS_ENABLED, Metadata, realmWhiteList } from '../utils'
55
import { checkCoords } from './verifyOnMap'
66

7-
export function checkOrigin(req: Request) {
8-
const validOrigins = ['https://decentraland.org', 'https://decentraland.zone']
9-
return validOrigins.includes(req.header('origin'))
10-
}
117

128
export function checkBannedIPs(req: Request) {
139
const ip = req.header('X-Forwarded-For')
@@ -32,15 +28,6 @@ export async function runChecks(req: Request & dcl.DecentralandSignatureData<Met
3228
return parseInt(item, 10)
3329
})
3430

35-
// check that the request comes from a decentraland domain
36-
const validOrigin =
37-
TESTS_ENABLED && (metadata.realm.hostname === 'localhost' || metadata.realm.serverName === 'LocalPreview')
38-
? true
39-
: checkOrigin(req)
40-
if (!validOrigin) {
41-
throw new Error('INVALID ORIGIN')
42-
}
43-
4431
// filter against a denylist of malicious ips
4532
const validIP = checkBannedIPs(req)
4633
if (validIP) {

0 commit comments

Comments
 (0)