refactor: Move key/value storages to relevant configs

This commit is contained in:
Joachim Van Herwegen 2022-03-18 11:22:51 +01:00
parent a1a6ce01fa
commit 30ad3015f0
6 changed files with 25 additions and 41 deletions

View File

@ -15,7 +15,8 @@ The following changes pertain to the imports in the default configs:
- ... - ...
The following changes are relevant for v3 custom configs that replaced certain features. The following changes are relevant for v3 custom configs that replaced certain features.
- ... - The key/value storage configs in `config/storage/key-value/*` have been changed to reduce config duplication.
All storages there that were only relevant for 1 class have been moved to the config of that class.
### Interface changes ### Interface changes
These changes are relevant if you wrote custom modules for the server that depend on existing interfaces. These changes are relevant if you wrote custom modules for the server that depend on existing interfaces.

View File

@ -7,7 +7,9 @@
"@type": "BaseAccountStore", "@type": "BaseAccountStore",
"saltRounds": 10, "saltRounds": 10,
"storage": { "storage": {
"@id": "urn:solid-server:default:AccountStorage" "@type": "EncodingPathStorage",
"relativePath": "/idp/accounts/",
"source": { "@id": "urn:solid-server:default:KeyValueStorage" }
}, },
"forgotPasswordStorage": { "forgotPasswordStorage": {
"@id": "urn:solid-server:default:ExpiringForgotPasswordStorage" "@id": "urn:solid-server:default:ExpiringForgotPasswordStorage"
@ -17,7 +19,11 @@
"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:ExpiringForgotPasswordStorage", "@id": "urn:solid-server:default:ExpiringForgotPasswordStorage",
"@type": "WrappedExpiringStorage", "@type": "WrappedExpiringStorage",
"source": { "@id": "urn:solid-server:default:ForgotPasswordStorage" } "source": {
"@type": "EncodingPathStorage",
"relativePath": "/forgot-password/",
"source": { "@id": "urn:solid-server:default:KeyValueStorage" }
}
}, },
{ {
"comment": "Makes sure the expiring storage cleanup timer is stopped when the application needs to stop.", "comment": "Makes sure the expiring storage cleanup timer is stopped when the application needs to stop.",

View File

@ -7,7 +7,11 @@
"@type": "WebIdAdapterFactory", "@type": "WebIdAdapterFactory",
"source": { "source": {
"@type": "ExpiringAdapterFactory", "@type": "ExpiringAdapterFactory",
"storage": { "@id": "urn:solid-server:default:IdpAdapterStorage" } "storage": {
"@type": "EncodingPathStorage",
"relativePath": "/idp/adapter/",
"source": { "@id": "urn:solid-server:default:KeyValueStorage" }
}
}, },
"converter": { "@id": "urn:solid-server:default:RepresentationConverter" } "converter": { "@id": "urn:solid-server:default:RepresentationConverter" }
} }

View File

@ -12,7 +12,11 @@
"args_baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" }, "args_baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"args_oidcPath": "/.oidc", "args_oidcPath": "/.oidc",
"args_interactionHandler": { "@id": "urn:solid-server:auth:password:PromptHandler" }, "args_interactionHandler": { "@id": "urn:solid-server:auth:password:PromptHandler" },
"args_storage": { "@id": "urn:solid-server:default:IdpKeyStorage" }, "args_storage": {
"@type": "EncodingPathStorage",
"relativePath": "/idp/keys/",
"source": { "@id": "urn:solid-server:default:KeyValueStorage" }
},
"args_errorHandler": { "@id": "urn:solid-server:default:ErrorHandler" }, "args_errorHandler": { "@id": "urn:solid-server:default:ErrorHandler" },
"args_responseWriter": { "@id": "urn:solid-server:default:ResponseWriter" }, "args_responseWriter": { "@id": "urn:solid-server:default:ResponseWriter" },
"config": { "config": {

View File

@ -12,7 +12,11 @@
"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:ExpiringTokenStorage", "@id": "urn:solid-server:default:ExpiringTokenStorage",
"@type": "WrappedExpiringStorage", "@type": "WrappedExpiringStorage",
"source": { "@id": "urn:solid-server:default:IdpTokenStorage" } "source": {
"@type": "EncodingPathStorage",
"relativePath": "/idp/tokens/",
"source": { "@id": "urn:solid-server:default:KeyValueStorage" }
}
}, },
{ {
"comment": "Makes sure the expiring storage cleanup timer is stopped when the application needs to stop.", "comment": "Makes sure the expiring storage cleanup timer is stopped when the application needs to stop.",

View File

@ -8,41 +8,6 @@
"relativePath": "/locks/", "relativePath": "/locks/",
"source": { "@id": "urn:solid-server:default:BackendKeyValueStorage" } "source": { "@id": "urn:solid-server:default:BackendKeyValueStorage" }
}, },
{
"comment": "Storage used by the IDP adapter.",
"@id": "urn:solid-server:default:IdpAdapterStorage",
"@type": "EncodingPathStorage",
"relativePath": "/idp/adapter/",
"source": { "@id": "urn:solid-server:default:KeyValueStorage" }
},
{
"comment": "Storage used for the IDP keys.",
"@id": "urn:solid-server:default:IdpKeyStorage",
"@type": "EncodingPathStorage",
"relativePath": "/idp/keys/",
"source": { "@id": "urn:solid-server:default:KeyValueStorage" }
},
{
"comment": "Storage used for IDP ownership tokens.",
"@id": "urn:solid-server:default:IdpTokenStorage",
"@type": "EncodingPathStorage",
"relativePath": "/idp/tokens/",
"source": { "@id": "urn:solid-server:default:KeyValueStorage" }
},
{
"comment": "Storage used for account management.",
"@id": "urn:solid-server:default:AccountStorage",
"@type": "EncodingPathStorage",
"relativePath": "/idp/accounts/",
"source": { "@id": "urn:solid-server:default:KeyValueStorage" }
},
{
"comment": "Storage used for ForgotPassword records",
"@id": "urn:solid-server:default:ForgotPasswordStorage",
"@type": "EncodingPathStorage",
"relativePath": "/forgot-password/",
"source": { "@id": "urn:solid-server:default:KeyValueStorage" }
},
{ {
"comment": "Storage used by setup components.", "comment": "Storage used by setup components.",
"@id": "urn:solid-server:default:SetupStorage", "@id": "urn:solid-server:default:SetupStorage",