Here is the context:
In the your custom policy build code use, the node js module aws-auth-policy The Nodejs part you can use ,
AuthPolicy.prototype.allowAllMethods = function () {
addMethod.call(this, "allow", "*", "*", null);
}
In the code
const AuthPolicy = require('aws-auth-policy');
const policy = new AuthPolicy(principalId, awsAccountId, apiOptions);
// policy.allowMethod(method, resource);
policy.allowAllMethods();
const authResponse = policy.build();