Skip to content

Commit

Permalink
Merge b95d8f1 into 90a6460
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimvh committed Feb 8, 2022
2 parents 90a6460 + b95d8f1 commit 98d7918
Show file tree
Hide file tree
Showing 79 changed files with 2,084 additions and 1,329 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright © 2019–2021 Inrupt Inc. and imec
Copyright © 2019–2022 Inrupt Inc. and imec

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 5 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ The following changes are relevant for v2 custom configs that replaced certain f
- Requests targeting the OIDC library now use a separate handler.
- `/http/handler/default.json`
- `/identity/handler/default.json`
- The architecture of IDP interaction handlers has completely changed to improve modularity
- `/identity/handler/interaction/*`
- `/identity/registration/*`

### Interface changes
These changes are relevant if you wrote custom modules for the server that depend on existing interfaces.
- `TypedRepresentationConverter` function signatures changed
and base functionality moved to `BaseTypedRepresentationConverter`
and base functionality moved to `BaseTypedRepresentationConverter`.
- Many changes to several components related to the IDP.

## v2.0.0
### New features
Expand Down
27 changes: 22 additions & 5 deletions config/app/setup/handlers/setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,31 @@
"args_responseWriter": { "@id": "urn:solid-server:default:ResponseWriter" },
"args_operationHandler": {
"@type": "SetupHttpHandler",
"args_initializer": { "@id": "urn:solid-server:default:RootInitializer" },
"args_registrationManager": { "@id": "urn:solid-server:default:SetupRegistrationManager" },
"args_handler": {
"@type": "SetupHandler",
"args_initializer": { "@id": "urn:solid-server:default:RootInitializer" },
"args_registrationManager": { "@id": "urn:solid-server:default:SetupRegistrationManager" }
},
"args_converter": { "@id": "urn:solid-server:default:RepresentationConverter" },
"args_storageKey": "setupCompleted-2.0",
"args_storage": { "@id": "urn:solid-server:default:SetupStorage" },
"args_viewTemplate": "@css:templates/setup/index.html.ejs",
"args_responseTemplate": "@css:templates/setup/response.html.ejs",
"args_errorHandler": { "@id": "urn:solid-server:default:ErrorHandler" }
"args_templateEngine": {
"comment": "Renders the specific page and embeds it into the main HTML body.",
"@type": "ChainedTemplateEngine",
"renderedName": "htmlBody",
"engines": [
{
"comment": "Renders the main setup template.",
"@type": "EjsTemplateEngine",
"template": "@css:templates/setup/index.html.ejs"
},
{
"comment": "Will embed the result of the first engine into the main HTML template.",
"@type": "EjsTemplateEngine",
"template": "@css:templates/main.html.ejs"
}
]
}
}
},
{
Expand Down
11 changes: 8 additions & 3 deletions config/http/static/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,22 @@
"StaticAssetHandler:_assets_value": "@css:templates/images/favicon.ico"
},
{
"StaticAssetHandler:_assets_key": "/.well_known/css/styles/",
"StaticAssetHandler:_assets_key": "/.well-known/css/styles/",
"StaticAssetHandler:_assets_value": "@css:templates/styles/"
},
{
"StaticAssetHandler:_assets_key": "/.well_known/css/fonts/",
"StaticAssetHandler:_assets_key": "/.well-known/css/fonts/",
"StaticAssetHandler:_assets_value": "@css:templates/fonts/"
},
{
"StaticAssetHandler:_assets_key": "/.well_known/css/images/",
"StaticAssetHandler:_assets_key": "/.well-known/css/images/",
"StaticAssetHandler:_assets_value": "@css:templates/images/"
},
{
"StaticAssetHandler:_assets_key": "/.well-known/css/scripts/",
"StaticAssetHandler:_assets_value": "@css:templates/scripts/"
}

]
}
]
Expand Down
4 changes: 1 addition & 3 deletions config/identity/handler/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@
"comment": "Handles IDP handler behaviour.",
"@id": "urn:solid-server:default:IdentityProviderHttpHandler",
"@type": "IdentityProviderHttpHandler",
"args_baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"args_idpPath": "/idp",
"args_providerFactory": { "@id": "urn:solid-server:default:IdentityProviderFactory" },
"args_converter": { "@id": "urn:solid-server:default:RepresentationConverter" },
"args_errorHandler": { "@id": "urn:solid-server:default:ErrorHandler" }
"args_handler": { "@id": "urn:solid-server:default:InteractionHandler" }
}
]
}
48 changes: 42 additions & 6 deletions config/identity/handler/interaction/routes.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,55 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^2.0.0/components/context.jsonld",
"import": [
"files-scs:config/identity/handler/interaction/routes/existing-login.json",
"files-scs:config/identity/handler/interaction/routes/forgot-password.json",
"files-scs:config/identity/handler/interaction/routes/index.json",
"files-scs:config/identity/handler/interaction/routes/login.json",
"files-scs:config/identity/handler/interaction/routes/prompt.json",
"files-scs:config/identity/handler/interaction/routes/reset-password.json",
"files-scs:config/identity/handler/interaction/routes/session.json"
"files-scs:config/identity/handler/interaction/views/controls.json",
"files-scs:config/identity/handler/interaction/views/html.json"
],
"@graph": [
{
"@id": "urn:solid-server:default:IdentityProviderHttpHandler",
"IdentityProviderHttpHandler:_args_interactionRoutes": [
{ "@id": "urn:solid-server:auth:password:ForgotPasswordRoute" },
"@id": "urn:solid-server:default:InteractionHandler",
"@type": "WaterfallHandler",
"handlers": [
{
"comment": "Returns the relevant HTML pages for the interactions when needed",
"@id": "urn:solid-server:auth:password:HtmlViewHandler"
},
{
"comment": "Adds controls and API version to JSON responses.",
"@id": "urn:solid-server:auth:password:ControlHandler",
"ControlHandler:_source" : { "@id": "urn:solid-server:auth:password:LocationInteractionHandler" }
}
]
},
{
"comment": "Converts redirect errors to location JSON responses.",
"@id": "urn:solid-server:auth:password:LocationInteractionHandler",
"@type": "LocationInteractionHandler",
"LocationInteractionHandler:_source" : { "@id": "urn:solid-server:auth:password:RouteInteractionHandler" }
},
{
"comment": "Handles every interaction based on their route.",
"@id": "urn:solid-server:auth:password:RouteInteractionHandler",
"@type": "WaterfallHandler",
"handlers": [
{
"comment": [
"This handler is required to prevent Components.js issues with arrays.",
"This might be fixed in the next Components.js release after which this can be removed."
],
"@type": "UnsupportedAsyncHandler"
},
{ "@id": "urn:solid-server:auth:password:IndexRoute" },
{ "@id": "urn:solid-server:auth:password:PromptRoute" },
{ "@id": "urn:solid-server:auth:password:LoginRoute" },
{ "@id": "urn:solid-server:auth:password:ResetPasswordRoute" },
{ "@id": "urn:solid-server:auth:password:SessionRoute" }
{ "@id": "urn:solid-server:auth:password:ExistingLoginRoute" },
{ "@id": "urn:solid-server:auth:password:ForgotPasswordRoute" },
{ "@id": "urn:solid-server:auth:password:ResetPasswordRoute" }
]
}
]
Expand Down
16 changes: 16 additions & 0 deletions config/identity/handler/interaction/routes/existing-login.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^2.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Handles the interaction that occurs when a logged in user wants to authenticate with a new app.",
"@id": "urn:solid-server:auth:password:ExistingLoginRoute",
"@type": "RelativeInteractionRoute",
"base": { "@id": "urn:solid-server:auth:password:IndexRoute" },
"relativePath": "/consent/",
"source": {
"@type": "ExistingLoginHandler",
"interactionCompleter": { "@type": "BaseInteractionCompleter" }
}
}
]
}
26 changes: 7 additions & 19 deletions config/identity/handler/interaction/routes/forgot-password.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,20 @@
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^2.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Handles all functionality on the forgot password page",
"comment": "Handles the forgot password interaction",
"@id": "urn:solid-server:auth:password:ForgotPasswordRoute",
"@type": "BasicInteractionRoute",
"route": "^/forgotpassword/$",
"viewTemplates": {
"BasicInteractionRoute:_viewTemplates_key": "text/html",
"BasicInteractionRoute:_viewTemplates_value": "@css:templates/identity/email-password/forgot-password.html.ejs"
},
"responseTemplates": {
"BasicInteractionRoute:_responseTemplates_key": "text/html",
"BasicInteractionRoute:_responseTemplates_value": "@css:templates/identity/email-password/forgot-password-response.html.ejs"
},
"controls": {
"BasicInteractionRoute:_controls_key": "forgotPassword",
"BasicInteractionRoute:_controls_value": "/forgotpassword/"
},
"handler": {
"@type": "RelativeInteractionRoute",
"base": { "@id": "urn:solid-server:auth:password:IndexRoute" },
"relativePath": "/forgotpassword/",
"source": {
"@type": "ForgotPasswordHandler",
"args_accountStore": { "@id": "urn:solid-server:auth:password:AccountStore" },
"args_baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"args_idpPath": "/idp",
"args_templateEngine": {
"@type": "EjsTemplateEngine",
"template": "@css:templates/identity/email-password/reset-password-email.html.ejs"
},
"args_emailSender": { "@id": "urn:solid-server:default:EmailSender" }
"args_emailSender": { "@id": "urn:solid-server:default:EmailSender" },
"args_resetRoute": { "@id": "urn:solid-server:auth:password:ResetPasswordRoute" }
}
}
]
Expand Down
16 changes: 16 additions & 0 deletions config/identity/handler/interaction/routes/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^2.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Root API entry. Returns an empty body so we can add controls pointing to other interaction routes.",
"@id": "urn:solid-server:auth:password:IndexRoute",
"@type": "RelativeInteractionRoute",
"base": { "@id": "urn:solid-server:default:variable:baseUrl" },
"relativePath": "/idp/",
"source": {
"@type": "FixedInteractionHandler",
"response": {}
}
}
]
}
18 changes: 5 additions & 13 deletions config/identity/handler/interaction/routes/login.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^2.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Handles all functionality on the Login Page",
"comment": "Handles the login interaction",
"@id": "urn:solid-server:auth:password:LoginRoute",
"@type": "BasicInteractionRoute",
"route": "^/login/$",
"prompt": "login",
"viewTemplates": {
"BasicInteractionRoute:_viewTemplates_key": "text/html",
"BasicInteractionRoute:_viewTemplates_value": "@css:templates/identity/email-password/login.html.ejs"
},
"controls": {
"BasicInteractionRoute:_controls_key": "login",
"BasicInteractionRoute:_controls_value": "/login/"
},
"handler": {
"@type": "RelativeInteractionRoute",
"base": { "@id": "urn:solid-server:auth:password:IndexRoute" },
"relativePath": "/login/",
"source": {
"@type": "LoginHandler",
"accountStore": { "@id": "urn:solid-server:auth:password:AccountStore" },
"interactionCompleter": { "@type": "BaseInteractionCompleter" }
Expand Down
26 changes: 26 additions & 0 deletions config/identity/handler/interaction/routes/prompt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^2.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Handles OIDC redirects containing a prompt, such as login or consent.",
"@id": "urn:solid-server:auth:password:PromptRoute",
"@type": "RelativeInteractionRoute",
"base": { "@id": "urn:solid-server:auth:password:IndexRoute" },
"relativePath": "/prompt/",
"source": {
"@type": "PromptHandler",
"@id": "urn:solid-server:auth:password:PromptHandler",
"promptRoutes": [
{
"PromptHandler:_promptRoutes_key": "login",
"PromptHandler:_promptRoutes_value": { "@id": "urn:solid-server:auth:password:LoginRoute" }
},
{
"PromptHandler:_promptRoutes_key": "consent",
"PromptHandler:_promptRoutes_value": { "@id": "urn:solid-server:auth:password:ExistingLoginRoute" }
}
]
}
}
]
}
18 changes: 5 additions & 13 deletions config/identity/handler/interaction/routes/reset-password.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^2.0.0/components/context.jsonld",
"comment": "Exports 2 handlers: one for viewing the page and one for doing the reset.",
"@graph": [
{
"comment": "Handles the reset password page submission",
"comment": "Handles the reset password interaction",
"@id": "urn:solid-server:auth:password:ResetPasswordRoute",
"@type": "BasicInteractionRoute",
"route": "^/resetpassword/[^/]*$",
"viewTemplates": {
"BasicInteractionRoute:_viewTemplates_key": "text/html",
"BasicInteractionRoute:_viewTemplates_value": "@css:templates/identity/email-password/reset-password.html.ejs"
},
"responseTemplates": {
"BasicInteractionRoute:_responseTemplates_key": "text/html",
"BasicInteractionRoute:_responseTemplates_value": "@css:templates/identity/email-password/reset-password-response.html.ejs"
},
"handler": {
"@type": "RelativeInteractionRoute",
"base": { "@id": "urn:solid-server:auth:password:IndexRoute" },
"relativePath": "/resetpassword/",
"source": {
"@type": "ResetPasswordHandler",
"accountStore": { "@id": "urn:solid-server:auth:password:AccountStore" }
}
Expand Down
20 changes: 0 additions & 20 deletions config/identity/handler/interaction/routes/session.json

This file was deleted.

27 changes: 27 additions & 0 deletions config/identity/handler/interaction/views/controls.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^2.0.0/components/context.jsonld",
"@graph": [
{
"@id": "urn:solid-server:auth:password:ControlHandler",
"@type": "ControlHandler",
"controls": [
{
"ControlHandler:_controls_key": "index",
"ControlHandler:_controls_value": { "@id": "urn:solid-server:auth:password:IndexRoute" }
},
{
"ControlHandler:_controls_key": "prompt",
"ControlHandler:_controls_value": { "@id": "urn:solid-server:auth:password:PromptRoute" }
},
{
"ControlHandler:_controls_key": "login",
"ControlHandler:_controls_value": { "@id": "urn:solid-server:auth:password:LoginRoute" }
},
{
"ControlHandler:_controls_key": "forgotPassword",
"ControlHandler:_controls_value": { "@id": "urn:solid-server:auth:password:ForgotPasswordRoute" }
}
]
}
]
}
Loading

0 comments on commit 98d7918

Please sign in to comment.