44 Commits

Author SHA1 Message Date
Joachim Van Herwegen
784bfc8c21 chore: Update configs to v4.0.0 2022-04-19 15:13:55 +02:00
wkerckho
d42125a91d
fix: Throw error when accessing URLs out of scope
* feat: allow OriginalUrlExtractor to be configured with an identifierStrategy. Included the existing parameter 'includeQueryString' in the OriginalUrlExtractorArgs type.

* test: fixed OriginalUrlExtractor instantiation in OriginalUrlExtractor and RequestParser tests

* fix: Server no longer warns when accessing a URL out of scope #1148

* test: updated tests broken by #1148 fix

* test: ensuring 100% coverage

Co-authored-by: Wannes Kerckhove <wannes.kerckhove@ugent.be>
2022-04-08 09:33:22 +02:00
Joachim Van Herwegen
97e600bf4f fix: Undo authorization on OPTIONS requests 2022-04-04 13:35:15 +02:00
Thomas Dupont
48efc6fae1
feat: Create MetadataParser that detects JSON with Context link and throws an error
* feat: add PlainJsonLdFilter to reject JSON with context link

* refactor: abstract parseLinkHeader into HeaderUtils

* docs: typo in comment field

Co-authored-by: Ruben Verborgh <ruben@verborgh.org>

* refactor: Replace BadRequestHttpError with NotImplementedError

Co-authored-by: Ruben Verborgh <ruben@verborgh.org>

* refactor: incorporate requested changes

* refactor: requested changes incorporated

* refactor: remove obsolete code lines

Co-authored-by: Ruben Verborgh <ruben@verborgh.org>
2022-04-01 14:25:09 +02:00
Joachim Van Herwegen
6e98c6aae4 feat: Dynamically generate Allow and Accept-* headers 2022-03-29 14:52:36 +02:00
Joachim Van Herwegen
ad3edcf1a8 feat: Handle OPTIONS requests in OperationHandler 2022-03-18 14:15:12 +01:00
Joachim Van Herwegen
e86e0cf36b feat: Return 404 for read/delete requests if there is no resource 2022-03-18 14:15:12 +01:00
Joachim Van Herwegen
9a29cc2257 fix: Extract correct access modes from request 2022-03-18 14:15:12 +01:00
Joachim Van Herwegen
b292cd2e2b chore: Update configs to v3.0.0 2022-02-23 11:09:41 +01:00
Thomas Dupont
ce754c119f
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
2022-02-15 13:44:03 +01:00
Joachim Van Herwegen
a9941ebe78 feat: Add support for N3 Patch 2022-01-25 11:30:42 +01:00
Joachim Van Herwegen
1afed65368 feat: Return correct status codes for invalid requests 2022-01-21 17:10:38 +01:00
Arthur Joppart
0cb4d7b161
feat: Add support for quota limits
* feat: implemented SizeReporter and FileSizeReporter

* test: FileSizeReporter tests

* feat: added QuotedDataAccessor

* test: added extra test to check recursiveness of filesizereporter

* feat: added QuotaStrategy interface

* feat: further progress in different files

* feat: wrote doc, tests and improved code

* feat: fixed bugs and code is now runnable and buildable

* feat: finished implementation

* fix: revert accidental chanegs

* fix: fileSizeReported did not count container size

* fix: bug calculating container sizes fixed

* test: FileSizeReporter tests

* test: QuotaDataValidator tests

* test: QuotaError tests

* fix: removed console.log

* doc: added doc to several files

* doc: changed doc for QuotaStrategy to new implementation

* fix: improved content length regex

* feat: improved GlobalQuotaStrategy code

* fix: made FileSizeReported readonly

* feat: added comments to quota-file.json

* fix: changed default tempFilePath variable

* test: included new tempFilePath variable in testing

* chore: created seperate command for start:file:quota to pass tests

* feat: removed all sync fs calls from FileSizeReporter

* feat: minor changes in multple files

* fix: changed function signatures to be in line with others

* feat: optimized quota data validation

* feat: improved FileSizeReporter code

* fix: corrected calculation of containersizes and fixed erroring edgecase

* feat: save content-length as number in metadata

* feat: added comments and changed GlobalQuotaStrategy constructor

* feat: changed file names and added small comment

* test: AtomicFileDataAccessor tests

* test: completed FileSizeReporter tests

* fix: content-length is now saved correctly in RepresentationMetadata

* feat: adapted content length metadata + tests

