68 Commits

Author SHA1 Message Date
Joachim Van Herwegen
bedab907f9 feat: Allow dynamically adding CLI parameters in configs 2022-04-15 10:56:05 +02:00
Joachim Van Herwegen
e6519992bf Merge branch 'main' into versions/4.0.0
# Conflicts:
#	test/unit/storage/accessors/FileDataAccessor.test.ts
2022-04-15 10:28:50 +02:00
Joachim Van Herwegen
16e9368734 test: Add flushPromises utility function 2022-03-31 17:00:09 +02:00
Adler Faulkner
c8d4bfec39
feat: Support seeding pods and accounts
* feat(seeding): seed accounts and pods with seeded-pod-config.json

* feat(seeding): dry up SeededPodInitializer by using RegistrationManager directly and make compatible with version/3.0.0

* feat(seeding): update seed config files to version 3.0.0 context

* feat(seeding): simplify seeded-root config by importing pre-existing prefilled-root config

* feat(seeding): Add seeding as a default initializer, update seeded pod copy and guide, change seeded pod config to array

* feat(seeding): remove template info from seeded pod guide, use mockFs, code style nit, fix redlock test

* feat(seeding): remove old config file
2022-03-10 10:16:05 +01:00
Joachim Van Herwegen
2dc20fe3bc feat: Store the server version on start 2022-02-22 09:31:24 +01:00
Joachim Van Herwegen
62e2210023 feat: Warn users when they change the base URL 2022-02-22 09:31:24 +01:00
Joachim Van Herwegen
9577791472 feat: Simplify setup to be more in line with IDP behaviour 2022-02-11 10:52:45 +01:00
Joachim Van Herwegen
c216efd62f
feat: Allow for custom CLI and variable options
* feat: (AppRunner) Mechanism to configure cli args and derive componentsjs vars from them implemented

* fix: (AppRunner) tidying

* fix: (AppRunner) tidying up

* fix: (AppRunner) runCli method made sync

* fix; (VarResolver) refactored to multiple files, and other stylistic fixes.

* chore: (AppRunner) Uses builder pattern for yargs base arguments setup to enable better typescript inference

* fix(AppRunner): refactoring AppRunner and VarResolver

* fix(AppRunner): refactoring AppRunner promise handling

* fix(AppRunner): verror dependency removal

* fix: Simplify CLI error handling

* feat: Use same config for both CLI and app instantiation

* fix: Update typings and imports

* feat: Split VariableResolver behaviour to 2 classes

* feat: Move default value behaviour from CLI to ValueComputers

* test: Add unit tests for new CLI classes

* feat: Integrate new CLI configuration with all default configurations

* feat: Add createApp function to AppRunner

* docs: Update comments in CLI-related classes

* fix: Various fixes and refactors

Co-authored-by: damooo <damodara@protonmail.com>
2022-02-11 10:00:12 +01:00
Joachim Van Herwegen
5613ff9e71 fix: Let Representations always have a body
This is relevant when the request has a content-type
but no data.
2021-10-12 13:30:06 +02:00
Joachim Van Herwegen
b3da9c9fcf refactor: Restructure source code folder
This way the location of certain classes should make more sense
2021-10-12 12:51:02 +02:00
Joachim Van Herwegen
9968f2ae5b feat: Generalize RootInitializer to ContainerInitializer
The initializer can now be used for any container.
The initializer also does not handle the repeat check anymore,
this is now configured with a ConditionalHandler.
2021-10-07 15:51:11 +02:00
Joachim Van Herwegen
bb7e88b137 refactor: Split HttpHandler behaviour over multiple classes
This allows easier reuse of certain reoccurring behaviours,
such as authorization.
The AuthenticatedLdpHandler is no longer required
since it is a combination of parsing and authorization.
This did require a small change to the OperationHandler interface.
2021-10-07 15:51:11 +02:00
Joachim Van Herwegen
4e1a2f5981 feat: Create SetupHttpHandler
This handler allows users to set up servers with a pod
and without having to enable public access first
2021-09-27 10:32:34 +02:00
Ruben Verborgh
1719857e4b change: Use @css: instead of $PACKAGE_ROOT/
This makes usage from the command line easier,
since $ is typically used to mark variables.
2021-08-03 13:19:38 +01:00
Ruben Verborgh
f28279e3a5 feat: Accept asset paths as config.
This allows the server to be run globally with pre-defined configs:
  community-solid-server -c '$PACKAGE_ROOT/config/file.json'
