File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -707,12 +707,16 @@ def request(
707707 ):
708708 auth_types = self .extract_auth_types (r_headers ["WWW-Authenticate" ])
709709
710- if self .password and self . username and "digest" in auth_types :
710+ if self .username and "digest" in auth_types :
711711 self .auth = niquests .auth .HTTPDigestAuth (self .username , self .password )
712- elif self .password and self . username and "basic" in auth_types :
712+ elif self .username and "basic" in auth_types :
713713 self .auth = niquests .auth .HTTPBasicAuth (self .username , self .password )
714714 elif self .password and "bearer" in auth_types :
715715 self .auth = HTTPBearerAuth (self .password )
716+ elif "bearer" in auth_types :
717+ raise error .AuthorizationError (
718+ reason = "Server provides bearer auth, but no password given. The bearer token should be configured as password"
719+ )
716720 else :
717721 raise NotImplementedError (
718722 "The server does not provide any of the currently "
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ def teardown_radicale(self):
138138 "url" : url ,
139139 "name" : "LocalRadicale" ,
140140 "username" : "user1" ,
141- "password" : "any-password-seems-to-work " ,
141+ "password" : "" ,
142142 "backwards_compatibility_url" : url + "user1" ,
143143 "incompatibilities" : compatibility_issues .radicale ,
144144 "setup" : setup_radicale ,
You can’t perform that action at this time.
0 commit comments