From ad7f4ed134ea387352806c992713caad6039d0ca Mon Sep 17 00:00:00 2001 From: Joachim Van Herwegen Date: Thu, 15 Jul 2021 14:41:58 +0200 Subject: [PATCH] feat: Split ResourceStore config into 2 parts --- config/default.json | 3 +- config/dynamic.json | 3 +- config/example-https-file.json | 3 +- config/file.json | 3 +- config/memory-subdomains.json | 3 +- config/path-routing.json | 3 +- config/sparql-endpoint.json | 3 +- config/storage/README.md | 25 ++++++----- .../data-accessors/file.json | 0 .../data-accessors/memory.json | 0 .../data-accessors/sparql-endpoint.json | 0 config/storage/backend/dynamic.json | 25 +++++++++++ config/storage/backend/file.json | 16 +++++++ .../memory.json} | 10 +++-- .../{resource-store => backend}/regex.json | 30 +++---------- config/storage/backend/sparql.json | 22 ++++++++++ config/storage/middleware/default.json | 32 ++++++++++++++ .../stores/converting.json | 0 .../stores/locking.json | 0 .../stores/monitoring.json | 0 .../stores/patching.json | 0 config/storage/resource-store/dynamic.json | 42 ------------------- config/storage/resource-store/file.json | 35 ---------------- config/storage/resource-store/memory.json | 36 ---------------- config/storage/resource-store/sparql.json | 40 ------------------ .../resource-store/stores/routing.json | 11 ----- test/integration/LdpHandlerWithAuth.test.ts | 4 +- .../integration/LdpHandlerWithoutAuth.test.ts | 4 +- test/integration/SparqlStorage.test.ts | 2 +- test/integration/Subdomains.test.ts | 4 +- test/integration/config/ldp-with-auth.json | 1 + test/integration/config/run-with-redlock.json | 3 +- .../config/server-dynamic-unsafe.json | 3 +- test/integration/config/server-memory.json | 3 +- .../config/server-subdomains-unsafe.json | 1 + .../config/server-without-auth.json | 3 +- 36 files changed, 153 insertions(+), 220 deletions(-) rename config/storage/{resource-store => backend}/data-accessors/file.json (100%) rename config/storage/{resource-store => backend}/data-accessors/memory.json (100%) rename config/storage/{resource-store => backend}/data-accessors/sparql-endpoint.json (100%) create mode 100644 config/storage/backend/dynamic.json create mode 100644 config/storage/backend/file.json rename config/storage/{resource-store/stores/data-accessor.json => backend/memory.json} (53%) rename config/storage/{resource-store => backend}/regex.json (67%) create mode 100644 config/storage/backend/sparql.json create mode 100644 config/storage/middleware/default.json rename config/storage/{resource-store => middleware}/stores/converting.json (100%) rename config/storage/{resource-store => middleware}/stores/locking.json (100%) rename config/storage/{resource-store => middleware}/stores/monitoring.json (100%) rename config/storage/{resource-store => middleware}/stores/patching.json (100%) delete mode 100644 config/storage/resource-store/dynamic.json delete mode 100644 config/storage/resource-store/file.json delete mode 100644 config/storage/resource-store/memory.json delete mode 100644 config/storage/resource-store/sparql.json delete mode 100644 config/storage/resource-store/stores/routing.json diff --git a/config/default.json b/config/default.json index 2c1830d3a..cfe4bd369 100644 --- a/config/default.json +++ b/config/default.json @@ -17,8 +17,9 @@ "files-scs:config/ldp/metadata-parser/default.json", "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", + "files-scs:config/storage/backend/memory.json", "files-scs:config/storage/key-value/memory.json", - "files-scs:config/storage/resource-store/memory.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/suffix.json", "files-scs:config/util/index/default.json", diff --git a/config/dynamic.json b/config/dynamic.json index b471355d6..21dbabb24 100644 --- a/config/dynamic.json +++ b/config/dynamic.json @@ -17,8 +17,9 @@ "files-scs:config/ldp/metadata-parser/default.json", "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", + "files-scs:config/storage/backend/dynamic.json", "files-scs:config/storage/key-value/memory.json", - "files-scs:config/storage/resource-store/dynamic.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/suffix.json", "files-scs:config/util/index/default.json", diff --git a/config/example-https-file.json b/config/example-https-file.json index 9e003eedc..f5e510def 100644 --- a/config/example-https-file.json +++ b/config/example-https-file.json @@ -17,8 +17,9 @@ "files-scs:config/ldp/metadata-parser/default.json", "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", + "files-scs:config/storage/backend/file.json", "files-scs:config/storage/key-value/memory.json", - "files-scs:config/storage/resource-store/file.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/suffix.json", "files-scs:config/util/index/default.json", diff --git a/config/file.json b/config/file.json index c045f0189..262a8fd96 100644 --- a/config/file.json +++ b/config/file.json @@ -17,8 +17,9 @@ "files-scs:config/ldp/metadata-parser/default.json", "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", + "files-scs:config/storage/backend/file.json", "files-scs:config/storage/key-value/memory.json", - "files-scs:config/storage/resource-store/file.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/suffix.json", "files-scs:config/util/index/default.json", diff --git a/config/memory-subdomains.json b/config/memory-subdomains.json index 628f7478a..0b167817a 100644 --- a/config/memory-subdomains.json +++ b/config/memory-subdomains.json @@ -17,8 +17,9 @@ "files-scs:config/ldp/metadata-parser/default.json", "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", + "files-scs:config/storage/backend/memory.json", "files-scs:config/storage/key-value/memory.json", - "files-scs:config/storage/resource-store/memory.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/subdomain.json", "files-scs:config/util/index/default.json", diff --git a/config/path-routing.json b/config/path-routing.json index 0db53d5af..231a5647f 100644 --- a/config/path-routing.json +++ b/config/path-routing.json @@ -17,8 +17,9 @@ "files-scs:config/ldp/metadata-parser/default.json", "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", + "files-scs:config/storage/backend/regex.json", "files-scs:config/storage/key-value/memory.json", - "files-scs:config/storage/resource-store/regex.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/suffix.json", "files-scs:config/util/index/default.json", diff --git a/config/sparql-endpoint.json b/config/sparql-endpoint.json index f3fc0ca0b..af2fb38f6 100644 --- a/config/sparql-endpoint.json +++ b/config/sparql-endpoint.json @@ -17,8 +17,9 @@ "files-scs:config/ldp/metadata-parser/default.json", "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", + "files-scs:config/storage/backend/sparql.json", "files-scs:config/storage/key-value/memory.json", - "files-scs:config/storage/resource-store/sparql.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/suffix.json", "files-scs:config/util/index/default.json", diff --git a/config/storage/README.md b/config/storage/README.md index 2b33a8f53..52e679bfb 100644 --- a/config/storage/README.md +++ b/config/storage/README.md @@ -1,19 +1,22 @@ # Storage Options related to how data and resources are stored. +## Backend +The final part of the ResourceStore chain that handles data access. +* *dynamic*: The routing store used here is needed when using dynamic pod creation. +* *file*: Default setup with a file backend. +* *memory*: Default setup with a memory backend. +* *regex*: Uses a different backend based on the container that is being used. +* *sparql*: Default setup with a SPARQL endpoint backend. + Also updates the converting store so all incoming data is transformed into quads. + ## Key-Value Used by certain classes for internal storage. * *memory*: Store everything in memory. * *resource-store*: Store everything in a specific container in the resource store. -## Resource-Store -The chain of ResourceStores that needs to be passed through before reaching the actual data. -There is much variety possible here so chances are higher that a custom solution is needed here. -Most configs here have the same default setup (Monitoring -> Locking -> Patching -> Converting) -and only differ at the tail. -* *dynamic*: The routing store used at the tail here is needed when using dynamic pod creation. -* *file*: Default setup with a file backend. -* *memory*: Default setup with a memory backend. -* *regex*: Uses a different backend based on the container that is being used. -* *sparql*: Default setup with a SPARQL endpoint backend. - Also updates the converting store so all incoming data is transformed into quads. +## Middleware +The chain of utility ResourceStores that needs to be passed through before reaching the backend stores. +The final store in this chain takes the store from the stores/backend config as source. +* *default*: Chains all the utility stores: + Monitoring -> IndexRepresentation -> Locking -> Patching -> Converting diff --git a/config/storage/resource-store/data-accessors/file.json b/config/storage/backend/data-accessors/file.json similarity index 100% rename from config/storage/resource-store/data-accessors/file.json rename to config/storage/backend/data-accessors/file.json diff --git a/config/storage/resource-store/data-accessors/memory.json b/config/storage/backend/data-accessors/memory.json similarity index 100% rename from config/storage/resource-store/data-accessors/memory.json rename to config/storage/backend/data-accessors/memory.json diff --git a/config/storage/resource-store/data-accessors/sparql-endpoint.json b/config/storage/backend/data-accessors/sparql-endpoint.json similarity index 100% rename from config/storage/resource-store/data-accessors/sparql-endpoint.json rename to config/storage/backend/data-accessors/sparql-endpoint.json diff --git a/config/storage/backend/dynamic.json b/config/storage/backend/dynamic.json new file mode 100644 index 000000000..4d4530d5a --- /dev/null +++ b/config/storage/backend/dynamic.json @@ -0,0 +1,25 @@ +{ + "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", + "import": [ + "files-scs:config/storage/backend/data-accessors/file.json" + ], + "@graph": [ + { + "comment": "Setup when using dynamic pods. A router rule will be defined when activating dynamic pods.", + "@id": "urn:solid-server:default:ResourceStore_Backend", + "@type": "RoutingResourceStore", + "rule": { "@id": "urn:solid-server:default:RouterRule" } + }, + { + "comment": "Which store to use for requests that do not match any pod, e.g. for storage.", + "@id": "urn:solid-server:default:RouterRule", + "BaseUrlRouterRule:_baseStore": { + "@id": "urn:solid-server:default:ResourceStore_DataAccessor", + "@type": "DataAccessorBasedStore", + "identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" }, + "auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" }, + "accessor": { "@id": "urn:solid-server:default:FileDataAccessor" } + } + } + ] +} diff --git a/config/storage/backend/file.json b/config/storage/backend/file.json new file mode 100644 index 000000000..8c258121a --- /dev/null +++ b/config/storage/backend/file.json @@ -0,0 +1,16 @@ +{ + "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", + "import": [ + "files-scs:config/storage/backend/data-accessors/file.json" + ], + "@graph": [ + { + "comment": "A default store setup with a file system backend.", + "@id": "urn:solid-server:default:ResourceStore_Backend", + "@type": "DataAccessorBasedStore", + "identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" }, + "auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" }, + "accessor": { "@id": "urn:solid-server:default:FileDataAccessor" } + } + ] +} diff --git a/config/storage/resource-store/stores/data-accessor.json b/config/storage/backend/memory.json similarity index 53% rename from config/storage/resource-store/stores/data-accessor.json rename to config/storage/backend/memory.json index f489e4c3d..57fd2a0a8 100644 --- a/config/storage/resource-store/stores/data-accessor.json +++ b/config/storage/backend/memory.json @@ -1,12 +1,16 @@ { "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", + "import": [ + "files-scs:config/storage/backend/data-accessors/memory.json" + ], "@graph": [ { - "comment": "Supports default Solid behaviour on any kind of data accessor.", - "@id": "urn:solid-server:default:ResourceStore_DataAccessor", + "comment": "A default store setup with a memory backend.", + "@id": "urn:solid-server:default:ResourceStore_Backend", "@type": "DataAccessorBasedStore", "identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" }, - "auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" } + "auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" }, + "accessor": { "@id": "urn:solid-server:default:MemoryDataAccessor" } } ] } diff --git a/config/storage/resource-store/regex.json b/config/storage/backend/regex.json similarity index 67% rename from config/storage/resource-store/regex.json rename to config/storage/backend/regex.json index 19290ac19..09dc72e24 100644 --- a/config/storage/resource-store/regex.json +++ b/config/storage/backend/regex.json @@ -1,34 +1,16 @@ { "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", "import": [ - "files-scs:config/storage/resource-store/data-accessors/file.json", - "files-scs:config/storage/resource-store/data-accessors/memory.json", - "files-scs:config/storage/resource-store/data-accessors/sparql-endpoint.json", - "files-scs:config/storage/resource-store/stores/converting.json", - "files-scs:config/storage/resource-store/stores/locking.json", - "files-scs:config/storage/resource-store/stores/patching.json", - "files-scs:config/storage/resource-store/stores/routing.json" + "files-scs:config/storage/backend/data-accessors/file.json", + "files-scs:config/storage/backend/data-accessors/memory.json", + "files-scs:config/storage/backend/data-accessors/sparql-endpoint.json" ], "@graph": [ { "comment": "A more complex example with 3 different stores being routed to.", - "@id": "urn:solid-server:default:ResourceStore", - "@type": "MonitoringStore", - "MonitoringStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Index", - "IndexRepresentationStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Locking", - "LockingResourceStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Patching", - "PatchingStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Converting", - "RepresentationConvertingStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Routing" - } - } - } - } - } + "@id": "urn:solid-server:default:ResourceStore_Backend", + "@type": "RoutingResourceStore", + "rule": { "@id": "urn:solid-server:default:RouterRule" } }, { diff --git a/config/storage/backend/sparql.json b/config/storage/backend/sparql.json new file mode 100644 index 000000000..f6013223b --- /dev/null +++ b/config/storage/backend/sparql.json @@ -0,0 +1,22 @@ +{ + "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", + "import": [ + "files-scs:config/storage/backend/data-accessors/sparql-endpoint.json" + ], + "@graph": [ + { + "comment": "A default store setup with a memory backend.", + "@id": "urn:solid-server:default:ResourceStore_Backend", + "@type": "DataAccessorBasedStore", + "identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" }, + "auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" }, + "accessor": { "@id": "urn:solid-server:default:SparqlDataAccessor" } + }, + { + "comment": "This makes it so all incoming data is converted to quad objects.", + "@id": "urn:solid-server:default:ResourceStore_Converting", + "RepresentationConvertingStore:_options_inConverter": { "@id": "urn:solid-server:default:RepresentationConverter" }, + "RepresentationConvertingStore:_options_inType": "internal/quads" + } + ] +} diff --git a/config/storage/middleware/default.json b/config/storage/middleware/default.json new file mode 100644 index 000000000..702246f94 --- /dev/null +++ b/config/storage/middleware/default.json @@ -0,0 +1,32 @@ +{ + "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", + "import": [ + "files-scs:config/storage/middleware/stores/converting.json", + "files-scs:config/storage/middleware/stores/locking.json", + "files-scs:config/storage/middleware/stores/patching.json" + ], + "@graph": [ + { + "comment": "Sets up a stack of utility stores used by most instances.", + "@id": "urn:solid-server:default:ResourceStore", + "@type": "MonitoringStore", + "MonitoringStore:_source": { "@id": "urn:solid-server:default:ResourceStore_Index" } + }, + { + "@id": "urn:solid-server:default:ResourceStore_Index", + "IndexRepresentationStore:_source": { "@id": "urn:solid-server:default:ResourceStore_Locking" } + }, + { + "@id": "urn:solid-server:default:ResourceStore_Locking", + "LockingResourceStore:_source": { "@id": "urn:solid-server:default:ResourceStore_Patching" } + }, + { + "@id": "urn:solid-server:default:ResourceStore_Patching", + "PatchingStore:_source": { "@id": "urn:solid-server:default:ResourceStore_Converting" } + }, + { + "@id": "urn:solid-server:default:ResourceStore_Converting", + "RepresentationConvertingStore:_source": { "@id": "urn:solid-server:default:ResourceStore_Backend" } + } + ] +} diff --git a/config/storage/resource-store/stores/converting.json b/config/storage/middleware/stores/converting.json similarity index 100% rename from config/storage/resource-store/stores/converting.json rename to config/storage/middleware/stores/converting.json diff --git a/config/storage/resource-store/stores/locking.json b/config/storage/middleware/stores/locking.json similarity index 100% rename from config/storage/resource-store/stores/locking.json rename to config/storage/middleware/stores/locking.json diff --git a/config/storage/resource-store/stores/monitoring.json b/config/storage/middleware/stores/monitoring.json similarity index 100% rename from config/storage/resource-store/stores/monitoring.json rename to config/storage/middleware/stores/monitoring.json diff --git a/config/storage/resource-store/stores/patching.json b/config/storage/middleware/stores/patching.json similarity index 100% rename from config/storage/resource-store/stores/patching.json rename to config/storage/middleware/stores/patching.json diff --git a/config/storage/resource-store/dynamic.json b/config/storage/resource-store/dynamic.json deleted file mode 100644 index f36570e2e..000000000 --- a/config/storage/resource-store/dynamic.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", - "import": [ - "files-scs:config/storage/resource-store/data-accessors/file.json", - "files-scs:config/storage/resource-store/stores/converting.json", - "files-scs:config/storage/resource-store/stores/data-accessor.json", - "files-scs:config/storage/resource-store/stores/locking.json", - "files-scs:config/storage/resource-store/stores/patching.json", - "files-scs:config/storage/resource-store/stores/routing.json" - ], - "@graph": [ - { - "comment": "Setup when using dynamic pods.", - "@id": "urn:solid-server:default:ResourceStore", - "@type": "MonitoringStore", - "MonitoringStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Index", - "IndexRepresentationStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Locking", - "LockingResourceStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Patching", - "PatchingStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Converting", - "RepresentationConvertingStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Routing", - "comment": "A router rule will be defined when activating dynamic pods." - } - } - } - } - } - }, - { - "comment": "Which store to use for requests that do not match any pod, e.g. for storage.", - "@id": "urn:solid-server:default:RouterRule", - "BaseUrlRouterRule:_baseStore": { - "@id": "urn:solid-server:default:ResourceStore_DataAccessor", - "DataAccessorBasedStore:_accessor": { "@id": "urn:solid-server:default:FileDataAccessor" } - } - } - ] -} diff --git a/config/storage/resource-store/file.json b/config/storage/resource-store/file.json deleted file mode 100644 index 2cfcce1a0..000000000 --- a/config/storage/resource-store/file.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", - "import": [ - "files-scs:config/storage/resource-store/data-accessors/file.json", - "files-scs:config/storage/resource-store/stores/converting.json", - "files-scs:config/storage/resource-store/stores/data-accessor.json", - "files-scs:config/storage/resource-store/stores/locking.json", - "files-scs:config/storage/resource-store/stores/patching.json" - ], - "@graph": [ - { - "comment": "A default store setup with a file system backend.", - "@id": "urn:solid-server:default:ResourceStore", - "@type": "MonitoringStore", - "MonitoringStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Index", - "IndexRepresentationStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Locking", - "LockingResourceStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Patching", - "PatchingStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Converting", - "RepresentationConvertingStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_DataAccessor", - "DataAccessorBasedStore:_accessor": { - "@id": "urn:solid-server:default:FileDataAccessor" - } - } - } - } - } - } - } - ] -} diff --git a/config/storage/resource-store/memory.json b/config/storage/resource-store/memory.json deleted file mode 100644 index cdd84fdc3..000000000 --- a/config/storage/resource-store/memory.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", - "import": [ - "files-scs:config/storage/resource-store/data-accessors/memory.json", - "files-scs:config/storage/resource-store/stores/converting.json", - "files-scs:config/storage/resource-store/stores/data-accessor.json", - "files-scs:config/storage/resource-store/stores/locking.json", - "files-scs:config/storage/resource-store/stores/patching.json" - ], - "@graph": [ - { - "comment": "A default store setup with a memory backend.", - "@id": "urn:solid-server:default:ResourceStore", - "@type": "MonitoringStore", - "MonitoringStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Index", - "IndexRepresentationStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Locking", - "LockingResourceStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Patching", - "PatchingStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Converting", - "RepresentationConvertingStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_DataAccessor", - "DataAccessorBasedStore:_accessor": { - "@id": "urn:solid-server:default:MemoryDataAccessor" - } - } - } - } - } - } - } - - ] -} diff --git a/config/storage/resource-store/sparql.json b/config/storage/resource-store/sparql.json deleted file mode 100644 index da64f60fd..000000000 --- a/config/storage/resource-store/sparql.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", - "import": [ - "files-scs:config/storage/resource-store/data-accessors/sparql-endpoint.json", - "files-scs:config/storage/resource-store/stores/converting.json", - "files-scs:config/storage/resource-store/stores/data-accessor.json", - "files-scs:config/storage/resource-store/stores/locking.json", - "files-scs:config/storage/resource-store/stores/patching.json" - ], - "@graph": [ - { - "comment": "A default store setup with a memory backend.", - "@id": "urn:solid-server:default:ResourceStore", - "@type": "MonitoringStore", - "MonitoringStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Index", - "IndexRepresentationStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Locking", - "LockingResourceStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Patching", - "PatchingStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_Converting", - "comment": "This makes it so all incoming data is converted to quad objects.", - "RepresentationConvertingStore:_options_inConverter": { - "@id": "urn:solid-server:default:RepresentationConverter" - }, - "RepresentationConvertingStore:_options_inType": "internal/quads", - "RepresentationConvertingStore:_source": { - "@id": "urn:solid-server:default:ResourceStore_DataAccessor", - "DataAccessorBasedStore:_accessor": { - "@id": "urn:solid-server:default:SparqlDataAccessor" - } - } - } - } - } - } - } - ] -} diff --git a/config/storage/resource-store/stores/routing.json b/config/storage/resource-store/stores/routing.json deleted file mode 100644 index b1bd43940..000000000 --- a/config/storage/resource-store/stores/routing.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", - "@graph": [ - { - "comment": "Routes data to different stores based on the chosen rule.", - "@id": "urn:solid-server:default:ResourceStore_Routing", - "@type": "RoutingResourceStore", - "rule": { "@id": "urn:solid-server:default:RouterRule" } - } - ] -} diff --git a/test/integration/LdpHandlerWithAuth.test.ts b/test/integration/LdpHandlerWithAuth.test.ts index db7cd4ab4..96c3782d3 100644 --- a/test/integration/LdpHandlerWithAuth.test.ts +++ b/test/integration/LdpHandlerWithAuth.test.ts @@ -20,11 +20,11 @@ const baseUrl = `http://localhost:${port}/`; const rootFilePath = getTestFolder('full-config-acl'); const stores: [string, any][] = [ [ 'in-memory storage', { - storeConfig: 'storage/resource-store/memory.json', + storeConfig: 'storage/backend/memory.json', teardown: jest.fn(), }], [ 'on-disk storage', { - storeConfig: 'storage/resource-store/file.json', + storeConfig: 'storage/backend/file.json', teardown: (): void => removeFolder(rootFilePath), }], ]; diff --git a/test/integration/LdpHandlerWithoutAuth.test.ts b/test/integration/LdpHandlerWithoutAuth.test.ts index 932fd36be..18e591b08 100644 --- a/test/integration/LdpHandlerWithoutAuth.test.ts +++ b/test/integration/LdpHandlerWithoutAuth.test.ts @@ -21,11 +21,11 @@ const baseUrl = `http://localhost:${port}/`; const rootFilePath = getTestFolder('full-config-no-auth'); const stores: [string, any][] = [ [ 'in-memory storage', { - storeConfig: 'storage/resource-store/memory.json', + storeConfig: 'storage/backend/memory.json', teardown: jest.fn(), }], [ 'on-disk storage', { - storeConfig: 'storage/resource-store/file.json', + storeConfig: 'storage/backend/file.json', teardown: (): void => removeFolder(rootFilePath), }], ]; diff --git a/test/integration/SparqlStorage.test.ts b/test/integration/SparqlStorage.test.ts index f38ca662c..b3dc87f90 100644 --- a/test/integration/SparqlStorage.test.ts +++ b/test/integration/SparqlStorage.test.ts @@ -21,7 +21,7 @@ describeIf('docker', 'A server with a SPARQL endpoint as storage', (): void => { const instances = await instantiateFromConfig( 'urn:solid-server:test:Instances', [ - getPresetConfigPath('storage/resource-store/sparql.json'), + getPresetConfigPath('storage/backend/sparql.json'), getTestConfigPath('ldp-with-auth.json'), ], variables, diff --git a/test/integration/Subdomains.test.ts b/test/integration/Subdomains.test.ts index bae9d866e..507ed26dc 100644 --- a/test/integration/Subdomains.test.ts +++ b/test/integration/Subdomains.test.ts @@ -17,11 +17,11 @@ const baseUrl = `http://localhost:${port}/`; const rootFilePath = getTestFolder('subdomains'); const stores: [string, any][] = [ [ 'in-memory storage', { - storeConfig: 'storage/resource-store/memory.json', + storeConfig: 'storage/backend/memory.json', teardown: jest.fn(), }], [ 'on-disk storage', { - storeConfig: 'storage/resource-store/file.json', + storeConfig: 'storage/backend/file.json', teardown: (): void => removeFolder(rootFilePath), }], ]; diff --git a/test/integration/config/ldp-with-auth.json b/test/integration/config/ldp-with-auth.json index 6a5899274..cf1b23d2c 100644 --- a/test/integration/config/ldp-with-auth.json +++ b/test/integration/config/ldp-with-auth.json @@ -14,6 +14,7 @@ "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", "files-scs:config/storage/key-value/memory.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/suffix.json", "files-scs:config/util/index/default.json", diff --git a/test/integration/config/run-with-redlock.json b/test/integration/config/run-with-redlock.json index f55d6b10b..55b925291 100644 --- a/test/integration/config/run-with-redlock.json +++ b/test/integration/config/run-with-redlock.json @@ -13,8 +13,9 @@ "files-scs:config/ldp/metadata-parser/default.json", "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", + "files-scs:config/storage/backend/memory.json", "files-scs:config/storage/key-value/memory.json", - "files-scs:config/storage/resource-store/memory.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/suffix.json", "files-scs:config/util/index/default.json", diff --git a/test/integration/config/server-dynamic-unsafe.json b/test/integration/config/server-dynamic-unsafe.json index 9bea807d6..2d5064226 100644 --- a/test/integration/config/server-dynamic-unsafe.json +++ b/test/integration/config/server-dynamic-unsafe.json @@ -17,8 +17,9 @@ "files-scs:config/ldp/metadata-parser/default.json", "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", + "files-scs:config/storage/backend/dynamic.json", "files-scs:config/storage/key-value/memory.json", - "files-scs:config/storage/resource-store/dynamic.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/suffix.json", "files-scs:config/util/index/default.json", diff --git a/test/integration/config/server-memory.json b/test/integration/config/server-memory.json index c96314719..4bc3bf1f6 100644 --- a/test/integration/config/server-memory.json +++ b/test/integration/config/server-memory.json @@ -16,8 +16,9 @@ "files-scs:config/ldp/metadata-parser/default.json", "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", + "files-scs:config/storage/backend/memory.json", "files-scs:config/storage/key-value/memory.json", - "files-scs:config/storage/resource-store/memory.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/suffix.json", "files-scs:config/util/index/default.json", diff --git a/test/integration/config/server-subdomains-unsafe.json b/test/integration/config/server-subdomains-unsafe.json index dd3af6528..0c972c83e 100644 --- a/test/integration/config/server-subdomains-unsafe.json +++ b/test/integration/config/server-subdomains-unsafe.json @@ -18,6 +18,7 @@ "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", "files-scs:config/storage/key-value/memory.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/subdomain.json", "files-scs:config/util/index/default.json", diff --git a/test/integration/config/server-without-auth.json b/test/integration/config/server-without-auth.json index 66b316cff..3c8a32110 100644 --- a/test/integration/config/server-without-auth.json +++ b/test/integration/config/server-without-auth.json @@ -13,8 +13,9 @@ "files-scs:config/ldp/metadata-parser/default.json", "files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/permissions/acl.json", + "files-scs:config/storage/backend/memory.json", "files-scs:config/storage/key-value/memory.json", - "files-scs:config/storage/resource-store/memory.json", + "files-scs:config/storage/middleware/default.json", "files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/identifiers/suffix.json", "files-scs:config/util/index/default.json",