CommunitySolidServer/test/unit/authentication/PublicCredentialsExtractor.test.ts
Joachim Van Herwegen 13c49045d4 feat: Support acl authorization for IDP components
Configuration has been updated so the IDP requests
also pass through an Authorization component.
A new config option was added to choose
which authorization scheme to use for the IDP.
2021-10-07 15:51:11 +02:00

14 lines
601 B
TypeScript

import { CredentialGroup } from '../../../src/authentication/Credentials';
import { PublicCredentialsExtractor } from '../../../src/authentication/PublicCredentialsExtractor';
import type { HttpRequest } from '../../../src/server/HttpRequest';
describe('A PublicCredentialsExtractor', (): void => {
const extractor = new PublicCredentialsExtractor();
it('returns the empty credentials.', async(): Promise<void> => {
const headers = {};
const result = extractor.handleSafe({ headers } as HttpRequest);
await expect(result).resolves.toEqual({ [CredentialGroup.public]: {}});
});
});