docker-library / memcached

Docker Official Image packaging for memcached
http://memcached.org/
BSD 3-Clause "New" or "Revised" License
131 stars 99 forks source link

Add SASL password file support with PLAIN mechanism #48

Closed beornf closed 5 years ago

beornf commented 5 years ago

During testing out SASL support I noticed there are no libraries for user auth in the image (e.g. PLAIN, LOGIN, CRAM-MD5, DIGEST-MD5). Hence the --enable-sasl flag only allows you to run memcached with -S and fails to list mechanisms during auth. Since most memcached clients only supportPLAIN I've added this to alpine and all auth modules (including PLAIN) to debian (mentioned here https://github.com/memcached/memcached/wiki/SASLHowto).

By adding the --enable-sasl-pwdb flag you can accomplish server side auth in a simplified manner. By creating a plaintext file with username:password and pointing to it from MEMCACHED_SASL_PWDB variable you can skip the step to generate a password file with saslpasswd2 (https://github.com/memcached/memcached/wiki/ReleaseNotes145#sasl_pwdb-for-more-simple-auth-deployments).

Both these changes should satisfy the general use case of an optional auth layer on top of memcached.

tianon commented 5 years ago

Sorry for the delay! I've pushed another commit that does some minor shuffling of where things get installed, but this LGTM! Thanks for the contribution! :+1: