@@ -83,10 +83,12 @@ def test_create_func_docstring_empty_description():
83
83
84
84
85
85
def test_identify_required_authn_params_none_required ():
86
- """Test when no authentication parameters are required initially."""
87
- req_authn_params = {}
86
+ """Test when no authentication parameters or authorization tokens are required initially."""
87
+ req_authn_params : dict [str , list [str ]] = {}
88
+ req_authz_tokens : list [str ] = []
88
89
auth_service_names = ["service_a" , "service_b" ]
89
- expected = {}
90
+ expected_params = {}
91
+ expected_authz : list [str ] = []
90
92
expected_used = set ()
91
93
result = identify_required_authn_params (
92
94
req_authn_params , req_authz_tokens , auth_service_names
@@ -99,11 +101,12 @@ def test_identify_required_authn_params_none_required():
99
101
100
102
101
103
def test_identify_required_authn_params_all_covered ():
102
- """Test when all required parameters are covered by available services ."""
104
+ """Test when all required authn parameters are covered, no authz tokens ."""
103
105
req_authn_params = {
104
106
"token_a" : ["service_a" ],
105
107
"token_b" : ["service_b" , "service_c" ],
106
108
}
109
+ req_authz_tokens : list [str ] = []
107
110
auth_service_names = ["service_a" , "service_b" ]
108
111
expected_params = {}
109
112
expected_authz : list [str ] = []
@@ -119,15 +122,16 @@ def test_identify_required_authn_params_all_covered():
119
122
120
123
121
124
def test_identify_required_authn_params_some_covered ():
122
- """Test when some parameters are covered, and some are not."""
125
+ """Test when some authn parameters are covered, and some are not, no authz tokens ."""
123
126
req_authn_params = {
124
127
"token_a" : ["service_a" ],
125
128
"token_b" : ["service_b" , "service_c" ],
126
129
"token_d" : ["service_d" ],
127
130
"token_e" : ["service_e" , "service_f" ],
128
131
}
132
+ req_authz_tokens : list [str ] = []
129
133
auth_service_names = ["service_a" , "service_b" ]
130
- expected = {
134
+ expected_params = {
131
135
"token_d" : ["service_d" ],
132
136
"token_e" : ["service_e" , "service_f" ],
133
137
}
@@ -145,16 +149,18 @@ def test_identify_required_authn_params_some_covered():
145
149
146
150
147
151
def test_identify_required_authn_params_none_covered ():
148
- """Test when none of the required parameters are covered."""
152
+ """Test when none of the required authn parameters are covered, no authz tokens ."""
149
153
req_authn_params = {
150
154
"token_d" : ["service_d" ],
151
155
"token_e" : ["service_e" , "service_f" ],
152
156
}
157
+ req_authz_tokens : list [str ] = []
153
158
auth_service_names = ["service_a" , "service_b" ]
154
- expected = {
159
+ expected_params = {
155
160
"token_d" : ["service_d" ],
156
161
"token_e" : ["service_e" , "service_f" ],
157
162
}
163
+ expected_authz : list [str ] = []
158
164
expected_used = set ()
159
165
result = identify_required_authn_params (
160
166
req_authn_params , req_authz_tokens , auth_service_names
@@ -167,16 +173,18 @@ def test_identify_required_authn_params_none_covered():
167
173
168
174
169
175
def test_identify_required_authn_params_no_available_services ():
170
- """Test when no authentication services are available."""
176
+ """Test when no authn services are available, no authz tokens ."""
171
177
req_authn_params = {
172
178
"token_a" : ["service_a" ],
173
179
"token_b" : ["service_b" , "service_c" ],
174
180
}
175
- auth_service_names = []
176
- expected = {
181
+ req_authz_tokens : list [str ] = []
182
+ auth_service_names : list [str ] = []
183
+ expected_params = {
177
184
"token_a" : ["service_a" ],
178
185
"token_b" : ["service_b" , "service_c" ],
179
186
}
187
+ expected_authz : list [str ] = []
180
188
expected_used = set ()
181
189
result = identify_required_authn_params (
182
190
req_authn_params , req_authz_tokens , auth_service_names
@@ -189,14 +197,16 @@ def test_identify_required_authn_params_no_available_services():
189
197
190
198
191
199
def test_identify_required_authn_params_empty_services_for_param ():
192
- """Test edge case where a param requires an empty list of services."""
200
+ """Test edge case: authn param requires an empty list of services, no authz tokens ."""
193
201
req_authn_params = {
194
202
"token_x" : [],
195
203
}
204
+ req_authz_tokens : list [str ] = []
196
205
auth_service_names = ["service_a" ]
197
- expected = {
206
+ expected_params = {
198
207
"token_x" : [],
199
208
}
209
+ expected_authz : list [str ] = []
200
210
expected_used = set ()
201
211
result = identify_required_authn_params (
202
212
req_authn_params , req_authz_tokens , auth_service_names
0 commit comments