2021-08-03 12:08:58 +01:00
Joachim Van Herwegen
c2ad892020 feat: Create RootInitializer to set up root resources 2021-07-22 15:08:28 +02:00
Ruben Verborgh
9628fe98b8 refactor: Align EJS engine with Handlebars. 2021-07-22 11:12:21 +02:00
Joachim Van Herwegen
e43b579ae7 fix: Throw internal error with invalid ACL. 2021-07-16 16:42:32 +02:00
Joachim Van Herwegen
d4bb1095c0 fix: Let AclInitializer throw internal error in case of problems 2021-07-16 16:42:32 +02:00
Joachim Van Herwegen
e8a0f63e02 feat: Add App class to start and stop the server 2021-06-14 16:11:56 +02:00
Joachim Van Herwegen
29ddf57341 feat: Add Finalizable interface 2021-06-14 16:11:56 +02:00
Joachim Van Herwegen
b604dd8331 feat: Add showStackTrace CLI variable 2021-06-07 13:54:38 +02:00
Joachim Van Herwegen
452032e312 feat: Split preset configurations by feature 2021-05-19 09:40:40 +02:00
jaxoncreed
1d65143e89
feat: Add identity provider (#455)
* Add identity provider handler as a dependency

* Temp Identity

* Figured out how to get koa to work

* Hooked up idp to networking

* Feat/idp architecture refactor (#430)

* Logs in with solid oidc

* Refactored Provider

* Attempt to hook up dependencies

* Partial wiring of oidc provider components

* IdP networking now works with architecture

* Interaction Handlers Set Up

* fix: Rename & adapt to CSS

* Included Login Interaction

* Refactored architecture to bind Interaction Policy to HttpHandlers

Co-authored-by: Matthieu Bosquet <matthieubosquet@gmail.com>

* fix: Rebase on master

* fix: DI after rebase

* Reimplemented Routing

* Renamed modules and removed ProviderFactory (#450)

* refactor: Solid IdP DI

* refactor: IdP interaction handler DI

* refactor: IdP interaction waterfall

* refactor: Remove unnecessary legacy URL parse

* fix: Add legacy parse back in

* feat: adapter & fix: handlers

* Removed adapter factory

* fix: refactor IdP

* fix: refactor IdP

* fix: refactor IdP

* feat: Add IdP to file storage config

* fix: Unintended commit

* fix: Components ignore

* feat: Basic resource store adapter

* Partially complete idp routing

* Set up initial routing injection graph

* Clean up ResourceStorageAdapter

* Refactored configuration architecture

* Hooked up Login UIs (#518)

* feat: Use template path & run fileserver

* feat: Use util function to read resource

* Fixed DI JSON-LD context

* fixed rendering

* WebId validator

* Set up persistent storage for loing and register

* Fixed ejs template routing

* Refactored StorageAdapters

* NSS login successful

* Forgot password infrastructure

* Can send email (#557)

* Can send email

* fix: IdP crashes if interaction ID doesn't exist (#587)

* feat: Require an issuer registration token

* fix: Issuer registration token typo in error

* fix: Remove dummy IdP storage adapter

* fix: Remove unused library lodash

* fix: Remove unused library lru-cache

* Production ready keystore

* Ruben comments before clownface removal

* Removed clownface

* Change key value store

* Completed Ruben's comments

* Added comments to each class

* Fixed errors on login

* Ruben feedback

* Refactored out getPostRenderHandler

* Identity provider tests (#622)

* corrected tests lacking <void> on promises

* Added files for all idp tests

* Added unfinished tests for all added files

* ErrorHandlingWaterfallHandler

* RenderEjsHandler and RouterHandler tests

* GetPostRouterHandler and BasicOnErrorHandler tests

* Corrected tests for updates to Idp

* fix: missing export

* fix: audience claim

* Client Id Support (#630)

* Added client_id for the auth challenge

* Update src/identity/storage/ClientWebIdFetchingStorageAdapterFactory.ts

Co-authored-by: Matthieu Bosquet <matthieubosquet@gmail.com>

Co-authored-by: Matthieu Bosquet <matthieubosquet@gmail.com>

* fix: Rebase fixes

* Several minor Idp changes/refactors (#656)

* fix: Minor changes

* refactor: Split EmailPasswordInteractionPolicy

* refactor: Remove ErrorHandlingWaterfallHandler

* refactor: Clean up dependencies

* fix: Add dummy IdentityProviderHandler to fix integration tests

* Replace KeyValueStore with KeyValueStorage (#663)

* feat: Create WrappedExpiringStorage

* refactor: Update ResourceStoreEmailPasswordStore to use KeyValueStorage

* refactor: Update KeyGeneratingIdpConfigurationGenerator to use KeyValueStorage

* refactor: Update ResourceStoreStorageAdapterFactory to use ExpiringStorage

* refactor: Removed KeyValueStore

* refactor: Simplify EmailPassword handlers (#664)

* refactor: Order index.ts

* test: Add EmailPasswordForgotPasswordHandler unit tests

* test: Add EmailPasswordGetResetPasswordHandler unit tests

* test: Add EmailPasswordLoginHandler unit tests

* test: Add EmailPasswordRegistrationHandler unit tests

* test: Add EmailPasswordResetPasswordHandler unit tests

* test: Remove unnecessary test file

* feat: Basic instructions for using the IdP

* fix: IdP instructions and add example WebID

* fix: IdP registration copy

* fix: IdP instruction editorial

* Update README.md

Co-authored-by: Joachim Van Herwegen <joachimvh@gmail.com>

* Update README.md

Co-authored-by: Joachim Van Herwegen <joachimvh@gmail.com>

* test: Add KeyGeneratingIdpConfigurationGenerator unit tests

* test: Add KeyValueEmailPasswordStore unit tests

* test: Create IdP integration test

* test: Add EmailPasswordInteractionPolicy unit tests

* test: Add BasicIssuerReferenceWebIdOwnershipValidator unit tests

* test: Add ChooseInitialInteractionHandler unit tests

Also fixes the config warning.

* test: Add EjsTemplateRenderer unit tests

* test: Add EmailSender unit tests

* test: Add FormDataUtil unit tests

* test: Add IdpRouteController unit tests

* test: Add OidcInteractionCompleter unit tests

* refactor: Simplify ClientWebIdFetchingStorageAdapterFactory

* test: Add ClientWebIdFetchingStorageAdapterFactory unit tests

* refactor: Fix ejs html warnings

* test: Add step to test logging in again

Included are updates to handle cookies more correctly.

* feat: Add IdpConfirmHttpHandler

This way there's a handler for the confirm page.

* test: Add ExpiringStorageAdapterFactory unit tests

* test: Add IdentityProviderFactory unit tests

* test: Add IdentityProviderHttpHandler unit tests

* refactor: Minor refactors

* refactor: Use jose instead of node-jose

* refactor: Use jose instead of node-jose

Reduces the number of dependencies since other libraries
also depend on jose.

* Update src/identity/configuration/KeyGeneratingIdpConfigurationGenerator.ts

Co-authored-by: Matthieu Bosquet <matthieubosquet@gmail.com>

* refactor: Use interfaces instead of abstract classes

* refactor: Make WebIdOwnershipValidator an AsyncHandler

* refactor: Make TemplateRenderer an AsyncHandler

* fix: Fix typing issue

* fix: Convert JWK to plain object for node 15

* feat: Update CI configuration

--ignore-scripts was removed because it also stopped dependency scripts,
which was a requirement for bcrypt.
15.0 was removed since that version doesn't run the required scripts after install.
14.0 was removed since the somehow it caused the solid-authn client to do the wrong calls.

* test: Run integration tests on Node 14.2

This is the lowest 14.x version where the IdP integration tests succeed.

* feat: Use ErrorResponseWriter for handling oidc errors

* test: Mock Date in OidcInteractionCompleter tests

* fix: Correctly generate new identifiers

Previously there could be double slashes if the base URL ended in slash.

* fix: Correctly handle storagePathName in ExpiringStorageAdapterFactory

* fix: Fix issue with new CliRunner test in rebase

* fix: Handle unknown errors more consistently

* feat: Make idp parameter dynamic

* feat: Add more logging

* refactor: Link css instead of injecting

* fix: Fix redis integration tests with idp

* refactor: Shorten idp class names

* refactor: Remove e-mail configuration from default config

* feat: Store JsonResourceStorage data in a single container

* feat: Make sure expired data gets removed at some point

* feat: Only accept strings as keys in KeyValueStorage

* fix: Various minor fixes based on review

Co-authored-by: Matthieu Bosquet <matthieubosquet@gmail.com>
Co-authored-by: Joachim Van Herwegen <joachimvh@gmail.com>
2021-05-04 13:17:43 +02:00
Ruben Taelman
d1eadd75e7
feat: Expose AppRunner.run for easily serving from JS apps
* feat: make methods in CliRunner public

* change: rename CliRunner to AppRunner

* fix: process being passed incorrectly to runCli

* feat: expose AppRunner.run for easily serving from JS apps

* change: only make run methods on AppRunner public
2021-04-28 09:59:10 +02:00
Joachim Van Herwegen
1d9b027a57 feat: Remove podTemplateFolder as a variable.
This is now possible due to TemplatedResourcesGenerator
accepting path strings relative to the module root.
2021-04-22 17:04:16 +02:00
Joachim Van Herwegen
a00de24ec0 fix: Prevent CliRunner tests from outputting errors 2021-04-02 12:54:54 +02:00
Arne Vandoorslaer
dd5b496f1d
fix: Fix issue when there are multiple values for the same CLI parameter
* fix: added check for multiple values for the same option

* Update test/unit/init/CliRunner.test.ts

Co-authored-by: Ruben Verborgh <ruben@verborgh.org>

* fix: made CliRunner.run sync

Co-authored-by: Ruben Verborgh <ruben@verborgh.org>
2021-03-05 11:00:24 +01:00
Arthur Joppart
1589def066
fix: Error when unknown parameters are passed to the main executable
* bug: error when unknown parameters are passed to the main executable

* bug: error on unknown paramters and adapted to review

* fix: test wont pass in ci

* Update src/init/CliRunner.ts

Co-authored-by: Ruben Verborgh <ruben@verborgh.org>

* fix: adapted to review

* fix: made CliRunner.run async

Co-authored-by: Arne Vandoorslaer <arne@digita.ai>
Co-authored-by: Ruben Verborgh <ruben@verborgh.org>
2021-03-04 11:41:13 +01:00
Joachim Van Herwegen
e500a82680 feat: Create configurations to integrate dynamic pod creation 2021-03-02 11:47:07 +01:00
Joachim Van Herwegen
28b077b84e feat: Create initializer to instantiate dynamic pods 2021-03-02 11:47:07 +01:00
Arne Vandoorslaer
b3f292d718
feat: Added resourceExists method to ResourceStore
* feat: added resourceExists method to ResourceStore

* Merge remote-tracking branch 'origin/main' into feat/add-resourceExists-method-to-ResourceStore

* fix: adapted to review

* fix: adapted to review
2021-02-25 13:43:58 +01:00
Joachim Van Herwegen
758f5ed083 feat: Generalize AclManager to AuxiliaryManager 2021-02-18 13:26:08 +01:00
Ruben Verborgh
b487dc738c fix: Create basic representations with streams. 2021-01-20 16:30:29 +01:00
Joachim Van Herwegen
cf6270d161 fix: Accept absolute paths in CliRunner 2021-01-19 10:54:37 +01:00
Joachim Van Herwegen
af88e130ff test: Always collect coverage
But only set the threshold when running unit tests specifically.
This way coverage for single classes can easily be tested.
2021-01-18 13:38:28 +01:00
Ruben Verborgh
e544e6dc11 feat: Allow custom root ACL. 2021-01-15 12:43:34 +01:00
Ruben Verborgh
a5413a64d3 refactor: Move pod templates to pod subfolder. 2021-01-15 12:43:34 +01:00
Joachim Van Herwegen
9160b52d5b refactor: Remove toSystemFilePath 2021-01-14 16:14:30 +01:00
Ruben Taelman
748476afbb refactor: Update to Components.js 4 2021-01-14 13:38:42 +01:00
Ruben Verborgh
f454b781ff fix: Join and normalize paths consistently. 2021-01-04 16:52:17 +01:00
Ruben Verborgh
c41c41d0e9 fix: Ensure root file path is absolute. 2021-01-01 18:57:21 +01:00
Ruben Verborgh
ba4f7ff26c feat: Add mainModulePath and globalModules CLI flags. 2021-01-01 18:25:35 +01:00
Ruben Verborgh
49551eb9eb fix: Distinguish instantiation and initialization errors. 2021-01-01 16:37:16 +01:00
Joachim Van Herwegen
231349b30d feat: Initialize root containers with RootContainerInitializer 2020-12-18 10:33:54 +01:00
Ruben Verborgh
73ae0c69e9 test: Remove mock error from test results.
Fixes https://github.com/solid/community-server/issues/406
2020-12-08 11:05:03 +01:00
Ruben Verborgh
badbe0032b refactor: Remove Setup. 2020-12-08 10:19:35 +01:00
Ruben Verborgh
04a91858c2 refactor: Split off ServerInitializer. 2020-12-08 10:19:35 +01:00
Ruben Verborgh
b0ecf1c1d8 refactor: Split off LoggerInitializer. 2020-12-08 10:19:35 +01:00
Ruben Verborgh
8fbb4f592e refactor: Split off AclInitializer. 2020-12-08 10:19:35 +01:00