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": [
"files-scs:config/identity/handler/adapter-factory/webid.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"
],
"@graph": [

View File

@ -1,14 +1,6 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"@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.",
"@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",
"@graph": [
{
"comment": "Used for internal storage by some classes. This uses a memory based solution.",
"@id": "urn:solid-server:default:Storage",
"comment": "These storage solutions store their data in memory."
},
{
"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"
}
]

View File

@ -2,12 +2,26 @@
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Used for internal storage by some classes. The specified container in the resource store will store internal data.",
"@id": "urn:solid-server:default:Storage",
"comment": "These storage solutions use the specified container in the ResourceStore to store their data."
},
{
"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",
"source": { "@id": "urn:solid-server:default:ResourceStore" },
"baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"container": "/storage/"
"container": "/idp/data/"
}
]
}

View File

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

View File

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

View File

@ -18,7 +18,7 @@
"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/key-value/resource-store.json",
"files-scs:config/storage/middleware/default.json",
"files-scs:config/util/auxiliary/acl.json",
"files-scs:config/util/identifiers/suffix.json",