Skip to content

Commit

Permalink
fix: remove check for untrusted schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Nebulis committed Mar 3, 2020
1 parent cf8d5b3 commit eefbf3d
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/wrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { isSchemaValidationError, wrapDocument, utils, getData } from "@govtechs
import path from "path";
import fetch from "node-fetch";
import Ajv from "ajv";
import secureSchema from "ajv/lib/refs/json-schema-secure.json";

class SchemaValidationError extends Error {
constructor(message: string, public validationErrors: Ajv.ErrorObject[], public document: any) {
Expand Down Expand Up @@ -143,10 +142,6 @@ export const merkleHashmap = (leafHashes: Buffer[]): Record<string, { sibling: s

const loadSchema = (schemaPath?: string): Promise<Schema | undefined> => {
const checkSchema = (schema: any): Schema => {
const isSchemaSecure = new Ajv().compile(secureSchema);
if (!isSchemaSecure(schema)) {
throw new Error("Untrustable schema, please check https://github.com/epoberezkin/ajv#untrusted-schemas");
}
if (!schema.$id) {
throw new Error("Invalid schema, you must provide an $id property to your schema");
}
Expand Down

0 comments on commit eefbf3d

Please sign in to comment.