75 Commits

Author SHA1 Message Date
Joachim Van Herwegen
e1f95877da feat: Create ErrorHandler to convert errors to Representations 2021-06-07 13:54:38 +02:00
renovate[bot]
afc662ca9a
chore: Update (ts-)jest and use modern fake timers where possible
* chore(deps): update dependency jest to v27

* chore: Update (ts-)jest and use modern fake timers where possible

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Joachim Van Herwegen <joachimvh@gmail.com>
2021-05-31 15:29:14 +02:00
Joachim Van Herwegen
96a07e4853 refactor: Simplify resource metadata generation 2021-05-12 15:27:51 +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 Verborgh
2d89350ed5 fix: Improve identifier error messages. 2021-04-27 09:02:11 +02:00
Joachim Van Herwegen
e9917322e3 feat: Support $MODULE_PATH in StaticAssetHandler 2021-04-22 17:04:16 +02:00
Joachim Van Herwegen
0a420847dc test: Make sure PathUtil tests have full coverage 2021-04-22 17:04:16 +02:00
Arthur Joppart
99d0173213
feat: Add redis based locking mechanism
* feat: redis based locking mechanism

* fix: adapted to review and wrote unit tests

* fix: adapted to review(Woutermont)

* fix: adapted to review and expanded tests

* test: redlock integration tests

* test: corrected file name

* test: tests should run on CI now

* test: improved tests and minor changes according to review

* fix: forgot describeIf docker

* test: adapted to review

* test: Mock all redis dependencies

Co-authored-by: Joachim Van Herwegen <joachimvh@gmail.com>
2021-04-19 09:45:25 +02:00
Joachim Van Herwegen
953458231b fix: Prevent HttpRequest from being closed
In case a stream the request is being piped into closes,
we don't want to close the request since it shares a socket
with the response.
2021-04-09 09:04:25 +02:00
Brandon Aaron
de51a231e3
feat: Fallback to X-Forwarded-* headers
* Fallback to X-Forwarded-* headers

This uses the first value from X-Forwarded-Host and
X-Forwarded-Proto if they're present and the standard Forwarded
header is not.

* Update parseForwarded to handle X-Forwarded-*

This updates the signature for parseForwarded to take in the headers
and handle the logic of falling back to X-Forwarded-* headers.

* Update src/util/HeaderUtil.ts

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

* Inline parseXForwarded helper

Additionally fixes a typo, updates a unit test, and removes a
typing that is no longer necessary.

* Tweak handling of X-Forwarded value checking and assignment

* Fix: terminology & consistency suggestions from review

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

Co-authored-by: Ruben Verborgh <ruben@verborgh.org>
Co-authored-by: Wouter Termont <woutermont@gmail.com>
2021-03-23 12:44:43 +01:00
Arthur Joppart
ee88bf14de
feat: Added cloneRepresentation function to ResourceUtil
* feat: added cloneRepresentation function to ResourceUtil

* fix: adapted to review

* fix: adapted to review

