|
@@ -1182,7 +1182,7 @@ public class Security extends Plugin
|
|
|
return Arrays.asList(usageAction, infoAction);
|
|
|
}
|
|
|
|
|
|
- final List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actionHandlers = Arrays.asList(
|
|
|
+ return Arrays.asList(
|
|
|
new ActionHandler<>(ClearRealmCacheAction.INSTANCE, TransportClearRealmCacheAction.class),
|
|
|
new ActionHandler<>(ClearRolesCacheAction.INSTANCE, TransportClearRolesCacheAction.class),
|
|
|
new ActionHandler<>(ClearPrivilegesCacheAction.INSTANCE, TransportClearPrivilegesCacheAction.class),
|
|
@@ -1231,25 +1231,15 @@ public class Security extends Plugin
|
|
|
new ActionHandler<>(GetServiceAccountAction.INSTANCE, TransportGetServiceAccountAction.class),
|
|
|
new ActionHandler<>(KibanaEnrollmentAction.INSTANCE, TransportKibanaEnrollmentAction.class),
|
|
|
new ActionHandler<>(NodeEnrollmentAction.INSTANCE, TransportNodeEnrollmentAction.class),
|
|
|
+ new ActionHandler<>(ProfileHasPrivilegesAction.INSTANCE, TransportProfileHasPrivilegesAction.class),
|
|
|
+ new ActionHandler<>(GetProfileAction.INSTANCE, TransportGetProfileAction.class),
|
|
|
+ new ActionHandler<>(ActivateProfileAction.INSTANCE, TransportActivateProfileAction.class),
|
|
|
+ new ActionHandler<>(UpdateProfileDataAction.INSTANCE, TransportUpdateProfileDataAction.class),
|
|
|
+ new ActionHandler<>(SuggestProfilesAction.INSTANCE, TransportSuggestProfilesAction.class),
|
|
|
+ new ActionHandler<>(SetProfileEnabledAction.INSTANCE, TransportSetProfileEnabledAction.class),
|
|
|
usageAction,
|
|
|
infoAction
|
|
|
);
|
|
|
-
|
|
|
- if (XPackSettings.USER_PROFILE_FEATURE_FLAG_ENABLED) {
|
|
|
- return Stream.concat(
|
|
|
- actionHandlers.stream(),
|
|
|
- Stream.of(
|
|
|
- new ActionHandler<>(ProfileHasPrivilegesAction.INSTANCE, TransportProfileHasPrivilegesAction.class),
|
|
|
- new ActionHandler<>(GetProfileAction.INSTANCE, TransportGetProfileAction.class),
|
|
|
- new ActionHandler<>(ActivateProfileAction.INSTANCE, TransportActivateProfileAction.class),
|
|
|
- new ActionHandler<>(UpdateProfileDataAction.INSTANCE, TransportUpdateProfileDataAction.class),
|
|
|
- new ActionHandler<>(SuggestProfilesAction.INSTANCE, TransportSuggestProfilesAction.class),
|
|
|
- new ActionHandler<>(SetProfileEnabledAction.INSTANCE, TransportSetProfileEnabledAction.class)
|
|
|
- )
|
|
|
- ).toList();
|
|
|
- } else {
|
|
|
- return actionHandlers;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -1273,7 +1263,7 @@ public class Security extends Plugin
|
|
|
if (enabled == false) {
|
|
|
return emptyList();
|
|
|
}
|
|
|
- final List<RestHandler> restHandlers = Arrays.asList(
|
|
|
+ return Arrays.asList(
|
|
|
new RestAuthenticateAction(settings, securityContext.get(), getLicenseState()),
|
|
|
new RestClearRealmCacheAction(settings, getLicenseState()),
|
|
|
new RestClearRolesCacheAction(settings, getLicenseState()),
|
|
@@ -1320,25 +1310,15 @@ public class Security extends Plugin
|
|
|
new RestGetServiceAccountCredentialsAction(settings, getLicenseState()),
|
|
|
new RestGetServiceAccountAction(settings, getLicenseState()),
|
|
|
new RestKibanaEnrollAction(settings, getLicenseState()),
|
|
|
- new RestNodeEnrollmentAction(settings, getLicenseState())
|
|
|
+ new RestNodeEnrollmentAction(settings, getLicenseState()),
|
|
|
+ new RestProfileHasPrivilegesAction(settings, securityContext.get(), getLicenseState()),
|
|
|
+ new RestGetProfileAction(settings, getLicenseState()),
|
|
|
+ new RestActivateProfileAction(settings, getLicenseState()),
|
|
|
+ new RestUpdateProfileDataAction(settings, getLicenseState()),
|
|
|
+ new RestSuggestProfilesAction(settings, getLicenseState()),
|
|
|
+ new RestEnableProfileAction(settings, getLicenseState()),
|
|
|
+ new RestDisableProfileAction(settings, getLicenseState())
|
|
|
);
|
|
|
-
|
|
|
- if (XPackSettings.USER_PROFILE_FEATURE_FLAG_ENABLED) {
|
|
|
- return Stream.concat(
|
|
|
- restHandlers.stream(),
|
|
|
- Stream.of(
|
|
|
- new RestProfileHasPrivilegesAction(settings, securityContext.get(), getLicenseState()),
|
|
|
- new RestGetProfileAction(settings, getLicenseState()),
|
|
|
- new RestActivateProfileAction(settings, getLicenseState()),
|
|
|
- new RestUpdateProfileDataAction(settings, getLicenseState()),
|
|
|
- new RestSuggestProfilesAction(settings, getLicenseState()),
|
|
|
- new RestEnableProfileAction(settings, getLicenseState()),
|
|
|
- new RestDisableProfileAction(settings, getLicenseState())
|
|
|
- )
|
|
|
- ).toList();
|
|
|
- } else {
|
|
|
- return restHandlers;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
@Override
|