build()

in backend/Functions/WebSockets/auth/app.js [388:403]


    build() {
      if ((!this.allowMethods || this.allowMethods.length === 0)
          && (!this.denyMethods || this.denyMethods.length === 0)) {
        throw new Error('No statements defined for the policy');
      }

      const policy = {};
      policy.principalId = this.principalId;
      const doc = {};
      doc.Version = this.version;
      doc.Statement = [];
      doc.Statement = doc.Statement.concat(getStatementsForEffect.call(this, 'Allow', this.allowMethods));
      doc.Statement = doc.Statement.concat(getStatementsForEffect.call(this, 'Deny', this.denyMethods));
      policy.policyDocument = doc;
      return policy;
    },