thefrontside / simulacrum

A simulation platform for use during testing, during development and for high-fidelity application previews
91 stars 14 forks source link

Decouple Auth0 server from simulacrum #215

Closed cowboyd closed 2 years ago

cowboyd commented 2 years ago

Motivation

Sometimes you want the freedom to just embed an Auth0 server directly into Node without having to pay the overhead of managing a simulacrum process. This pattern is already in play with the LDAP server, and it actually greatly simplifies the simulacrum server code itself. Instead of defining endpoints and then having simulacrum create the server, we just say "hey, start a server, and just let me know what the port and protocol are".

Approach

This enables us to use the same simulator in both the simulacrum environment and also in any Node environment of our choosing by applying the same strategy to the Auth0 service as to the LDAP Service. The low level server accepts its list of people as an iterable, and any other information it may need from the environment. For example, rather than using the Slice of the simulation directly, it uses an adapter class similar to the Map API. That way it is easy to satify and adapt to.

Once this is complete, we can delete the LegacyResourceCreator interface and any code that requires it.

netlify[bot] commented 2 years ago

Deploy Preview for simulacrum canceled.

Name Link
Latest commit 875def0277a9c6d6d1f5ea05d8dbffcfcc65d1a2
Latest deploy log https://app.netlify.com/sites/simulacrum/deploys/6337cc3db8562a0008f60b3e
cowboyd commented 2 years ago

@dagda1 There's something wrong with the tests. Do you think you could help me debug it today?

dagda1 commented 2 years ago

@dagda1 There's something wrong with the tests. Do you think you could help me debug it today?

Of course. Just let me know when