mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Create DenyAllAuthorizer
This commit is contained in:
11
src/authorization/DenyAllAuthorizer.ts
Normal file
11
src/authorization/DenyAllAuthorizer.ts
Normal 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();
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ export * from './authorization/AllowAllAuthorizer';
|
||||
export * from './authorization/Authorization';
|
||||
export * from './authorization/Authorizer';
|
||||
export * from './authorization/AuxiliaryAuthorizer';
|
||||
export * from './authorization/DenyAllAuthorizer';
|
||||
export * from './authorization/WebAclAuthorization';
|
||||
export * from './authorization/WebAclAuthorizer';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user