Re: Options for OAuth with CouchDB

2015-08-30 Thread Martin Higham
We implemented Facebook and Twitter OAuth quite a while ago - https://github.com/ocastalabs/CouchDB-XO_Auth I haven't tried it with the latest CouchDB but really should find the time to do so. The worst case is that is gives you a great place to start Google OAuth should be an exact copy of Faceb

Re: Rewriting query keys

2013-11-30 Thread Martin Higham
If you could provide the code for the view you are using then it would be easier to supply the rewrite you need On 29 November 2013 20:57, Oliver Schmidt wrote: > Thanks, but I CouchDB complains that I don't use valid JSON. I need a > composed key as an array, how can I achieve this? > > > >

Re: OAuth via _users db

2013-05-17 Thread Martin Higham
We use OAuth with our apps. The only part that is dynamic is the creation and sharing of the personal tokens. We dont need full 3 legged auth as we control the ecosystem and embed the pre-generated consumer keys in the app. There is no way that I know of to combine _user & .ini pairs and I'm not s

Re: database per user architecture couchapp

2013-02-22 Thread Martin Higham
Daemons didn't replace externals. There is no way to configure a daemon to handle a URL without an Apache or nginx server doing the routing. External services can also receive authenticated user contexts. The downside with externals is no Iris Couch, no Cloudant and no Big Couch which is all a bit

Re: Help! 2-legged OAuth Example Anyone?

2013-02-21 Thread Martin Higham
On Sunday, February 17, 2013, Mike Harding wrote: > hi Алекс, Thanks for your response! > > Am I correct in assuming in this script > > https://github.com/apache/couchdb/blob/master/share/www/script/test/oauth.js > that the test user 'jason' is defined as a oauth user in the couchdb > default.ini

Re: can i listen to changes of whole server, not per-db?

2012-10-10 Thread Martin Higham
We had a similar problem. Initially we had each database replicate appropriate documents (via a replication filter) to a queue database and just listened for changes to that. The resource overhead for this when most databases are dormant didn't make make sense. So we now have a custom handler that

Re: Twitter OAuth via iriscouch or cloudant

