Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose pouchApp from spawnServer #1992

Merged
merged 1 commit into from Mar 24, 2020

Conversation

Julusian
Copy link
Contributor

This PR contains:

  • A NEW FEATURE

Describe the problem you have without this PR

I am wanting to use rxdb with pouchdb-auth, to provide user authentication, but I am unable to define an admin user at first startup.
This is because pouchdb-auth requires them to be defined as part of its config, which is only exposed on the pouchApp object this exposes. If an admin user is not defined, then every client will be an admin, so not having this control makes securing the master database on first startup very hard.

An example of how the result of this can be used for this is:

pouchApp.couchConfig.set('admins', 'admin1', 'password', cb);

There was some other fiddling I need to do with raw PouchDB databases to get the client side rxdb setup with pouchdb-auth, but that is fine. (I think just configuring pouchdb-auth with the special _users database)

Todos

  • Tests
  • Documentation
  • Typings
  • Changelog

@pubkey
Copy link
Owner

pubkey commented Mar 22, 2020

@Julusian thanks for the PR.
Please fix the typings and the changelog, then I can merge this. Also we need at least one test.

@Julusian
Copy link
Contributor Author

express-pouchdb doesn't have any typings that I can find, what do you want done here?
For the test is checking that the pouchApp property exists and looks roughly correct enough?

@pubkey pubkey merged commit 6cd110f into pubkey:master Mar 24, 2020
pubkey added a commit that referenced this pull request Mar 24, 2020
pubkey added a commit that referenced this pull request Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants