thefrontside / simulacrum

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

Allow LDAP server to be standalone a resource #184

Closed cowboyd closed 2 years ago

cowboyd commented 2 years ago

Motivation

In the article about running ingestion tests for backstage, we need to run a simulated LDAP server outside the context of simulacrum. The primary reason for this is that we do not need yet to introduce the concept of simulacrum as its own thing. It just complicates the world.

Approach

This just splits the LDAP simulator into two layers, the server resource, created by createLDAPServer and the service resource that adapts it into the Simulacrum context createLDAPService(). The user data is represented as an Iterable which is the lowest level JS format for specifying a list of values. It could be an arry, or it could be something more.

Examples

let server = yield createLDAPServer({
  port: 3890,
  users: [{ email: 'admin@user.org', password: 'admin' }]
});
netlify[bot] commented 2 years ago

✔️ Deploy Preview for simulacrum canceled.

🔨 Explore the source changes: a47027705cb8976dc97f5b274a3582b8c665dadb

🔍 Inspect the deploy log: https://app.netlify.com/sites/simulacrum/deploys/6230872bd783880008b11f1c