2012-06-29 Thread Martin Higham
Iriscouch use our CouchDB-XOAuth plugin ( https://github.com/ocastalabs/CouchDB-XO_Auth). We recently updated this to added Twitter support. I don't know if they have incorporated this version yet. Martin On Friday, 29 June 2012, Wordit wrote: > I've seen iriscouch now has a Facebook OAuth modul

Re: how to make queries with logical operators?

2012-05-27 Thread Martin Higham
Yes, you need to write a view with a map function ( http://wiki.apache.org/couchdb/HTTP_view_API) that emits an index of the doc type. e.g. emit(doc.type, doc) and then pass an array of the types you want to retrieve as the keys query parameter to the view For instance if you called the desi

Re: How does OAuth support, or custom headers, work in the replicator?

2012-05-21 Thread Martin Higham
ature method is pretty much always HMAC-SHA1 On Monday, 21 May 2012, Jens Alfke wrote: > > On May 20, 2012, at 4:02 AM, Martin Higham wrote: > > > - The fields in the replication structure are fine if you want CouchDB to > > replicate to CouchDB, but I think in your case you want t

Re: Why is the _id called id in the response from a put request?

2012-05-20 Thread Martin Higham
_id and _rev are field names within a document, whereas the non-underscore versions are copies of those values. On 20 May 2012 11:35, Goog Cheng wrote: > On 05/20/2012 06:16 PM, Alexander Gabriel wrote: > >> I am using jquery.couch.js. >> In a openDoc() the return key for the _id is named "_id".

Re: How does OAuth support, or custom headers, work in the replicator?

2012-05-20 Thread Martin Higham
Hi Jens, - CouchDB supports OAuth 1.0, not 2.0 - The fields in the replication structure are fine if you want CouchDB to replicate to CouchDB, but I think in your case you want to OAuth requests from a client to CouchDB so you will want to sign each request yourself. - We use the OAuthConsumer l

New version of the Facebook auth plugin

2012-03-21 Thread Martin Higham
Our CouchDB Facebook authentication plugin has been available for a while during this time a number of shortcomings and problems have been identified. We have now rewritten this plugin in a more generic manner so that we can easily add other external OAuth authentication services such as Twitter. U

Re: OAuth request_token

2012-02-13 Thread Martin Higham
CouchDB supports authorisation via OAuth signed requests but does not yet support full, 3-legged OAuth. In order to sign the request you will either have to hard code the OAuth token/secret into the client or find some other way to securely extract them. On 11 February 2012 12:37, Stephan Uhle

Re: how to implement a database for every user

2012-01-12 Thread Martin Higham
My https://github.com/ocasta/CouchDB-Selfservice project should give you a starting point. Unfortunately I don't believe there is anyway to configure external processes on Iris Couch. > On 01/11/2012 05:18 PM, Alexander Gabriel wrote: >> >> Hi >> >> I have a couchapp hosted on iriscouch ( >> htt

Re: couchDB with databases per user: continuous replications stop working, without errors

2012-01-05 Thread Martin Higham
Yes, I am working on a similar setup. I ran into replication problems as the number of databases increased. I've switched to the 1.2 trunk build as replication has been radically modified and seems more reliable. On 5 January 2012 12:53, Gregor Martynus wrote: > Thanks all for your responses! T

Re: Working example for OAuth with Facebook and/or Google?

2011-10-08 Thread Martin Higham
There's also our Facebook Authentication module for Couch on GitHub https://github.com/ocastalabs/CouchDB-Facebook-Authentication On 8 Oct 2011, at 04:04, Max Ogden wrote: > Hi Stephan, > > The OAuth in couch is meant to provide OAuth verification as opposed to what > you want which is a re

Re: Implementing Authorization control for Self-Enrollers in a pure Couchapp

2011-08-01 Thread Martin Higham
Take a look at my example service in github http://github.com/ocasta/CouchDB-Selfservice On 1 August 2011 18:19, Jan Wedekind wrote: > On Tue, Jul 19, 2011 at 02:12, Randall Leeds >wrote: > > > > -- Forwarded message -- > > > From: Alex Aitken > > > Date: Thu, Jul 14, 2011 a

Facebook Authentication

2011-06-07 Thread Martin Higham
Just letting people know that we've just released a Facebook CouchDB Authentication module on GitHub. This uses the Facebook Authentication API to authenticate users and create a CouchDB session for them. https://github.com/ocastalabs/CouchDB-Facebook-Authentication

Re: Any existing code/samples/examples for couchdb self service?

2011-05-27 Thread Martin Higham
> wrote: > Hi Martin > > Following up on this - any chance the code or some portion of it might be > accessible so we can see how you solved it? > > thanks > > > as > > > On 08/05/2011, at 6:10 AM, Martin Higham wrote: > > We do this in one of app

Re: Any existing code/samples/examples for couchdb self service?

2011-05-07 Thread Martin Higham
We do this in one of apps. We have an CouchDB external process that makes all the necessary calls to create the database (by replicating a template database), creating the user account and then setting security roles. I'll see what I can do to make the code publicly available. Martin On 7 Ma

Re: Creating databases on demand

2010-11-23 Thread Martin Higham
You can write an external process that performs all the steps necessary to 'register' a new user. This can create the new private database if the necessary admin credentials are available. The new database can be created in a number of ways; by cloning an existing template database, by invoking co

Re: OAuth example

2010-11-03 Thread Martin Higham
not vice versa... >> >> ~ >> Doug. >> >> On Wed, Nov 3, 2010 at 3:52 PM, Wordit Ltd >> wrote: >> >> > On Tue, Nov 2, 2010 at 10:18 AM, Martin Higham >> > wrote: >> > > >> > > The CouchDB OAuth implementation is a

Re: Sharing design documents between DBs

2010-11-02 Thread Martin Higham
ot; db's on each of the instances. In either case, you'd only be > generating HTTP traffic on the pushing of the app and/or replication of the > "app" db's between the machines--so, very low network overhead in either > case. > > Later, > Benjamin > >

Re: OAuth example

2010-11-02 Thread Martin Higham
The CouchDB OAuth implementation is a partial implementation that supports the OAuth signing of requests where the client has it's client credentials and knows the user's access token. There are two _oauth special URLs _oauth/request_token and _oauth/authorize but I don't think these are fully imp

Re: Sharing design documents between DBs

2010-11-01 Thread Martin Higham
s the "middle-ware" setup, but then you'd loose the > power > of application replication. > > Thoughts? > > Later, > Benjamin > > On Mon, Nov 1, 2010 at 10:30 AM, Martin Higham >wrote: > > > Until you have one DB per user and then you're l

Re: Sharing design documents between DBs

2010-11-01 Thread Martin Higham
Until you have one DB per user and then you're looking at replicating the design doc to many thousands of databases and continuous replication doesn't make sense Martin On 1 November 2010 14:11, Benjamin Young wrote: > Hey Gregor, > > If you setup continuous replication between your various cus

Re: how do you authenticate a user to view their own database

2010-08-24 Thread Martin Higham
On 23 August 2010 19:13, wrote: > > I'm confused about the _users authentication vs the authorization for an > individual database under _security. > > I want a person to signup on my website so they can store their own data. > So I create a database for them. > joesdatabase > > Another user sign

Re: Struggling with a particular Map / Reduce

2010-08-17 Thread Martin Higham
I think it would be better to use the View to split the titles and create a list of Authors and Titles. A Map function such as function(doc) { for (title in doc.titles) emit([doc.docAuthor, doc.titles[title]], null); } does just this. You now have a list of keys in the form [Author, titl

Re: Create document with update handler (without sending an id)

2010-07-28 Thread Martin Higham
that? I'm very impressed! > > Thanks again, and nice day, > > alux > > > On 28 July 2010 10:21, Martin Higham wrote: > > > I had the same problem and was about to embark on a similar solution when > I > > discovered that the req object passed into the update

Re: Create document with update handler (without sending an id)

2010-07-28 Thread Martin Higham
I had the same problem and was about to embark on a similar solution when I discovered that the req object passed into the update handler contains a uuid for you to use. So all you need to do is function(doc, req) { var newDoc = JSON.parse(req.body); if (!doc){ newDoc._id = req.uuid; ...

Re: Authentication

2010-06-10 Thread Martin Higham
The best I found was http://wiki.apache.org/couchdb/Authentication_and_Authorization but that's not much to go on. I've therefore spend a little time trying to understand what and how it works. The oauth.ini file contains all the keys, tokens and secrets. Within that there are three sections [oau

Re: Simulating SQL 'LIKE %' using Regular Expressions

2010-06-02 Thread Martin Higham
couchdb-lucene gives you all the flexibility you need for partial text matching against field values On 2 June 2010 09:01, Dave Cottlehuber wrote: > On 2 June 2010 17:11, wrote: > > hmm... > > > > so would that mean that if I typed in ?key="Image/" > [...] > > similar to saying select mime-typ

Re: who to set up readers for databases

2010-05-19 Thread Martin Higham
You'll find the information you are looking for on the wiki http://wiki.apache.org/couchdb/Security_Features_Overview On 19 May 2010 10:06, Bernhard Schauer wrote: > Hello, > > I want to set up a DB so that only one 'reader' (I think that is the > correct term) can read and write documents to

Re: Importing sample data with couchApp

2010-01-06 Thread Martin Higham
Put the .json files in a directory called _docs, where is the id for the document. 2010/1/6 Chris Anderson > On Wed, Jan 6, 2010 at 10:18 AM, Luciano Resende > wrote: > > On Wed, Jan 6, 2010 at 9:59 AM, Klaus Pieslinger > > wrote: > >> Just curious, but why don't you just import the