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:
14
test/unit/authorization/DenyAllAuthorizer.test.ts
Normal file
14
test/unit/authorization/DenyAllAuthorizer.test.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { DenyAllAuthorizer } from '../../../src/authorization/DenyAllAuthorizer';
|
||||
import { ForbiddenHttpError } from '../../../src/util/errors/ForbiddenHttpError';
|
||||
|
||||
describe('A DenyAllAuthorizer', (): void => {
|
||||
const authorizer = new DenyAllAuthorizer();
|
||||
|
||||
it('can handle all requests.', async(): Promise<void> => {
|
||||
await expect(authorizer.canHandle({} as any)).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
it('rejects all requests.', async(): Promise<void> => {
|
||||
await expect(authorizer.handle()).rejects.toThrow(ForbiddenHttpError);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user