0 课程地址
https://coding.imooc.com/lesson/201.html#mid=12707
1 重点关注
1.1 密文设置acl,auth:明文设置,密文存
--添加注册用户的用户名和用户密码 用户名:imooc,密码:imooc addauth digest imooc:imooc --设置权限 setAcl /names/imooc auth:imooc:imooc:cdrwa --获取权限 getAcl /imooc/abc --返回结果: 'digest,'imooc:XwEDaL3J0JQGkRQzM0DpO6zMzZs= : cdrwa
1.2 注意,用户没有登录时不注册用户无法设置权限,用户登录后除非切换注册用户,否则设置权限还是该用户
- 用户没有登录时不注册用户无法设置权限
create /names names Created /names [zk: localhost:2181(CONNECTED) 5] create /names/imooc imooc Created /names/imooc [zk: localhost:2181(CONNECTED) 6] getAcl /names/imooc 'world,'anyone : cdrwa [zk: localhost:2181(CONNECTED) 7] setAcl /names/imooc auth:imooc:imooc:cdrwa Acl is not valid : /names/imooc
- 用户登录后除非切换注册用户,否则设置权限还是该用户
[zk: localhost:2181(CONNECTED) 8] addauth digest imooc:imooc [zk: localhost:2181(CONNECTED) 9] setAcl /names/imooc auth:imooc:imooc:cdrwa [zk: localhost:2181(CONNECTED) 10] getAcl /names/imooc 'digest,'imooc:XwEDaL3J0JQGkRQzM0DpO6zMzZs= : cdrwa [zk: localhost:2181(CONNECTED) 11] setAcl /names/imooc auth:wei:wei:cdrwa [zk: localhost:2181(CONNECTED) 12] getAcl /names/imooc 'digest,'imooc:XwEDaL3J0JQGkRQzM0DpO6zMzZs= : cdrwa [zk: localhost:2181(CONNECTED) 14] setAcl /names/imooc auth::cdrwa [zk: localhost:2181(CONNECTED) 16] getAcl /names/imooc 'digest,'imooc:XwEDaL3J0JQGkRQzM0DpO6zMzZs= : cdrwa
2 课程内容
2.1 本节内容
密文权限设置
3 Coding
诸葛