-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added SASL authentication support, for Memcached ver. 2.2.0 and above #36
base: master
Are you sure you want to change the base?
Conversation
Hi @kehati! Thanks for your work here! I've been a little skeptical of SASL connections to Memcached. Can you tell me a little bit more about why this is needed? Also, it's looking like this patch breaks the unit tests pretty badly. Any thoughts? |
Hi @tollmanz, The memcached binary protocol supports SASL authentication mechanism, providing a security layer to the connection. It's part of the binary protocol spec. As the PECL Memcached extension supports SASL authentication since version 2.2.0 (note the requirements: http://il1.php.net/manual/en/memcached.requirements.php), many users would want to implement secured connection to their memcached server using the SASL authentication mechanism and I think the library should support it. As the SASL mechanism requires the use of the binary protocol, I set the Memcached client to use it with: after looking into it, i think that almost all errors in the unit tests, as seen in the Travis CI, are caused by the test assertion trying to compare the key and the value previously set to the key and value fetched from the server, using the binary protocol which is fetching the CAS check as well (as part of the spec). For example: MemcachedUnitTests::test_get_delayed_by_key_returns_correct_values I think that if the unit tests will compare the keys and values only, they should succeed. |
Hi @kehati! I'm still trying to comprehend if this is something that should be merged into this library, but would be interested in getting this in a state that we can test a bit more thoroughly. Here are some things that I think we need to consider:
I've been reading up on this a bit to get a sense of the pros and cons of SASL. Do you have any information about performance impacts? I'm concerned that the latency in negotiating the secure connection could be a major performance issue. Do you know of any SaaS's out there that support the SASL memcached connections? I'd like to test against something like that. Thanks again for your work on this! |
I just noticed that you are with RedisLabs. I was looking at the service earlier as I was trying to answer the following question:
In looking through the service, I'm not seeing mention of SASL. Is this something you support? |
Regarding the config, I'd like to see this integrated in the global config discussed in #40. |
Hey @tollmanz ,
Thanks! |
No worries! I have a game plan for the this, which will be tracked in #40.
Given that you work as a Memcached cloud company, do you have any statistics on this performance? I'm really curious about it. I've only found a few reports of this and would love to have some more solid data.
Good to know! I'll be checking into this soon. I did some testing and got all but 4 tests to pass with the binary protocol, which I think is the first hurdle to getting SASL support. Only the CAS tests are failing. Hopefully that won't be too hard to figure out. I'll likely be re-writing how it is implemented to make sure that everything functions as usual, but there is an option to move to the binary protocol and SASL integration. |
@tollmanz - does that mean that currently this plugin don't support the binary protocol? |
Hi,
I added SASL auth support, for Memcached ver. 2.2.0 and above.
This also solves issue #32.
Thanks!