File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,17 @@ def security_decorator(self):
121
121
122
122
sec_req_funcs [scheme_name ] = self ._api .security_handler_factory .verify_basic (basic_info_func )
123
123
elif scheme == "bearer" :
124
- bearer_info_func = self ._api .security_handler_factory .get_bearerinfo_func (security_scheme )
124
+ unwrapped_bearer_info_func = self ._api .security_handler_factory .get_bearerinfo_func (
125
+ security_scheme
126
+ )
127
+ bearer_info_func = (
128
+ unwrapped_bearer_info_func
129
+ if "required_scopes" not in unwrapped_bearer_info_func .__code__ .co_varnames
130
+ else lambda * args , ** kwargs : unwrapped_bearer_info_func (
131
+ * args , ** {** kwargs , "required_scopes" : required_scopes }
132
+ )
133
+ )
134
+
125
135
if not bearer_info_func :
126
136
logger .warning ("... x-bearerInfoFunc missing" , extra = vars (self ))
127
137
break
You can’t perform that action at this time.
0 commit comments