* fix: removed tempFilePath variable

* fix: reverted .gitignore

* fix: forgot to remove tempFilePath variable from componentsjs config

* test: GlobalQuotaStrategy tests

* feat: replaced DataValidator with Validator

* feat: reworked DataValidator

* feat: added calcultateChunkSize() to SizeReporter

* test: updated FileSizeReporter tests

* fix: tempFile location now relative to rootFilePath

* test: QuotaDataValidator tests

* fix: corrected FileSizeReporter tests

* fix: adapted FileSizeReporter tests

* fix: FileSizeReporter bug on Windows

* fix: regex linting error

* feat: changed Validator class

* feat: added PodQuotaStrategy to enable suota on a per pod basis

* chore: bump context versions

* fix: Capitalized comments in json file

* chore: renamed ValidatorArgs to ValidatorInput

* chore: order all exports

* fix: made TODO comment clearer

* chore: added seperated config files for global and pod based quota + fixed comments

* chore: made minor changes to comments

* feat: added PassthroughDataAccessor

* feat: added PasstroughtDataAccessor + tests

* fix: added invalid header check to ContentLengthParser

* chore: improved mocks

* chore: move quota limit higher up in config

* fix: atomicity issue in AtomicFileDataAccessor

* chore: moved .internal folder to config from FileSizeReporter

* fix: improved algorithm to ignore folders while calculating file size in FileSizeReporter

* fix: changes to support containers in the future

* fix: added error handling to prevent reading of unexistent files

* feat: added generic type to SizeReporter to calculate chunk sizes

* test: use mocked DataAccessor

* chore: added some comments to test and made minor improvement

* fix: fs mock rename

* chore: QuotaStrategy.estimateSize refactor

* chore: move trackAvailableSpace to abstract class QuotaStrategy

* fix: improved test case

* test: quota integration tests

* chore: edited some comments

* chore: change lstat to stat

* feat: moved estimateSize to SizeReporter to be consistent with calcultateChunkSize

* test: finish up tests to reach coverage

* fix: basic config

* fix: minor changes to test CI run

* fix: small fix for windows

* fix: improved writing to file

* chore: linting errors

* chore: rename trackAvailableSpace

* test: improved integration tests

* test: logging info for test debugging

* test: extra logging for debugging

* test: logging for debugging

* test: logging for debugging

* test: logging for debugging

* test: improved Quota integration test setup

* test: improve quota tests for CI run

* test: debugging Quota test

* test: uncommented global quota test

* test: changed global quota parameters

* test: logging for debugging

* test: logging cleanup

* chore: minor changes, mostly typo fixes

* chore: remove console.log

* fix: getting inconsistent results

* chore: try fix index.ts CI error

* chore: try fix CI error

* chore: try fix CI error

* chore: revert last commits

* chore: fix inconsistent files with origin

* test: minor test improvements

* chore: minor refactors and improvements

* fix: added extra try catch for breaking bug

* chore: improve config

* chore: minor code improvements

* test: use mockFs

* feat: add extra check in podQuotaStrategy

* chore: replace handle by handleSafe in ValidatingDataAccessor

* chore: typo

* test: improved Quota integration tests

* test: made comment in test more correct

* fix: rm -> rmdir for backwards compatibility

* fix: fsPromises issue

* chore: leave out irrelevant config

* chore: removed start script from package.json

* fix: Small fixes

