File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -166,14 +166,20 @@ def pick(self, req_authn_context=None):
166
166
if req_authn_context .comparison :
167
167
_cmp = req_authn_context .comparison
168
168
else :
169
- _cmp = "minimum"
170
- return self ._pick_by_class_ref (
171
- req_authn_context .authn_context_class_ref [0 ].text , _cmp )
169
+ _cmp = "exact"
170
+ if _cmp == 'exact' :
171
+ res = []
172
+ for cls_ref in req_authn_context .authn_context_class_ref :
173
+ res += (self ._pick_by_class_ref (cls_ref .text , _cmp ))
174
+ return res
175
+ else :
176
+ return self ._pick_by_class_ref (
177
+ req_authn_context .authn_context_class_ref [0 ].text , _cmp )
172
178
elif req_authn_context .authn_context_decl_ref :
173
179
if req_authn_context .comparison :
174
180
_cmp = req_authn_context .comparison
175
181
else :
176
- _cmp = "minimum "
182
+ _cmp = "exact "
177
183
return self ._pick_by_class_ref (
178
184
req_authn_context .authn_context_decl_ref , _cmp )
179
185
Original file line number Diff line number Diff line change @@ -142,6 +142,24 @@ def test_authn_3():
142
142
method , ref = info [0 ]
143
143
assert REF2METHOD [AL1 ] == method
144
144
145
+ rac = requested_authn_context ([AL1 , AL2 ], "exact" )
146
+
147
+ info = authn .pick (rac )
148
+ assert len (info ) == 2
149
+ method , ref = info [0 ]
150
+ assert REF2METHOD [AL1 ] == method
151
+ method , ref = info [1 ]
152
+ assert REF2METHOD [AL2 ] == method
153
+
154
+ rac = requested_authn_context ([AL3 , AL2 ], "exact" )
155
+
156
+ info = authn .pick (rac )
157
+ assert len (info ) == 2
158
+ method , ref = info [0 ]
159
+ assert REF2METHOD [AL3 ] == method
160
+ method , ref = info [1 ]
161
+ assert REF2METHOD [AL2 ] == method
162
+
145
163
rac = requested_authn_context (AL1 , "better" )
146
164
147
165
info = authn .pick (rac )
You can’t perform that action at this time.
0 commit comments