fix: Prevent cyclical dependency with locker and storage

This commit is contained in:
Joachim Van Herwegen 2021-07-27 11:49:28 +02:00
parent d596d575a1
commit 45f9a51d7c
7 changed files with 31 additions and 17 deletions

View File

@ -3,7 +3,7 @@
"import": [ "import": [
"files-scs:config/identity/handler/adapter-factory/webid.json", "files-scs:config/identity/handler/adapter-factory/webid.json",
"files-scs:config/identity/handler/interaction/handler.json", "files-scs:config/identity/handler/interaction/handler.json",
"files-scs:config/identity/handler/key-value/resource-store.json", "files-scs:config/identity/handler/key-value/storage.json",
"files-scs:config/identity/handler/provider-factory/identity.json" "files-scs:config/identity/handler/provider-factory/identity.json"
], ],
"@graph": [ "@graph": [

View File

@ -1,14 +1,6 @@
{ {
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"@graph": [ "@graph": [
{
"comment": "This storage specifically uses the same path as the IDP routing, thereby guaranteeing outside access is impossible.",
"@id": "urn:solid-server:default:IdpStorage",
"@type": "JsonResourceStorage",
"source": { "@id": "urn:solid-server:default:ResourceStore" },
"baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"container": "/idp/data/"
},
{ {
"comment": "Stores expiring data. This class has a `finalize` function that needs to be called after stopping the server.", "comment": "Stores expiring data. This class has a `finalize` function that needs to be called after stopping the server.",
"@id": "urn:solid-server:default:ExpiringIdpStorage", "@id": "urn:solid-server:default:ExpiringIdpStorage",

View File

@ -2,8 +2,16 @@
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"@graph": [ "@graph": [
{ {
"comment": "Used for internal storage by some classes. This uses a memory based solution.", "comment": "These storage solutions store their data in memory."
"@id": "urn:solid-server:default:Storage", },
{
"comment": "Used for internal storage by the locker.",
"@id": "urn:solid-server:default:LockStorage",
"@type": "MemoryMapStorage"
},
{
"comment": "Storage used by the IDP component.",
"@id": "urn:solid-server:default:IdpStorage",
"@type": "MemoryMapStorage" "@type": "MemoryMapStorage"
} }
] ]

View File

@ -2,12 +2,26 @@
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld", "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"@graph": [ "@graph": [
{ {
"comment": "Used for internal storage by some classes. The specified container in the resource store will store internal data.", "comment": "These storage solutions use the specified container in the ResourceStore to store their data."
"@id": "urn:solid-server:default:Storage", },
{
"comment": [
"This is the internal storage for the locker, which maintains what resources are in use.",
"It writes directly to a low-level store, because higher-level storage typically already uses the locker and would thus cause a loop."
],
"@id": "urn:solid-server:default:LockStorage",
"@type": "JsonResourceStorage",
"source": { "@id": "urn:solid-server:default:ResourceStore_Backend" },
"baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"container": "/locks/"
},
{
"comment": "Storage used by the IDP component.",
"@id": "urn:solid-server:default:IdpStorage",
"@type": "JsonResourceStorage", "@type": "JsonResourceStorage",
"source": { "@id": "urn:solid-server:default:ResourceStore" }, "source": { "@id": "urn:solid-server:default:ResourceStore" },
"baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" }, "baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"container": "/storage/" "container": "/idp/data/"
} }
] ]
} }

View File

@ -10,7 +10,7 @@
"locker": { "locker": {
"@type": "SingleThreadedResourceLocker" "@type": "SingleThreadedResourceLocker"
}, },
"storage": { "@id": "urn:solid-server:default:Storage" }, "storage": { "@id": "urn:solid-server:default:LockStorage" },
"suffixes_count": "count", "suffixes_count": "count",
"suffixes_read": "read", "suffixes_read": "read",
"suffixes_write": "write" "suffixes_write": "write"

View File

@ -12,7 +12,7 @@
"@type": "RedisResourceLocker", "@type": "RedisResourceLocker",
"redisClients": [ "6379" ] "redisClients": [ "6379" ]
}, },
"storage": { "@id": "urn:solid-server:default:Storage" }, "storage": { "@id": "urn:solid-server:default:LockStorage" },
"suffixes_count": "count", "suffixes_count": "count",
"suffixes_read": "read", "suffixes_read": "read",
"suffixes_write": "write" "suffixes_write": "write"

View File

@ -18,7 +18,7 @@
"files-scs:config/ldp/metadata-writer/default.json", "files-scs:config/ldp/metadata-writer/default.json",
"files-scs:config/ldp/permissions/acl.json", "files-scs:config/ldp/permissions/acl.json",
"files-scs:config/storage/backend/memory.json", "files-scs:config/storage/backend/memory.json",
"files-scs:config/storage/key-value/memory.json", "files-scs:config/storage/key-value/resource-store.json",
"files-scs:config/storage/middleware/default.json", "files-scs:config/storage/middleware/default.json",
"files-scs:config/util/auxiliary/acl.json", "files-scs:config/util/auxiliary/acl.json",
"files-scs:config/util/identifiers/suffix.json", "files-scs:config/util/identifiers/suffix.json",