You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JakartaSecurityAnnotationProcessor.java
LOGGER.warn("Security requirement references undefined scheme '{}' -- skipping Jakarta scoped @RolesAllowed for this operation.",
215
+
entry.getKey());
216
+
returnnull;
217
+
}
218
+
if (scheme.getType() == null) {
219
+
LOGGER.warn("Security scheme '{}' is missing 'type' -- skipping Jakarta scoped @RolesAllowed.",
220
+
entry.getKey());
221
+
returnnull;
222
+
}
223
+
switch (scheme.getType()) {
224
+
caseOAUTH2:
225
+
caseOPENIDCONNECT:
226
+
List<String> scopes = entry.getValue();
227
+
if (scopes != null && !scopes.isEmpty()) {
228
+
scopedSchemeCount++;
229
+
if (scopedSchemeCount > 1) {
230
+
LOGGER.warn(
231
+
"AND-group contains multiple scoped schemes (e.g. '{}'); Jakarta @RolesAllowed cannot express AND of different scope sets -- skipping scoped @RolesAllowed for this operation.",
232
+
entry.getKey());
233
+
returnnull;
234
+
}
235
+
scopedSchemeScopes = scopes;
236
+
}
237
+
// Unscoped OAuth2/OIDC contributes nothing to the scope list.
238
+
break;
239
+
caseHTTP:
240
+
caseAPIKEY:
241
+
caseMUTUALTLS:
242
+
// No scope concept; participates in the AND group but contributes no scopes.
243
+
break;
244
+
default:
245
+
LOGGER.warn("Unrecognised security scheme type '{}' -- skipping Jakarta scoped @RolesAllowed.",
0 commit comments