File tree 2 files changed +11
-6
lines changed
selenium/webdriver/remote
test/unit/selenium/webdriver/remote
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,10 @@ def auth_type(self) -> str:
209
209
@auth_type .setter
210
210
def auth_type (self , value : str ) -> None :
211
211
"""Sets the type of authentication to the remote server if it is not
212
- using basic with username and password."""
212
+ using basic with username and password.
213
+
214
+ Support values: Bearer, X-API-Key. For others, please use `extra_headers` instead
215
+ """
213
216
self ._auth_type = value
214
217
215
218
@property
@@ -220,10 +223,7 @@ def token(self) -> str:
220
223
@token .setter
221
224
def token (self , value : str ) -> None :
222
225
"""Sets the token used for authentication to the remote server if
223
- auth_type is not basic.
224
-
225
- Support values: Bearer, X-API-Key. For others, please use `extra_headers` instead.
226
- """
226
+ auth_type is not basic."""
227
227
self ._token = value
228
228
229
229
@property
Original file line number Diff line number Diff line change @@ -69,8 +69,13 @@ def test_get_remote_connection_headers_defaults():
69
69
70
70
def test_get_remote_connection_headers_adds_auth_header_if_pass ():
71
71
url = "http://user:pass@remote"
72
- headers = RemoteConnection .get_remote_connection_headers (parse .urlparse (url ))
72
+ with pytest .warns (None ) as record :
73
+ headers = RemoteConnection .get_remote_connection_headers (parse .urlparse (url ))
73
74
assert headers .get ("Authorization" ) == "Basic dXNlcjpwYXNz"
75
+ assert (
76
+ record [0 ].message .args [0 ]
77
+ == "Embedding username and password in URL could be insecure, use ClientConfig instead"
78
+ )
74
79
75
80
76
81
def test_get_remote_connection_headers_adds_keep_alive_if_requested ():
You can’t perform that action at this time.
0 commit comments