Posts

Showing posts with the label couchdb

How to implement a client to server connection that is secure and syncs

Image
Clash Royale CLAN TAG #URR8PPP How to implement a client to server connection that is secure and syncs I’m struggling to understand how the pouchDB interactions should be implemented. Say I want an offline-first app with syncing and auth, would I need to implement a middleman such as a node server to ensure my credentials to my main server are protected as having a PouchDB on the client with new PouchDB(‘name’, ‘https://username:password@server/dbname’) my creds to my main database are exposed. Would it be better to connect to a node server and that decide wether or not to allow access? How would this be done? Can I handle a direct connection to the server with auth and it be secure? Or is a middle man needed to ensure security. If a middle man is needed will you need to implement a sort of api i.e //client const db = new Pouch('days') db.sync(remote) //server app.get('/db/days', (res, req) => // do some pouch stuff for each db) https://github.com/pouchdb-community/p...

PouchDB sync authorization?

Image
Clash Royale CLAN TAG #URR8PPP PouchDB sync authorization? How do I ensure that the current user has authorization to access a CouchDB database via PouchDB? From my experimentation, calling the new PouchDB() method with the CouchDB database name grants you access to that data. Setting require_valid_user to true in Futon seems to work, but the Futon modal window still pops up after authenticating the user via POST /_session. I want to have a standard login screen (username and password) that logs the user into my application and grants access to the correct CouchDB database (via PouchDB). I can I do this? Any help will be greatly appreciated. You may want to check out this plugin github.com/nolanlawson/pouchdb-authentication – twilson63 Jan 13 '15 at 2:54 1 Answer 1 ...