File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
unit_tests/sources/declarative/auth Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 55import base64
66import json
77import logging
8+ from copy import deepcopy
89from datetime import timedelta , timezone
910from unittest .mock import Mock
1011
@@ -128,6 +129,20 @@ def test_refresh_with_encode_config_params(self):
128129 }
129130 assert body == expected
130131
132+ def test_client_secret_empty (self ):
133+ config_without_client_secret = deepcopy (config )
134+ del config_without_client_secret ["client_secret" ]
135+ oauth = DeclarativeOauth2Authenticator (
136+ token_refresh_endpoint = "{{ config['refresh_endpoint'] }}" ,
137+ client_id = "{{ config['client_id'] }}" ,
138+ client_secret = "{{ config['client_secret'] }}" ,
139+ config = config_without_client_secret ,
140+ parameters = {},
141+ grant_type = "client_credentials" ,
142+ )
143+ body = oauth .build_refresh_request_body ()
144+ assert body ["client_secret" ] == ""
145+
131146 def test_refresh_with_decode_config_params (self ):
132147 updated_config_fields = {
133148 "client_id" : base64 .b64encode (config ["client_id" ].encode ("utf-8" )).decode (),
You can’t perform that action at this time.
0 commit comments