A Clojure Memcached client (also: Couchbase, Kestrel). Built on top of SpyMemcached, supports ASCII and binary protocols, strives to be 100% feature complete.
Fixes issue #6.
+ Fix SASL authentication errors for Heroku users.
+ Allow passing an optional auth-type argument to
spyglass.client/bin-connection.
+ Pull out net.spy.memcached.auth.AuthDescriptor
construction to spyglass.client/auth-descriptor
function. Passing :plain or :cram-md5 keywords
specifies an auth mechanism. (AuthDescriptors
initialized with AuthDescriptor/typical threw
authentication errors for users connecting to
Heroku's default memcached servers).
Six months later and I've learned enough Clojure/Java to figure this out. This should fix authentication errors for users connecting to the default Heroku memcache add-ons.
Memcachier (one of the Heroku memcache add-on services) suggests using spymemcached version 2.8.9 or earlier. A spymemcached issue suggests creating an AuthDescriptor configured for plain auth only. In combination, these two fixes solve my original issue.
To downgrade to spymemcached 2.8.9 for use with Heroku, add it as a project.clj dependency and add an exclusion to the spyglass dependency. Also, make sure to include the spy-memcached maven repository:
If you need a connection configured with cram-md5 only, that's a keyword option, too. This is an optional arg—calling bin-connection without the extra keyword returns the original AuthDescriptor/typical.
I'm not sure how to write an automated test for this, but it doesn't break any existing ones. I've tested this fix successfully by hand with both default Heroku memcached services.
Six months later and I've learned enough Clojure/Java to figure this out. This should fix authentication errors for users connecting to the default Heroku memcache add-ons.
Memcachier (one of the Heroku memcache add-on services) suggests using spymemcached version 2.8.9 or earlier. A spymemcached issue suggests creating an
AuthDescriptor
configured for plain auth only. In combination, these two fixes solve my original issue.To downgrade to spymemcached 2.8.9 for use with Heroku, add it as a
project.clj
dependency and add an exclusion to the spyglass dependency. Also, make sure to include thespy-memcached
maven repository:Then, add a
:plain
argument to any calls toclient/bin-connection
to use a custom AuthDescriptor configured for plain authentication, e.g.:If you need a connection configured with cram-md5 only, that's a keyword option, too. This is an optional arg—calling
bin-connection
without the extra keyword returns the originalAuthDescriptor/typical
.I'm not sure how to write an automated test for this, but it doesn't break any existing ones. I've tested this fix successfully by hand with both default Heroku memcached services.