Skip to content

Upgrade to etcd v3.5.15

Latest

Choose a tag to compare

@daikk115 daikk115 released this 18 Jan 02:45
· 2 commits to master since this release

Using new proto of ETCD v3.5.15 with some new functions:

  1. user_add
  2. user_delete
  3. user_get
  4. user_list
  5. role_add
  6. role_delete
  7. role_get
  8. role_list
  9. role_grant_permission
  10. user_grant_role

Test Env

  • Python 3.8.10
  • ETCD v3.5.15 + SSL + Enable Auth + Client Cert Auth + Common Name
from etcd3 import Etcd3Client
CERT_PATH="/home/ubuntu/etcd/etcd-v3.5.15-linux-amd64/etcd-server.crt"
KEY_PATH="/home/ubuntu/etcd/etcd-v3.5.15-linux-amd64/etcd-server.key"
CA_PATH="/home/ubuntu/etcd/etcd-v3.5.15-linux-amd64/etcd-ca.crt"

client = Etcd3Client(host='192.168.100.122', port=2379, ca_cert=CA_PATH, cert_key=KEY_PATH, cert_cert=CERT_PATH, user="root", password="MyEasyPass")

client.user_add(name='test4', password='')  # Empty mean no_password
client.role_add(name='test4')
client.role_grant_permission(name='test4', key='/pub4', permType='READWRITE', prefix=True)
client.user_grant_role(user='test4', role='test4')