chore: Add caching to all authorization steps

This commit is contained in:
Joachim Van Herwegen 2022-11-17 16:19:24 +01:00
parent 2d54493485
commit 59e64a22ea
3 changed files with 67 additions and 54 deletions

View File

@ -2,8 +2,11 @@
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^5.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Supports DPoP and Bearer access tokens, or no credentials.",
"comment": "Caches the credentials based on the incoming request.",
"@id": "urn:solid-server:default:CredentialsExtractor",
"@type": "CachedHandler",
"source": {
"comment": "Supports DPoP and Bearer access tokens, or no credentials.",
"@type": "UnionCredentialsExtractor",
"extractors": [
{
@ -22,5 +25,6 @@
{ "@type": "PublicCredentialsExtractor" }
]
}
}
]
}

View File

@ -5,8 +5,12 @@
],
"@graph": [
{
"comment": "Requests permissions on subject resources for auxiliary resources.",
"comment": "Caches permissions based on credentials and requested modes. Does not cache the input object itself as that object might be created in different places",
"@id": "urn:solid-server:default:PermissionReader",
"@type": "CachedHandler",
"fields": [ "credentials", "requestedModes" ],
"source": {
"comment": "Requests permissions on subject resources for auxiliary resources.",
"@type": "AuxiliaryReader",
"auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" },
"reader": {
@ -40,5 +44,6 @@
]
}
}
}
]
}

View File

@ -2,12 +2,16 @@
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^5.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Checks if an operation on a resource requires permissions on intermediate resources (such as newly created parent containers).",
"comment": "Caches the requested modes based on the incoming operation.",
"@id": "urn:solid-server:default:ModesExtractor",
"@type": "CachedHandler",
"source" : {
"comment": "Checks if an operation on a resource requires permissions on intermediate resources (such as newly created parent containers).",
"@type": "IntermediateCreateExtractor",
"resourceSet": { "@id": "urn:solid-server:default:CachedResourceSet" },
"strategy": { "@id": "urn:solid-server:default:IdentifierStrategy" },
"source": { "@id": "urn:solid-server:default:HttpModesExtractor" }
"source": { "@id": "urn:solid-server:default:HttpModesExtractor" },
}
},
{
"comment": "Determines required modes based on HTTP methods.",