Seagate/kinetic-py — pull request #2 by rpcope1 (2014-06-05 16:05:51+00:00)
Title: Master

Nacho, I submit humbly for your review my changes to add the SECURITY Kinetic command in whole to the Python client. How security can now be set:

>> import kinetic
>> c = kinetic.Client(MYIP)
>> c.put('TEST', 'TEST')
>> ac = kinetic.AdminClient(MYIP)
>> acl = kinetic.ACL()
>> domain = kinetic.Domain()
>> domain.setRoles([Roles.READ])
>> acl.setDomains([domain])
>> acl.setIdentity(1000)
>> ac.setSecurity([acl])
#Now, when we start a client with identity 1000, all it should be able to do is read.
>> c2 = kinetic.Client(MYIP, identity=1000)
>> c2.get('TEST') # Should work.
>> c2.put('TEST2', 'TEST2') # Should raise an error.

I tried to mirror what was done in the Java client, and I think everything related to security should be fully implemented. I also added the GETVERSION command to the client for the sake of completeness. I've tested the security stuff here, and it seems to work pretty well, but I'm certainly open to feedback. Thanks in advance for your consideration.