(r, username, password)
| 115 | |
| 116 | |
| 117 | async def init_acl_user(r, username, password): |
| 118 | # reset the user |
| 119 | await r.acl_deluser(username) |
| 120 | if password: |
| 121 | assert ( |
| 122 | await r.acl_setuser( |
| 123 | username, |
| 124 | enabled=True, |
| 125 | passwords=["+" + password], |
| 126 | keys="~*", |
| 127 | commands=[ |
| 128 | "+ping", |
| 129 | "+command", |
| 130 | "+info", |
| 131 | "+select", |
| 132 | "+flushdb", |
| 133 | "+cluster", |
| 134 | ], |
| 135 | ) |
| 136 | is True |
| 137 | ) |
| 138 | else: |
| 139 | assert ( |
| 140 | await r.acl_setuser( |
| 141 | username, |
| 142 | enabled=True, |
| 143 | keys="~*", |
| 144 | commands=[ |
| 145 | "+ping", |
| 146 | "+command", |
| 147 | "+info", |
| 148 | "+select", |
| 149 | "+flushdb", |
| 150 | "+cluster", |
| 151 | ], |
| 152 | nopass=True, |
| 153 | ) |
| 154 | is True |
| 155 | ) |
| 156 | |
| 157 | |
| 158 | async def init_required_pass(r, password): |
no test coverage detected