@dcl/content-validator 4.2.2 → 4.2.3-20230116175244.commit-84aaedb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/content-validator.api.json +178 -53
- package/dist/the-graph-client/the-graph-client.d.ts +5 -1
- package/dist/the-graph-client/the-graph-client.d.ts.map +1 -1
- package/dist/the-graph-client/the-graph-client.js +49 -83
- package/dist/the-graph-client/the-graph-client.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/types.d.ts +38 -23
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/validations/ADR51.d.ts +1 -1
- package/dist/validations/ADR51.d.ts.map +1 -1
- package/dist/validations/access-checker/items/collection-asset.d.ts +2 -2
- package/dist/validations/access-checker/items/collection-asset.d.ts.map +1 -1
- package/dist/validations/access-checker/items/collection-asset.js +43 -106
- package/dist/validations/access-checker/items/collection-asset.js.map +1 -1
- package/dist/validations/access-checker/items/items.d.ts +3 -3
- package/dist/validations/access-checker/items/items.d.ts.map +1 -1
- package/dist/validations/access-checker/items/third-party-asset.d.ts.map +1 -1
- package/dist/validations/access-checker/items/third-party-asset.js +21 -80
- package/dist/validations/access-checker/items/third-party-asset.js.map +1 -1
- package/dist/validations/access-checker/scenes.d.ts.map +1 -1
- package/dist/validations/access-checker/scenes.js +29 -227
- package/dist/validations/access-checker/scenes.js.map +1 -1
- package/package.json +9 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-asset.js","sourceRoot":"","sources":["../../../../src/validations/access-checker/items/collection-asset.ts"],"names":[],"mappings":";;;AAAA,0CAA6C;
|
|
1
|
+
{"version":3,"file":"collection-asset.js","sourceRoot":"","sources":["../../../../src/validations/access-checker/items/collection-asset.ts"],"names":[],"mappings":";;;AAAA,0CAA6C;AAE7C,0CAAuG;AAGvG,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ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AAK,GAAuB,EAAE,CAAA;gBACpC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE;oBACzB,IAAI,iBAAiB,EAAE;wBACrB,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAA;qBACtD;oBACD,IAAI,4BAA4B,EAAE;wBAChC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,4BAA4B,CAAC,CAAC,CAAA;qBACjE;iBACF;gBAED,SAAS,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;aACtD;YAAC,OAAO,GAAQ,EAAE;gBACjB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;aAClB;YAED,IAAI,CAAC,SAAS,EAAE;gBACd,OAAO,IAAA,wBAAgB,EACrB,6BAA6B,UAAU,kDAAkD,KAAK,CAAC,eAAe,KAAK,KAAK,CAAC,EAAE,GAAG,CAC/H,CAAA;aACF;YACD,OAAO,UAAE,CAAA;SACV;aAAM;YACL,OAAO,IAAA,wBAAgB,EAAC,wCAAwC,OAAO,GAAG,CAAC,CAAA;SAC5E;IACH,CAAC;IACD,WAAW,CAAC,KAAK;QACf,OAAO,KAAK,CAAC,IAAI,KAAK,gCAAgC,IAAI,KAAK,CAAC,IAAI,KAAK,gCAAgC,CAAA;IAC3G,CAAC;CACF,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BlockchainCollectionThirdParty, BlockchainCollectionV1Asset, BlockchainCollectionV2Asset, OffChainAsset } from '@dcl/urn-resolver';
|
|
2
2
|
import { DeploymentToValidate } from '../../..';
|
|
3
3
|
import { ContentValidatorComponents, ValidationResponse } from '../../../types';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
4
|
+
export type UrnType = 'off-chain' | 'blockchain-collection-v1-asset' | 'blockchain-collection-v2-asset' | 'blockchain-collection-third-party';
|
|
5
|
+
export type SupportedAsset = BlockchainCollectionV1Asset | BlockchainCollectionV2Asset | OffChainAsset | BlockchainCollectionThirdParty;
|
|
6
|
+
export type AssetValidation = {
|
|
7
7
|
validateAsset(components: Pick<ContentValidatorComponents, 'externalCalls'>, asset: SupportedAsset, deployment: DeploymentToValidate): ValidationResponse | Promise<ValidationResponse>;
|
|
8
8
|
canValidate(asset: SupportedAsset): boolean;
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../../../src/validations/access-checker/items/items.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,2BAA2B,EAC3B,aAAa,EAEd,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAAoB,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAKjG,
|
|
1
|
+
{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../../../src/validations/access-checker/items/items.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,2BAA2B,EAC3B,aAAa,EAEd,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,0BAA0B,EAAoB,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAKjG,MAAM,MAAM,OAAO,GACf,WAAW,GACX,gCAAgC,GAChC,gCAAgC,GAChC,mCAAmC,CAAA;AAEvC,MAAM,MAAM,cAAc,GACtB,2BAA2B,GAC3B,2BAA2B,GAC3B,aAAa,GACb,8BAA8B,CAAA;AAElC,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,CACX,UAAU,EAAE,IAAI,CAAC,0BAA0B,EAAE,eAAe,CAAC,EAC7D,KAAK,EAAE,cAAc,EACrB,UAAU,EAAE,oBAAoB,GAC/B,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACnD,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAA;CAC5C,CAAA;AAsCD,eAAO,MAAM,eAAe;2BAEZ,KAAK,0BAA0B,EAAE,eAAe,GAAG,MAAM,GAAG,gBAAgB,CAAC,cAC7E,oBAAoB,wBACV,OAAO,EAAE;CAkClC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"third-party-asset.d.ts","sourceRoot":"","sources":["../../../../src/validations/access-checker/items/third-party-asset.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"third-party-asset.d.ts","sourceRoot":"","sources":["../../../../src/validations/access-checker/items/third-party-asset.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAazC,eAAO,MAAM,yBAAyB,EAAE,eA6CvC,CAAA"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.thirdPartyAssetValidation = void 0;
|
|
4
4
|
const content_hash_tree_1 = require("@dcl/content-hash-tree");
|
|
5
|
-
const hashing_1 = require("@dcl/hashing");
|
|
6
5
|
const schemas_1 = require("@dcl/schemas");
|
|
7
6
|
const types_1 = require("../../../types");
|
|
8
7
|
function toHexBuffer(value) {
|
|
@@ -14,87 +13,29 @@ function toHexBuffer(value) {
|
|
|
14
13
|
function getThirdPartyId(urn) {
|
|
15
14
|
return `urn:decentraland:${urn.network}:collections-thirdparty:${urn.thirdPartyName}`;
|
|
16
15
|
}
|
|
17
|
-
async function verifyHash(metadata, merkleRoot, logger) {
|
|
18
|
-
if (!schemas_1.MerkleProof.validate(metadata.merkleProof)) {
|
|
19
|
-
logger.debug('Merkle proof is not valid', {
|
|
20
|
-
merkleProof: metadata.merkleProof
|
|
21
|
-
});
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
const merkleProof = metadata.merkleProof;
|
|
25
|
-
const generatedCrcHash = (0, hashing_1.keccak256Hash)(metadata, metadata.merkleProof.hashingKeys);
|
|
26
|
-
// The hash provided in the merkleProof for the entity MUST match the hash generated by the validator.
|
|
27
|
-
if (metadata.merkleProof.entityHash !== generatedCrcHash) {
|
|
28
|
-
logger.debug(`The hash provided in the merkleProof doesn't match the one generated by the validator`, {
|
|
29
|
-
generatedCrcHash,
|
|
30
|
-
entityHash: metadata.merkleProof.entityHash
|
|
31
|
-
});
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
// Verify if the entity belongs to the Merkle Tree.
|
|
35
|
-
const bufferedProofs = merkleProof.proof.map((value) => toHexBuffer(value));
|
|
36
|
-
const bufferedMerkleRoot = toHexBuffer(merkleRoot);
|
|
37
|
-
return (0, content_hash_tree_1.verifyProof)(merkleProof.index, merkleProof.entityHash, bufferedProofs, bufferedMerkleRoot);
|
|
38
|
-
}
|
|
39
|
-
async function getMerkleRoot(components, block, thirdPartyId) {
|
|
40
|
-
const query = `
|
|
41
|
-
query MerkleRoot($id: String!, $block: Int!) {
|
|
42
|
-
thirdParties(where: { id: $id, isApproved: true }, block: { number: $block }, first: 1) {
|
|
43
|
-
root
|
|
44
|
-
}
|
|
45
|
-
}`;
|
|
46
|
-
const result = await components.subGraphs.L2.thirdPartyRegistry.query(query, {
|
|
47
|
-
id: thirdPartyId,
|
|
48
|
-
block
|
|
49
|
-
});
|
|
50
|
-
if (!result.thirdParties || result.thirdParties.length < 1)
|
|
51
|
-
return;
|
|
52
|
-
return result.thirdParties[0]?.root;
|
|
53
|
-
}
|
|
54
|
-
async function verifyMerkleProofedEntity(components, urn, deployment, logger) {
|
|
55
|
-
// do merkle proofed entity validation, required keys are defined by the Catalyst and must be a subset of the hashingKeys from the MerkleProof to succeed
|
|
56
|
-
const metadata = deployment.entity.metadata;
|
|
57
|
-
if (!(0, schemas_1.isThirdParty)(deployment.entity.metadata)) {
|
|
58
|
-
// This should never happen as the metadata validation ran before
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
const thirdPartyId = getThirdPartyId(urn);
|
|
62
|
-
const { blockNumberAtDeployment, blockNumberFiveMinBeforeDeployment } = await components.theGraphClient.findBlocksForTimestamp(components.subGraphs.L2.blocks, deployment.entity.timestamp);
|
|
63
|
-
const merkleRoots = [];
|
|
64
|
-
const hasPermissionOnBlock = async (blockNumber) => {
|
|
65
|
-
try {
|
|
66
|
-
if (!blockNumber)
|
|
67
|
-
return false;
|
|
68
|
-
const merkleRoot = await getMerkleRoot(components, blockNumber, thirdPartyId);
|
|
69
|
-
if (!merkleRoot) {
|
|
70
|
-
logger.debug(`Merkle proof not found for given block and third party ID`, { blockNumber, thirdPartyId });
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
merkleRoots.push(merkleRoot);
|
|
74
|
-
return await verifyHash(metadata, merkleRoot, logger);
|
|
75
|
-
}
|
|
76
|
-
catch (e) {
|
|
77
|
-
const error = e?.message;
|
|
78
|
-
logger.debug(error);
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const validMerkleProofedEntity = (await hasPermissionOnBlock(blockNumberAtDeployment)) ||
|
|
83
|
-
(await hasPermissionOnBlock(blockNumberFiveMinBeforeDeployment));
|
|
84
|
-
if (!validMerkleProofedEntity) {
|
|
85
|
-
logger.debug(`Merkle Tree based verifications failed:`, {
|
|
86
|
-
merkleProof: JSON.stringify(metadata.merkleProof),
|
|
87
|
-
merkleRoots: JSON.stringify(merkleRoots),
|
|
88
|
-
blocks: JSON.stringify([blockNumberAtDeployment, blockNumberFiveMinBeforeDeployment])
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
return validMerkleProofedEntity;
|
|
92
|
-
}
|
|
93
16
|
exports.thirdPartyAssetValidation = {
|
|
94
17
|
async validateAsset(components, asset, deployment) {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
18
|
+
const { checker } = components.subGraphs.L2;
|
|
19
|
+
const { timestamp } = deployment.entity;
|
|
20
|
+
let verified = false;
|
|
21
|
+
if ((0, schemas_1.isThirdParty)(deployment.entity.metadata)) {
|
|
22
|
+
// This should always happen as the metadata validation ran before
|
|
23
|
+
const metadata = deployment.entity.metadata;
|
|
24
|
+
const merkleProof = metadata.merkleProof;
|
|
25
|
+
const ethAddress = components.externalCalls.ownerAddress(deployment.auditInfo);
|
|
26
|
+
const thirdPartyId = getThirdPartyId(asset);
|
|
27
|
+
const bufferedProofs = merkleProof.proof.map((value) => toHexBuffer(value));
|
|
28
|
+
const root = (0, content_hash_tree_1.generateRoot)(merkleProof.index, merkleProof.entityHash, bufferedProofs);
|
|
29
|
+
const { blockAtDeployment, blockFiveMinBeforeDeployment } = await components.theGraphClient.findBlocksForTimestamp(timestamp, components.subGraphs.l2BlockSearch);
|
|
30
|
+
const batch = [];
|
|
31
|
+
if (blockAtDeployment) {
|
|
32
|
+
batch.push(checker.validateThirdParty(ethAddress, thirdPartyId, root, blockAtDeployment));
|
|
33
|
+
}
|
|
34
|
+
if (blockFiveMinBeforeDeployment) {
|
|
35
|
+
batch.push(checker.validateThirdParty(ethAddress, thirdPartyId, root, blockFiveMinBeforeDeployment));
|
|
36
|
+
}
|
|
37
|
+
verified = (await Promise.all(batch)).some((r) => r);
|
|
38
|
+
}
|
|
98
39
|
if (!verified) {
|
|
99
40
|
return (0, types_1.validationFailed)(`Couldn't verify merkle proofed entity`);
|
|
100
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"third-party-asset.js","sourceRoot":"","sources":["../../../../src/validations/access-checker/items/third-party-asset.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"third-party-asset.js","sourceRoot":"","sources":["../../../../src/validations/access-checker/items/third-party-asset.ts"],"names":[],"mappings":";;;AAAA,8DAAqD;AACrD,0CAA4D;AAE5D,0CAAuG;AA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cAAc,CAAC,CAAA;YAEpF,MAAM,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,GACvD,MAAM,UAAU,CAAC,cAAc,CAAC,sBAAsB,CAAC,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;YAEvG,MAAM,KAAK,GAAuB,EAAE,CAAA;YACpC,IAAI,iBAAiB,EAAE;gBACrB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAA;aAC1F;YACD,IAAI,4BAA4B,EAAE;gBAChC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,4BAA4B,CAAC,CAAC,CAAA;aACrG;YAED,QAAQ,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;SACrD;QAED,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,IAAA,wBAAgB,EAAC,uCAAuC,CAAC,CAAA;SACjE;QACD,OAAO,UAAE,CAAA;IACX,CAAC;IACD,WAAW,CAAC,KAAK;QACf,OAAO,KAAK,CAAC,IAAI,KAAK,mCAAmC,CAAA;IAC3D,CAAC;CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenes.d.ts","sourceRoot":"","sources":["../../../src/validations/access-checker/scenes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scenes.d.ts","sourceRoot":"","sources":["../../../src/validations/access-checker/scenes.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,UAAU,EAAE,MAAM,aAAa,CAAA;AAIpD;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,UAyDpB,CAAA"}
|
|
@@ -6,256 +6,58 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.scenes = void 0;
|
|
7
7
|
const ms_1 = __importDefault(require("ms"));
|
|
8
8
|
const types_1 = require("../../types");
|
|
9
|
+
const SCENE_LOOKBACK_TIME = (0, ms_1.default)('5m');
|
|
9
10
|
/**
|
|
10
11
|
* Checks if the given address has access to the given parcel at the given timestamp.
|
|
11
12
|
* @public
|
|
12
13
|
*/
|
|
13
14
|
exports.scenes = {
|
|
14
|
-
validate: async ({ externalCalls,
|
|
15
|
-
const logger = logs.getLogger('scenes access validator');
|
|
16
|
-
const getAuthorizations = async (owner, operator, timestamp) => {
|
|
17
|
-
const query = `
|
|
18
|
-
query GetAuthorizations($owner: String!, $operator: String!, $timestamp: Int!) {
|
|
19
|
-
authorizations(
|
|
20
|
-
where: {
|
|
21
|
-
owner: $owner,
|
|
22
|
-
operator: $operator,
|
|
23
|
-
createdAt_lte: $timestamp
|
|
24
|
-
},
|
|
25
|
-
orderBy: timestamp,
|
|
26
|
-
orderDirection: desc
|
|
27
|
-
) {
|
|
28
|
-
type
|
|
29
|
-
isApproved
|
|
30
|
-
}
|
|
31
|
-
}`;
|
|
32
|
-
const variables = {
|
|
33
|
-
owner,
|
|
34
|
-
operator,
|
|
35
|
-
timestamp: Math.floor(timestamp / 1000) // js(ms) -> UNIX(s)
|
|
36
|
-
};
|
|
37
|
-
try {
|
|
38
|
-
return (await subGraphs.L1.landManager.query(query, variables)).authorizations;
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
logger.error(`Error fetching authorizations for ${owner}`);
|
|
42
|
-
throw error;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const getEstate = async (estateId, timestamp) => {
|
|
46
|
-
/**
|
|
47
|
-
* You can use `owner`, `operator` and `updateOperator` to check the current value for that estate.
|
|
48
|
-
* Keep in mind that each association (owners, operators, etc) is capped to a thousand (1000) results.
|
|
49
|
-
* For more information, you can use the query explorer at https://thegraph.com/explorer/subgraph/decentraland/land-manager
|
|
50
|
-
*/
|
|
51
|
-
const query = `
|
|
52
|
-
query GetEstate($estateId: String!, $timestamp: Int!) {
|
|
53
|
-
estates(where:{ id: $estateId }) {
|
|
54
|
-
id
|
|
55
|
-
owners(
|
|
56
|
-
where: { createdAt_lte: $timestamp },
|
|
57
|
-
orderBy: timestamp,
|
|
58
|
-
orderDirection: desc,
|
|
59
|
-
first: 1
|
|
60
|
-
) {
|
|
61
|
-
address
|
|
62
|
-
}
|
|
63
|
-
operators(
|
|
64
|
-
where: { createdAt_lte: $timestamp },
|
|
65
|
-
orderBy: timestamp,
|
|
66
|
-
orderDirection: desc,
|
|
67
|
-
first: 1
|
|
68
|
-
) {
|
|
69
|
-
address
|
|
70
|
-
}
|
|
71
|
-
updateOperators(
|
|
72
|
-
where: { createdAt_lte: $timestamp },
|
|
73
|
-
orderBy: timestamp,
|
|
74
|
-
orderDirection: desc,
|
|
75
|
-
first: 1
|
|
76
|
-
) {
|
|
77
|
-
address
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}`;
|
|
81
|
-
const variables = {
|
|
82
|
-
estateId,
|
|
83
|
-
timestamp: Math.floor(timestamp / 1000) // UNIX
|
|
84
|
-
};
|
|
85
|
-
try {
|
|
86
|
-
return (await subGraphs.L1.landManager.query(query, variables)).estates[0];
|
|
87
|
-
}
|
|
88
|
-
catch (error) {
|
|
89
|
-
logger.error(`Error fetching estate (${estateId})`);
|
|
90
|
-
throw error;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
const getParcel = async (x, y, timestamp) => {
|
|
94
|
-
/**
|
|
95
|
-
* You can use `owner`, `operator` and `updateOperator` to check the current value for that parcel.
|
|
96
|
-
* Keep in mind that each association (owners, operators, etc) is capped to a thousand (1000) results.
|
|
97
|
-
* For more information, you can use the query explorer at https://thegraph.com/explorer/subgraph/decentraland/land-manager
|
|
98
|
-
*/
|
|
99
|
-
const query = `
|
|
100
|
-
query GetParcel($x: Int!, $y: Int!, $timestamp: Int!) {
|
|
101
|
-
parcels(where:{ x: $x, y: $y }) {
|
|
102
|
-
estates(
|
|
103
|
-
where: { createdAt_lte: $timestamp },
|
|
104
|
-
orderBy: createdAt,
|
|
105
|
-
orderDirection: desc,
|
|
106
|
-
first: 1
|
|
107
|
-
) {
|
|
108
|
-
estateId
|
|
109
|
-
}
|
|
110
|
-
owners(
|
|
111
|
-
where: { createdAt_lte: $timestamp },
|
|
112
|
-
orderBy: timestamp,
|
|
113
|
-
orderDirection: desc,
|
|
114
|
-
first: 1
|
|
115
|
-
) {
|
|
116
|
-
address
|
|
117
|
-
}
|
|
118
|
-
operators(
|
|
119
|
-
where: { createdAt_lte: $timestamp },
|
|
120
|
-
orderBy: timestamp,
|
|
121
|
-
orderDirection: desc,
|
|
122
|
-
first: 1
|
|
123
|
-
) {
|
|
124
|
-
address
|
|
125
|
-
}
|
|
126
|
-
updateOperators(
|
|
127
|
-
where: { createdAt_lte: $timestamp },
|
|
128
|
-
orderBy: timestamp,
|
|
129
|
-
orderDirection: desc,
|
|
130
|
-
first: 1
|
|
131
|
-
) {
|
|
132
|
-
address
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}`;
|
|
136
|
-
const variables = {
|
|
137
|
-
x,
|
|
138
|
-
y,
|
|
139
|
-
timestamp: Math.floor(timestamp / 1000) // UNIX
|
|
140
|
-
};
|
|
141
|
-
try {
|
|
142
|
-
const r = await subGraphs.L1.landManager.query(query, variables);
|
|
143
|
-
if (r.parcels && r.parcels.length)
|
|
144
|
-
return r.parcels[0];
|
|
145
|
-
logger.error(`Error fetching parcel (${x}, ${y}, ${timestamp}): ${JSON.stringify(r)}`);
|
|
146
|
-
throw new Error(`Error fetching parcel (${x}, ${y}), ${timestamp}`);
|
|
147
|
-
}
|
|
148
|
-
catch (error) {
|
|
149
|
-
logger.error(`Error fetching parcel (${x}, ${y}, ${timestamp})`);
|
|
150
|
-
throw error;
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
const hasAccessThroughAuthorizations = async (owner, ethAddress, timestamp) => {
|
|
154
|
-
/* You also get access if you received:
|
|
155
|
-
* - an authorization with isApproved and type Operator, ApprovalForAll or UpdateManager
|
|
156
|
-
* at that time
|
|
157
|
-
*/
|
|
158
|
-
const authorizations = await getAuthorizations(owner.toLowerCase(), ethAddress.toLowerCase(), timestamp);
|
|
159
|
-
const firstOperatorAuthorization = authorizations.find((authorization) => authorization.type === 'Operator');
|
|
160
|
-
const firstApprovalForAllAuthorization = authorizations.find((authorization) => authorization.type === 'ApprovalForAll');
|
|
161
|
-
const firstUpdateManagerAuthorization = authorizations.find((authorization) => authorization.type === 'UpdateManager');
|
|
162
|
-
if (firstOperatorAuthorization?.isApproved ||
|
|
163
|
-
firstApprovalForAllAuthorization?.isApproved ||
|
|
164
|
-
firstUpdateManagerAuthorization?.isApproved) {
|
|
165
|
-
return true;
|
|
166
|
-
}
|
|
167
|
-
return false;
|
|
168
|
-
};
|
|
169
|
-
const hasAccessThroughFirstLevelAuthorities = async (target, ethAddress) => {
|
|
170
|
-
const firstLevelAuthorities = [...target.owners, ...target.operators, ...target.updateOperators]
|
|
171
|
-
.filter((addressSnapshot) => addressSnapshot.address)
|
|
172
|
-
.map((addressSnapshot) => addressSnapshot.address.toLowerCase());
|
|
173
|
-
return firstLevelAuthorities.includes(ethAddress.toLowerCase());
|
|
174
|
-
};
|
|
175
|
-
const isEstateUpdateAuthorized = async (estateId, timestamp, ethAddress) => {
|
|
176
|
-
const estate = await getEstate(estateId.toString(), timestamp);
|
|
177
|
-
if (estate) {
|
|
178
|
-
return ((await hasAccessThroughFirstLevelAuthorities(estate, ethAddress)) ||
|
|
179
|
-
(await hasAccessThroughAuthorizations(estate.owners[0].address, ethAddress, timestamp)));
|
|
180
|
-
}
|
|
181
|
-
throw new Error(`Couldn\'t find the state ${estateId}`);
|
|
182
|
-
};
|
|
183
|
-
const isParcelUpdateAuthorized = async (x, y, timestamp, ethAddress, _externalCalls) => {
|
|
184
|
-
/* You get direct access if you were the:
|
|
185
|
-
* - owner
|
|
186
|
-
* - operator
|
|
187
|
-
* - update operator
|
|
188
|
-
* at that time
|
|
189
|
-
*/
|
|
190
|
-
const parcel = await getParcel(x, y, timestamp);
|
|
191
|
-
if (parcel) {
|
|
192
|
-
const belongsToEstate = parcel.estates != undefined && parcel.estates.length > 0 && parcel.estates[0].estateId != undefined;
|
|
193
|
-
return ((await hasAccessThroughFirstLevelAuthorities(parcel, ethAddress)) ||
|
|
194
|
-
(await hasAccessThroughAuthorizations(parcel.owners[0].address, ethAddress, timestamp)) ||
|
|
195
|
-
(belongsToEstate && (await isEstateUpdateAuthorized(parcel.estates[0].estateId, timestamp, ethAddress))));
|
|
196
|
-
}
|
|
197
|
-
throw new Error(`Parcel(${x},${y},${timestamp}) not found`);
|
|
198
|
-
};
|
|
199
|
-
const checkParcelAccess = async (x, y, timestamp, ethAddress, externalCalls) => {
|
|
200
|
-
try {
|
|
201
|
-
return await retry(() => isParcelUpdateAuthorized(x, y, timestamp, ethAddress, externalCalls), 5, '0.1s');
|
|
202
|
-
}
|
|
203
|
-
catch (error) {
|
|
204
|
-
logger.error(`Error checking parcel access (${x}, ${y}, ${timestamp}, ${ethAddress}).`);
|
|
205
|
-
throw error;
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
const SCENE_LOOKBACK_TIME = (0, ms_1.default)('5m');
|
|
15
|
+
validate: async ({ externalCalls, subGraphs, logs }, deployment) => {
|
|
209
16
|
const { entity } = deployment;
|
|
210
17
|
const { pointers, timestamp } = entity;
|
|
18
|
+
const logger = logs.getLogger('scenes-validator');
|
|
19
|
+
let block;
|
|
20
|
+
try {
|
|
21
|
+
// Check that the address has access (we check both the present and the 5 min into the past to avoid synchronization issues in the blockchain)
|
|
22
|
+
const blockInfo = await subGraphs.l1BlockSearch.findBlockForTimestamp(timestamp - SCENE_LOOKBACK_TIME);
|
|
23
|
+
if (blockInfo === undefined) {
|
|
24
|
+
return (0, types_1.fromErrors)('Deployment timestamp is invalid, no matching block found');
|
|
25
|
+
}
|
|
26
|
+
block = blockInfo.block;
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return (0, types_1.fromErrors)(`Deployment timestamp is invalid, no matching block found: ${err}`);
|
|
30
|
+
}
|
|
211
31
|
const ethAddress = externalCalls.ownerAddress(deployment.auditInfo);
|
|
212
32
|
const errors = [];
|
|
213
33
|
const lowerCasePointers = pointers.map((pointer) => pointer.toLowerCase());
|
|
34
|
+
const batch = [];
|
|
214
35
|
for (const pointer of lowerCasePointers) {
|
|
215
36
|
const pointerParts = pointer.split(',');
|
|
216
37
|
if (pointerParts.length === 2) {
|
|
217
38
|
const x = parseInt(pointerParts[0], 10);
|
|
218
39
|
const y = parseInt(pointerParts[1], 10);
|
|
219
|
-
|
|
220
|
-
// Check that the address has access (we check both the present and the 5 min into the past to avoid synchronization issues in the blockchain)
|
|
221
|
-
const hasAccess = (await checkParcelAccess(x, y, timestamp, ethAddress, externalCalls)) ||
|
|
222
|
-
(await checkParcelAccess(x, y, timestamp - SCENE_LOOKBACK_TIME, ethAddress, externalCalls));
|
|
223
|
-
if (!hasAccess) {
|
|
224
|
-
errors.push(`The provided Eth Address does not have access to the following parcel: (${x},${y})`);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
catch (e) {
|
|
228
|
-
errors.push(`The provided Eth Address does not have access to the following parcel: (${x},${y}). ${e}`);
|
|
229
|
-
}
|
|
40
|
+
batch.push([x, y]);
|
|
230
41
|
}
|
|
231
42
|
else {
|
|
232
43
|
errors.push(`Scene pointers should only contain two integers separated by a comma, for example (10,10) or (120,-45). Invalid pointer: ${pointer}`);
|
|
233
44
|
}
|
|
234
45
|
}
|
|
235
|
-
return (0, types_1.fromErrors)(...errors);
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
/** @internal */
|
|
239
|
-
async function retry(execution, attempts, waitTime = '1s', failedAttemptCallback) {
|
|
240
|
-
while (attempts > 0) {
|
|
241
46
|
try {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
if (attempts > 0) {
|
|
249
|
-
if (failedAttemptCallback) {
|
|
250
|
-
failedAttemptCallback(attempts);
|
|
47
|
+
const access = await subGraphs.L1.checker.checkLAND(ethAddress, batch, block);
|
|
48
|
+
for (let i = 0; i < batch.length; i++) {
|
|
49
|
+
const [x, y] = batch[i];
|
|
50
|
+
const hasAccess = access[i];
|
|
51
|
+
if (!hasAccess) {
|
|
52
|
+
errors.push(`The provided Eth Address does not have access to the following parcel: (${x},${y})`);
|
|
251
53
|
}
|
|
252
|
-
await new Promise((res) => setTimeout(res, (0, ms_1.default)(waitTime)));
|
|
253
|
-
}
|
|
254
|
-
else {
|
|
255
|
-
throw error;
|
|
256
54
|
}
|
|
257
55
|
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
logger.error(err);
|
|
58
|
+
return (0, types_1.fromErrors)(`Cannot validate deployment`);
|
|
59
|
+
}
|
|
60
|
+
return (0, types_1.fromErrors)(...errors);
|
|
258
61
|
}
|
|
259
|
-
|
|
260
|
-
}
|
|
62
|
+
};
|
|
261
63
|
//# sourceMappingURL=scenes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenes.js","sourceRoot":"","sources":["../../../src/validations/access-checker/scenes.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"scenes.js","sourceRoot":"","sources":["../../../src/validations/access-checker/scenes.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAmB;AACnB,uCAAoD;AAEpD,MAAM,mBAAmB,GAAG,IAAA,YAAE,EAAC,IAAI,CAAC,CAAA;AAEpC;;;GAGG;AACU,QAAA,MAAM,GAAe;IAChC,QAAQ,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,EAAE;QACjE,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;QAC7B,MAAM,EAAE,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A4H,OAAO,EAAE,CACtI,CAAA;aACF;SACF;QAED,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;YAC7E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACrC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;gBACvB,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;gBAC3B,IAAI,CAAC,SAAS,EAAE;oBACd,MAAM,CAAC,IAAI,CAAC,2EAA2E,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;iBAClG;aACF;SACF;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YACjB,OAAO,IAAA,kBAAU,EAAC,4BAA4B,CAAC,CAAA;SAChD;QAED,OAAO,IAAA,kBAAU,EAAC,GAAG,MAAM,CAAC,CAAA;IAC9B,CAAC;CACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/content-validator",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.3-20230116175244.commit-84aaedb",
|
|
4
4
|
"description": "Catalyst content validations",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"api-extractor": "yarn clean-api-extractor && api-extractor run --local --verbose --diagnostics --typescript-compiler-folder ./node_modules/typescript",
|
|
10
10
|
"api-extractor-ci": "yarn clean-api-extractor && api-extractor run --typescript-compiler-folder ./node_modules/typescript",
|
|
11
11
|
"build": "tsc -p tsconfig.json",
|
|
12
|
+
"build:watch": "tsc -p tsconfig.json --watch",
|
|
12
13
|
"lint:check": "eslint '**/*.{js,ts}'",
|
|
13
14
|
"lint:fix": "eslint '**/*.{js,ts}' --fix",
|
|
14
15
|
"test": "jest --runInBand --detectOpenHandles --colors --coverage",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"@typescript-eslint/eslint-plugin": "5.21.0",
|
|
41
42
|
"@typescript-eslint/parser": "5.21.0",
|
|
42
43
|
"@well-known-components/env-config-provider": "^1.1.1",
|
|
44
|
+
"@well-known-components/http-server": "^1.1.6",
|
|
43
45
|
"eslint": "8.14.0",
|
|
44
46
|
"eslint-config-prettier": "8.5.0",
|
|
45
47
|
"eslint-plugin-prettier": "4.0.0",
|
|
@@ -49,11 +51,14 @@
|
|
|
49
51
|
"typescript": "^4.7.3"
|
|
50
52
|
},
|
|
51
53
|
"dependencies": {
|
|
52
|
-
"@dcl/
|
|
54
|
+
"@dcl/block-indexer": "^1.0.0-20221223191317.commit-2d753e7",
|
|
55
|
+
"@dcl/content-hash-tree": "^1.1.4",
|
|
53
56
|
"@dcl/hashing": "1.1.3",
|
|
54
57
|
"@dcl/schemas": "^6.4.0",
|
|
55
58
|
"@dcl/urn-resolver": "2.0.3",
|
|
56
|
-
"@well-known-components/interfaces": "1.1.3",
|
|
59
|
+
"@well-known-components/interfaces": "^1.1.3",
|
|
60
|
+
"@well-known-components/logger": "^3.0.0",
|
|
61
|
+
"@well-known-components/metrics": "^2.0.1",
|
|
57
62
|
"@well-known-components/thegraph-component": "^1.2.0",
|
|
58
63
|
"ms": "2.1.3",
|
|
59
64
|
"sharp": "^0.30.6"
|
|
@@ -61,5 +66,5 @@
|
|
|
61
66
|
"files": [
|
|
62
67
|
"dist"
|
|
63
68
|
],
|
|
64
|
-
"commit": "
|
|
69
|
+
"commit": "84aaedbbbe78a0cbd0a600d1e4f0938209dff125"
|
|
65
70
|
}
|