0    课程地址

https://coding.imooc.com/lesson/201.html#mid=12708

 

1    重点关注

1.1    密文设置acl,digest:密文设置,密文存

[zk: localhost:2181(CONNECTED) 1] create /names/wei wei 
Created /names/wei
[zk: localhost:2181(CONNECTED) 2] getAcl /names/wei 'world,'anyone : cdrwa
[zk: localhost:2181(CONNECTED) 3] setAcl /names/wei digest:imooc:XwEDaL3J0JQGkRQzM0DpO6zMzZs=:cdra

[zk: localhost:2181(CONNECTED) 4] getAcl /names/wei 'digest,'imooc:XwEDaL3J0JQGkRQzM0DpO6zMzZs= : cdra

 

 

1.2    登录用户查看权限,注意,未登录用户无法执行该用户下的权限

[zk: localhost:2181(CONNECTED) 6] get /names/wei
Authentication is not valid : /names/wei

[zk: localhost:2181(CONNECTED) 7] addauth digest imooc:imooc

[zk: localhost:2181(CONNECTED) 8] get /names/wei wei cZxid = 0x58 ctime = Thu Feb 22 06:41:07 CST 2024 mZxid = 0x58 mtime = Thu Feb 22 06:41:07 CST 2024 pZxid = 0x58 cversion = 0 dataVersion = 0 aclVersion = 1 ephemeralOwner = 0x0 dataLength = 3 numChildren = 0

[zk: localhost:2181(CONNECTED) 9] set /names/wei 22 Authentication is not valid : /names/wei
[zk: localhost:2181(CONNECTED) 10] delete /names/wei [zk: localhost:2181(CONNECTED) 11] ls /names/wei Node does not exist: /names/wei
[zk: localhost:2181(CONNECTED) 12] ls /names [imooc]

 

 

 

 

2    课程内容

2.1    本节内容

密文设置权限


 

 

3    Coding

 

posted on 2024-02-22 06:56  菜鸟乙  阅读(14)  评论(0编辑  收藏  举报