couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <fdman...@apache.org>
Subject Re: How does OAuth support, or custom headers, work in the replicator?
Date Tue, 22 May 2012 00:57:54 GMT
Ultimate source of truth, the test suite:

https://github.com/apache/couchdb/blob/1.2.0/share/www/script/test/oauth.js#L75

It's (source | target).auth.oauth.(consumer_key | consumer_secret |
token | token_secret)

On Mon, May 21, 2012 at 10:43 PM, Jens Alfke <jens@couchbase.com> wrote:
>
> On May 21, 2012, at 2:28 PM, Jim Klo wrote:
>> I'm a bit confused though by your statement Adam (and maybe I'm being a bit naive),
but that doesn't quite jive with me..
>> is the resultant replicator doc something like this?
>
> My understanding is that it looks like this:
>
> {
>        "source": "widgets",
>        "target": {
>                        "url": "https://www.example.com/couchdb/widgets",
>                        "oauth": {
>                                "consumer_secret": "...",
>                                "consumer_key": "...",
>                                "token_secret": "...",
>                                "token": "....",
>                                "signature_method": "…"
>
> The "source" or "target" property can optionally be an object with the URL in a "url"
property, instead of just a string. This allows extra metadata, like headers or auth, to be
added to it.
>
> However, Adam says "It looks like e.g. source.auth.oauth would be a JSON object…" whereas
the Replication page on the wiki says to add the "oauth" key directly to the source or target
object. I illustrated the latter above, but I'm not sure which is correct.
>
> —Jens

-- 
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Mime
View raw message