Co-authored-by: Joachim Van Herwegen <joachimvh@gmail.com>
2022-01-21 10:49:05 +01:00
Joachim Van Herwegen
7163a0317b feat: Support redirection through errors 2021-12-09 14:10:42 +01:00
Ruben Verborgh
8c9887feea fix: Do not serve UI on special pages.
Fixes https://github.com/solid/community-server/issues/1034
2021-11-02 15:07:22 +01:00
Ruben Verborgh
6d985a65d0 chore: Update configs to v2.0.0. 2021-10-15 10:50:32 +02:00
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
Joachim Van Herwegen
bb7e88b137 refactor: Split HttpHandler behaviour over multiple classes
This allows easier reuse of certain reoccurring behaviours,
such as authorization.
The AuthenticatedLdpHandler is no longer required
since it is a combination of parsing and authorization.
This did require a small change to the OperationHandler interface.
2021-10-07 15:51:11 +02:00
Joachim Van Herwegen
8f5d61911d feat: Always grant control permissions to pod owners 2021-10-05 13:19:01 +02:00
Joachim Van Herwegen
7f8b923399 feat: Replace acl specific permissions with generic permissions
This required AuxiliaryStrategy to have a new function
indicating if the auxiliary resource just used its associated resource authorization
or its own.
2021-09-28 13:06:38 +02:00
Joachim Van Herwegen
5104cd56e8 feat: Create OperationMetadataCollector to handle operation metadata 2021-09-28 13:06:38 +02:00
Joachim Van Herwegen
bf28c83ffa feat: Use PermissionReaders to determine available permissions
These readers will determine which permissions
are available for the incoming credentials.
Their results then get combined in a UnionReader
and authorized in a PermissionBasedAuthorizer
2021-09-28 13:06:38 +02:00
Joachim Van Herwegen
e8dedf5c23 feat: Extract set of required modes instead of PermissionSet 2021-09-28 13:06:38 +02:00
Joachim Van Herwegen
ba1886ab85 feat: Combine the results of multiple CredentialsExtractors 2021-09-28 13:06:38 +02:00
Joachim Van Herwegen
fb0b50c997 fix: Make the RouterHandler more robust
It now extracts paths based on the base URL
and allows catching all methods.
2021-09-27 10:32:34 +02:00
Ruben Verborgh
60fc273ea5 change: Rename resourceStore to aclStore. 2021-09-07 12:43:05 +02:00
Arthur Joppart
759112bc04
feat: Support LDN inbox headers
* chore: add inbox mapping to metadatawriter config

* fix: correct inbox link rel

* feat: make LinkTypeParser reuseable to fit all link headers

* feat: minor code optimization

* feat: cleaned up metadata parser config

* feat: further cleanup of metadata parser config

* feat: adapted LinkMetadataParser to take a list to be in line with LinkRelMetadataWriter implementation

* feat: minor changes to be in line with other classes and code improvements

Co-authored-by: Wouter Termont <woutermont@gmail.com>
2021-08-25 12:48:13 +02:00
Joachim Van Herwegen
ff200e22a9 feat: Add a cache to the AgentGroupAccessChecker 2021-08-23 16:39:25 +02:00
Simone Persiani
401923b792 feat: Add support for agentGroup ACL rules
Co-Authored-By: Ludovico Granata <Ludogranata@gmail.com>
2021-08-23 16:39:25 +02:00
Simone Persiani
16ebfb329f refactor: Refactor WebAclAuthorizer
Co-Authored-By: Ludovico Granata <Ludogranata@gmail.com>
2021-08-23 16:39:25 +02:00
Joachim Van Herwegen
20f783a581 feat: Create conditions based on input headers 2021-08-18 13:16:08 +02:00
Joachim Van Herwegen
77d695c8b6 feat: Expose Last-Modified and ETag headers 2021-08-18 13:16:08 +02:00
Joachim Van Herwegen
7b94b71e7e feat: Prevent access to internal storage containers 2021-07-27 14:31:02 +02:00
Joachim Van Herwegen
dee382849d refactor: Rename AllowEverythingAuthorizer to AllowAllAuthorizer 2021-07-27 14:31:02 +02:00
Joachim Van Herwegen
bd10256e59 fix: Make sure there is always a fallback for error handling 2021-07-23 14:48:27 +02:00
Joachim Van Herwegen
c2ad892020 feat: Create RootInitializer to set up root resources 2021-07-22 15:08:28 +02:00
Ruben Verborgh
6495d650c2 chore: Use consistent strategy naming. 2021-07-21 23:37:23 +02:00
Ruben Verborgh
d01382d36e Release version 1.0.0-beta.0 of the npm package. 2021-06-29 17:43:44 +01:00
Ruben Taelman
a6371b0735 Expose constant Allow header 2021-06-09 09:50:01 +02:00
Joachim Van Herwegen
e3c5b39752 feat: Create WWW-Authenticate metadata writer 2021-06-07 14:40:05 +02:00
Joachim Van Herwegen
57d77e941d feat: Integrate ErrorHandler and remove ResponseWriter error support 2021-06-07 13:54:38 +02:00
Joachim Van Herwegen
e1f95877da feat: Create ErrorHandler to convert errors to Representations 2021-06-07 13:54:38 +02:00
Joachim Van Herwegen
6214e0c537 feat: Introduce debugging OwnershipValidator 2021-06-01 15:38:55 +02:00
Joachim Van Herwegen
452032e312 feat: Split preset configurations by feature 2021-05-19 09:40:40 +02:00