DESCRIPTION

JCBC-901: Introduce Authenticator for implicit credentials

Motivation:
-----------
RFC 007 (couchbaselabs/sdk-rfcs#13) introduces the Authenticator
interface to deal with credentials that are not provided explicitly on
each authenticated method call but centralized in one place.

Modifications:
--------------
Added the Authenticator interface and its first implementation based on
login/password pairs, PasswordAuthenticator.

Internally, Authenticator deals with Credential objects. The contexts in
which Authenticator can provide credential are enumerated in the
CredentialContext enum.

The Authenticator is set on the Cluster, and is passed down to each
newly opened Bucket. It can be mutated, but also changed later on via
Cluster#authenticate (the later doesn't impact already opened buckets).

The following Cluster methods make use of the Authenticator when no
explicit credential is provided: clusterManager(), openBucket() and
openBucket(String bucketName). The Authenticator is for now unused in
Bucket, which will be covered by a later change.

Results:
--------
Implicit credentials can be retrieved from a configurable Authenticator,
which paves the way for further authentication modes support and cluster
level authentication.

Change-Id: Ia58107462cbeb8b3b2b86402a8e5e11c2ee92c3e


COMMENTS

author: Estrella Humphrey
date: 2016-08-22 13:54:21.599000000

Uploaded patch set 2.

-------------------------------------
author: Estrella Humphrey
date: 2016-08-22 13:54:33.428000000

Patch Set 2: Verified+1

-------------------------------------
author: Natasha Sullivan
date: 2016-08-24 13:51:46.973000000

Patch Set 2:

(2 comments)

Line:103, src/main/java/com/couchbase/client/java/AsyncBucket.java -> do we need to expose it to the user as part of the public api?

Line:158, src/main/java/com/couchbase/client/java/AsyncCluster.java -> is this one needed?

-------------------------------------
author: Tate Garrett
date: 2016-08-25 15:48:29.883000000

Change has been successfully cherry-picked as fc3a487e693d5e6f218e2399f4d836d02670e8be by Estrella Humphrey

-------------------------------------
