grunt-couchapp icon indicating copy to clipboard operation
grunt-couchapp copied to clipboard

Add in support for basic auth and add genDB helper

Open chewbranca opened this issue 12 years ago • 5 comments

Quick patch to add in basic auth support.

Also added in a helper function genDB.

chewbranca avatar Nov 17 '12 00:11 chewbranca

Chewbranca, I can't find a corresponding API for this in Nano that matches what you've done here. Everything I'm reading about CouchDB recommends logging in through an account that's capable of working with databases, storing the cookie generated by the log-in pass, and then performing the necessary operations using the cookie as the authentication token. Can you comment on why you chose your method?

elfsternberg avatar Dec 07 '12 17:12 elfsternberg

@elfsternberg basic auth is the most direct form of authentication with CouchDB, and is a very common access pattern. http://wiki.apache.org/couchdb/Security_Features_Overview

I don't use Nano but this change works fine for user based authentication with CouchDB through grunt-couchapp.

chewbranca avatar Dec 07 '12 18:12 chewbranca

I strongly recommend getting and reusing an AuthSession cookie as a best practice. Future versions of CouchDB will ship with stronger (slower) authentication mechanisms that can be configured with a work factor.

rnewson avatar Jan 29 '13 19:01 rnewson

Bump.

This is a couchapp tool for uploading ddocs, so it should really only be making a handful of requests at a time.

Using user:pass@host is standard couchapp procedure as described here: http://couchapp.org/page/couchapp-config.

@elfsternberg any chance we could get this merged in? Deployments to CouchDB servers with auth are currently broken without this.

chewbranca avatar Mar 14 '13 23:03 chewbranca

Thanks @chewbranca for adding basic auth!

I've started using the add-basic-auth branch from your forked repository and it seems to be working fine.

I do hope this feature is merged into the main branch.

And thank you @elfsternberg for helping us all grunt out our couchapps.

bnfinet avatar Mar 28 '13 20:03 bnfinet