mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Add content-negotiation when fetching dataset from url
* Solution works but tests don't * refactor(FetchUtil): use arrayifyStream * refactor(FetchUtil): split fetchDataset into 2 separate functions * style(FetchUtil): onelining instead of declaring new local var * test: trying to mock rdfDereferencer * refactor: promise can't have async function as arg * test(FetchUtil): pass Quad array to mockDereference instead * test: all tests should pass now and coverage is back to 100% * style: comment typo * chore: make package.json and package-lock.json compatible with main * chore: fix package.json double entries * chore: updated package.json to be alfabetical again * refactor(AgentGroupAccessChecker): Remove converter from contructor and config * refactor(TokenOwnerShipValidator): Remove converter from constructor and config * refactor(FetchUtil): Return BadRequestHttpError instead of generic Error * test(FetchUtil): return Response object instead of mocking fetch * style: typos and newlines
This commit is contained in:
@@ -3,7 +3,6 @@ import type { AccessCheckerArgs } from '../../../../src/authorization/access/Acc
|
||||
import { AgentGroupAccessChecker } from '../../../../src/authorization/access/AgentGroupAccessChecker';
|
||||
import { BasicRepresentation } from '../../../../src/http/representation/BasicRepresentation';
|
||||
import type { Representation } from '../../../../src/http/representation/Representation';
|
||||
import type { RepresentationConverter } from '../../../../src/storage/conversion/RepresentationConverter';
|
||||
import type { ExpiringStorage } from '../../../../src/storage/keyvalue/ExpiringStorage';
|
||||
import { INTERNAL_QUADS } from '../../../../src/util/ContentTypes';
|
||||
import * as fetchUtil from '../../../../src/util/FetchUtil';
|
||||
@@ -18,7 +17,6 @@ describe('An AgentGroupAccessChecker', (): void => {
|
||||
acl.addQuad(namedNode('noMatch'), ACL.terms.agentGroup, namedNode('badGroup'));
|
||||
let fetchMock: jest.SpyInstance;
|
||||
let representation: Representation;
|
||||
const converter: RepresentationConverter = {} as any;
|
||||
let cache: ExpiringStorage<string, Promise<Store>>;
|
||||
let checker: AgentGroupAccessChecker;
|
||||
|
||||
@@ -31,7 +29,7 @@ describe('An AgentGroupAccessChecker', (): void => {
|
||||
|
||||
cache = new Map() as any;
|
||||
|
||||
checker = new AgentGroupAccessChecker(converter, cache);
|
||||
checker = new AgentGroupAccessChecker(cache);
|
||||
});
|
||||
|
||||
it('can handle all requests.', async(): Promise<void> => {
|
||||
|
||||
Reference in New Issue
Block a user