fastify-openapi-glue
Version:
generate a fastify configuration from an openapi specification
18 lines (14 loc) • 339 B
JavaScript
class Security {
async goodAuthCheck() {
// Do nothing--auth check succeeds!
}
async failingAuthCheck() {
throw "API key was invalid or not found";
}
async failingAuthCheckCustomStatusCode() {
const err = new Error("API key was invalid or not found");
err.statusCode = 451;
throw err;
}
}
export default new Security();