feat: Support content negotiation for IDP requests

This commit is contained in:
Joachim Van Herwegen
2021-08-10 15:55:49 +02:00
parent 7b42c72142
commit 80ebd02cc4
20 changed files with 483 additions and 209 deletions

View File

@@ -23,26 +23,7 @@
"idpPath": "/idp",
"requestParser": { "@id": "urn:solid-server:default:RequestParser" },
"providerFactory": { "@id": "urn:solid-server:default:IdentityProviderFactory" },
"templateHandler": {
"@type": "TemplateHandler",
"responseWriter": { "@id": "urn:solid-server:default:ResponseWriter" },
"templateEngine": {
"comment": "Renders the specific page and embeds it into the main HTML body.",
"@type": "ChainedTemplateEngine",
"renderedName": "htmlBody",
"engines": [
{
"comment": "Will be called with specific interaction templates to generate HTML snippets.",
"@type": "EjsTemplateEngine"
},
{
"comment": "Will embed the result of the first engine into the main HTML template.",
"@type": "EjsTemplateEngine",
"template": "@css:templates/main.html.ejs"
}
]
}
},
"converter": { "@id": "urn:solid-server:default:RepresentationConverter" },
"interactionCompleter": {
"comment": "Responsible for finishing OIDC interactions.",
"@type": "InteractionCompleter",

View File

@@ -6,8 +6,14 @@
"@id": "urn:solid-server:auth:password:ForgotPasswordRoute",
"@type": "InteractionRoute",
"route": "^/forgotpassword/?$",
"viewTemplate": "@css:templates/identity/email-password/forgot-password.html.ejs",
"responseTemplate": "@css:templates/identity/email-password/forgot-password-response.html.ejs",
"viewTemplates": {
"InteractionRoute:_viewTemplates_key": "text/html",
"InteractionRoute:_viewTemplates_value": "@css:templates/identity/email-password/forgot-password.html.ejs"
},
"responseTemplates": {
"InteractionRoute:_responseTemplates_key": "text/html",
"InteractionRoute:_responseTemplates_value": "@css:templates/identity/email-password/forgot-password-response.html.ejs"
},
"handler": {
"@type": "ForgotPasswordHandler",
"args_accountStore": { "@id": "urn:solid-server:auth:password:AccountStore" },

View File

@@ -7,7 +7,10 @@
"@type": "InteractionRoute",
"route": "^/login/?$",
"prompt": "default",
"viewTemplate": "@css:templates/identity/email-password/login.html.ejs",
"viewTemplates": {
"InteractionRoute:_viewTemplates_key": "text/html",
"InteractionRoute:_viewTemplates_value": "@css:templates/identity/email-password/login.html.ejs"
},
"handler": {
"@type": "LoginHandler",
"accountStore": { "@id": "urn:solid-server:auth:password:AccountStore" }

View File

@@ -7,8 +7,14 @@
"@id": "urn:solid-server:auth:password:ResetPasswordRoute",
"@type": "InteractionRoute",
"route": "^/resetpassword(/[^/]*)?$",
"viewTemplate": "@css:templates/identity/email-password/reset-password.html.ejs",
"responseTemplate": "@css:templates/identity/email-password/reset-password-response.html.ejs",
"viewTemplates": {
"InteractionRoute:_viewTemplates_key": "text/html",
"InteractionRoute:_viewTemplates_value": "@css:templates/identity/email-password/reset-password.html.ejs"
},
"responseTemplates": {
"InteractionRoute:_responseTemplates_key": "text/html",
"InteractionRoute:_responseTemplates_value": "@css:templates/identity/email-password/reset-password-response.html.ejs"
},
"handler": {
"@type": "ResetPasswordHandler",
"accountStore": { "@id": "urn:solid-server:auth:password:AccountStore" }

View File

@@ -7,7 +7,10 @@
"@type": "InteractionRoute",
"route": "^/confirm/?$",
"prompt": "consent",
"viewTemplate": "@css:templates/identity/email-password/confirm.html.ejs",
"viewTemplates": {
"InteractionRoute:_viewTemplates_key": "text/html",
"InteractionRoute:_viewTemplates_value": "@css:templates/identity/email-password/confirm.html.ejs"
},
"handler": { "@type": "SessionHttpHandler" }
}
]

View File

@@ -6,8 +6,14 @@
"@id": "urn:solid-server:auth:password:RegistrationRoute",
"@type": "InteractionRoute",
"route": "^/register/?$",
"viewTemplate": "@css:templates/identity/email-password/register.html.ejs",
"responseTemplate": "@css:templates/identity/email-password/register-response.html.ejs",
"viewTemplates": {
"InteractionRoute:_viewTemplates_key": "text/html",
"InteractionRoute:_viewTemplates_value": "@css:templates/identity/email-password/register.html.ejs"
},
"responseTemplates": {
"InteractionRoute:_responseTemplates_key": "text/html",
"InteractionRoute:_responseTemplates_value": "@css:templates/identity/email-password/register-response.html.ejs"
},
"handler": {
"@type": "RegistrationHandler",
"args_baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },

View File

@@ -0,0 +1,26 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Uses the JSON data as parameters for a template.",
"@id": "urn:solid-server:default:DynamicJsonToTemplateConverter",
"@type": "DynamicJsonToTemplateConverter",
"templateEngine": {
"comment": "Renders the specific page and embeds it into the main HTML body.",
"@type": "ChainedTemplateEngine",
"renderedName": "htmlBody",
"engines": [
{
"comment": "Will be called with specific templates to generate HTML snippets.",
"@type": "EjsTemplateEngine"
},
{
"comment": "Will embed the result of the first engine into the main HTML template.",
"@type": "EjsTemplateEngine",
"template": "@css:templates/main.html.ejs"
}
]
}
}
]
}

View File

@@ -2,6 +2,7 @@
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/util/representation-conversion/converters/content-type-replacer.json",
"files-scs:config/util/representation-conversion/converters/dynamic-json-template.json",
"files-scs:config/util/representation-conversion/converters/errors.json",
"files-scs:config/util/representation-conversion/converters/markdown.json",
"files-scs:config/util/representation-conversion/converters/quad-to-rdf.json",
@@ -15,6 +16,7 @@
"handlers": [
{ "@id": "urn:solid-server:default:DefaultUiConverter" },
{ "@id": "urn:solid-server:default:MarkdownToHtmlConverter" },
{ "@id": "urn:solid-server:default:DynamicJsonToTemplateConverter" },
{
"@type": "IfNeededConverter",
"comment": "Only continue converting if the requester cannot accept the available content type"