feat: Create DenyAllAuthorizer

This commit is contained in:
Joachim Van Herwegen
2021-07-27 10:20:32 +02:00
parent dee382849d
commit d95db60fe1
3 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import { ForbiddenHttpError } from '../util/errors/ForbiddenHttpError';
import { Authorizer } from './Authorizer';
/**
* An authorizer that rejects all requests.
*/
export class DenyAllAuthorizer extends Authorizer {
public async handle(): Promise<never> {
throw new ForbiddenHttpError();
}
}