Co-authored-by: Arne Vandoorslaer <arne@digita.ai>
2021-03-04 08:43:53 +01:00
Joachim Van Herwegen
0f00a8dffd feat: Update KeyValueStorage interface with entries function 2021-03-02 11:47:07 +01:00
Joachim Van Herwegen
29df380396 feat: Create SubdomainIdentifierStrategy
This strategy interprets all subdomains of the base to also be root containers.
2021-02-25 13:16:26 +01:00
Joachim Van Herwegen
fd45779159 feat: Pipe streams with the pump library
The library handles some edge cases we didn't yet.
The GuardedStream was also updated to ignore error listeners
already attached to the stream (since pump adds internal listeners).
2021-02-10 16:00:35 +01:00
Joachim Van Herwegen
a3f41c1d43 feat: Create GreedyReadWriteLocker using read/write locking algorithm 2021-02-09 14:35:12 +01:00
Joachim Van Herwegen
b61d46900f feat: Create new interface for lockers with only 1 kind of lock 2021-02-09 14:35:12 +01:00
Joachim Van Herwegen
386d78277d fix: Close unpiped streams 2021-01-29 15:42:34 +01:00
Joachim Van Herwegen
c29928c32c fix: Test error classes correctly 2021-01-29 09:40:10 +01:00
Ruben Verborgh
6e50443a39 fix: Preserve query string in transformations. 2021-01-29 09:12:49 +01:00
Ruben Verborgh
817cf3ac0d feat: Add ParallelHandler. 2021-01-27 11:29:35 +01:00
Ruben Verborgh
eb1440851a refactor: Move handlers into subfolder. 2021-01-27 11:29:35 +01:00
Joachim Van Herwegen
e752927171 fix: Remove all instanceof checks
This prevents problems with different environments.
Also introduces unit tests to double check HttpError values.
2021-01-25 16:11:43 +01:00
Joachim Van Herwegen
b59357ec30 feat: Update WrappedExpiringResourceLocker to new interface
Due to the new interface, it is now possible to throw an error
if there is a timeout which should make it easier
to find locking issues.
2021-01-22 11:34:51 +01:00
Joachim Van Herwegen
4d440c6c69 feat: Update ResourceLocker interface
By making use of withReadLock and withWriteLock instead
of acquiring the locks themselves it's easier to keep control
of what happens.
2021-01-22 11:34:51 +01:00
Ruben Verborgh
dd9d873122 feat: Implement UnsupportedAsyncHandler. 2021-01-20 14:36:17 +01:00
Joachim Van Herwegen
cf6270d161 fix: Accept absolute paths in CliRunner 2021-01-19 10:54:37 +01:00
Joachim Van Herwegen
9160b52d5b refactor: Remove toSystemFilePath 2021-01-14 16:14:30 +01:00
Joachim Van Herwegen
27cc1ec15e fix: Always keep guarded error listener attached 2021-01-12 17:15:05 +01:00
Ruben Verborgh
995a2dc74d feat: Add transformSafely. 2021-01-11 09:59:13 +01:00
Joachim Van Herwegen
fea726ae7d fix: Take baseIRI into account when calling parseQuads 2021-01-07 14:38:19 +01:00
Ruben Verborgh
8343dad7f1 refactor: Make createNamespace return regular objects. 2021-01-06 11:54:12 +01:00
Ruben Verborgh
87752ddf20 feat: Support writer prefixes.
Closes https://github.com/solid/community-server/issues/470
2021-01-06 11:36:21 +01:00
Ruben Verborgh
f9a20799eb refactor: Use declarations style for functions. 2021-01-06 11:24:43 +01:00
Ruben Verborgh
ba5c62059a feat: Validate Accept-DateTime. 2021-01-05 11:03:15 +01:00
Ruben Verborgh
f454b781ff fix: Join and normalize paths consistently. 2021-01-04 16:52:17 +01:00
Ruben Verborgh
2e188551f7 refactor: Rename UriUtil into TermUtil. 2021-01-02 23:19:01 +01:00
Ruben Verborgh
ae06e99067 refactor: Also create named nodes for vocabularies. 2021-01-02 23:15:51 +01:00
Ruben Verborgh
8e138c36d1 refactor: Use types to create vocabularies. 2021-01-02 22:56:25 +01:00
Ruben Verborgh
feaac1cf56 feat: Support strings in addQuad. 2021-01-02 18:13:28 +01:00
Ruben Verborgh
a572825909 refactor: Indicate caching on method name. 2021-01-02 17:50:17 +01:00
Ruben Verborgh
4faf916ece fix: Emit all guarded errors to all listeners. 2021-01-02 16:11:51 +01:00
Ruben Verborgh
147f3cf0c7 feat: Add RecordObject. 2020-12-22 00:33:33 +01:00
Joachim Van Herwegen
a114d00827 fix: Remove metadata content-type assumption from QuadUtil 2020-12-18 10:40:07 +01:00
Joachim Van Herwegen
f0db9e501f refactor: Replace getParentContainer util function with ContainerManager 2020-12-11 12:42:17 +01:00
Joachim Van Herwegen
9c080c2101 feat: Create ContainerManager for containing container conventions 2020-12-11 12:42:17 +01:00
Ruben Verborgh
f26178b1b5 change: Rename FirstCompositeHandler into WaterfallHandler. 2020-12-09 11:42:17 +01:00
Ruben Verborgh
ba47ce7951 change: Refactor AllVoidCompositeHandler into SequenceHandler. 2020-12-09 11:42:17 +01:00
Ruben Verborgh
9c933fd2d4 chore: Build to dist folder.
Closes https://github.com/solid/community-server/issues/136
2020-12-08 09:30:18 +01:00
Ruben Verborgh
ecfe3cfc46 feat: Support the Forwarded header. 2020-12-02 10:23:38 +01:00
Ruben Verborgh
357546e90f change: Clarify parent error message. 2020-12-01 20:10:53 +01:00