DESCRIPTION

JCBC-346: Supporting CRAM-MD5 as a SASL mechanism.

This changeset implements support for CRAM-MD5 as SASL mechanism,
by sending a "list sasl mechs" first. Depending on the response,
either CRAM-MD5 or PLAIN will be used.

Regular memcached servers wil make use of PLAIN as before, but
systems that support it (like couchbase) will use the more secure
variant.

The list sasl mechs process will only proceed if the AuthDescriptor
either gets null or an empty list of mechanisms in order to be
backwards compatible, so no changes to code need to be done when
upgrading to a new version.

Change-Id: I7c7e935e4307c181f98e5ff5615b18cba3f403b4


COMMENTS

author: Natasha Sullivan
date: 2013-08-20 10:54:49.901000000

Uploaded patch set 6.

-------------------------------------
author: Kenny Maynard
date: 2013-08-20 20:01:31.826000000

Patch Set 6:

(2 comments)

Looks good, but I noted two minor things to fix. Also, this doesn't quite correspond to what the SASL Library does by default. It looks like what your doing is just passing the mechanism that you want to authenticate with to the client library. In some of the examples I saw you pass all of the mechanisms to the client library and then pass some security attributes and the library choses the best mechanism for you. I'm fine either way you do it, but I did want to note the two different approaches.

Line:69, src/main/java/net/spy/memcached/BinaryConnectionFactory.java -> This bracket looks off by a space.

Line:71, src/main/java/net/spy/memcached/protocol/binary/SASLBaseOperationImpl.java -> Whitespace

-------------------------------------
author: Natasha Sullivan
date: 2013-08-21 06:42:16.481000000

Patch Set 6:

Hm, aside from the small fixes I'm not sure I can quite follow.

My idea was to implement the list mechs first, and whatever comes back there gets passed to the javax.SASL which will pick the strongest one by default.

Aside from that, since we'll ship this with 2.9.2 as a bugfix release, my intention was to not break something for other people, so I changed the code to only do the list mechs if an empty mechs list is passed in from the AuthDescriptor. That way, people can 1) override the list mechs if needed 2) specify explicitly what they want to have.

The example docs I added just show how to override it, and the corresponding JCBC changeset passes the empty list so for couchbase, it will do the list mechs all the time.

Or maybe I understood you wrong?

-------------------------------------
author: Kenny Maynard
date: 2013-08-22 23:52:20.198000000

Patch Set 6: Code-Review+2

You didn't do anything wrong I was just mentioning a different approach, but maybe you actually did what I was thinking. Can I see the docs you wrote to check?

-------------------------------------
author: Kenny Maynard
date: 2013-08-22 23:52:52.883000000

Patch Set 6: -Code-Review

Just realized the comments aren't addressed in this patch set.

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