Skip to content

Commit f98fe98

Browse files
richard-dennehyKubik42
authored andcommitted
provide AuthorizedProjectsResolver injectable component (elastic#137393)
1 parent 595167d commit f98fe98

File tree

1 file changed

+3
-1
lines changed
  • x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security

1 file changed

+3
-1
lines changed

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,7 @@ Collection<Object> createComponents(
11461146
if (authorizationDenialMessages.get() == null) {
11471147
authorizationDenialMessages.set(new AuthorizationDenialMessages.Default());
11481148
}
1149+
final var authorizedProjectsResolver = getCustomAuthorizedProjectsResolverOrDefault(extensionComponents);
11491150
final AuthorizationService authzService = new AuthorizationService(
11501151
settings,
11511152
allRolesStore,
@@ -1164,14 +1165,15 @@ Collection<Object> createComponents(
11641165
authorizationDenialMessages.get(),
11651166
linkedProjectConfigService,
11661167
projectResolver,
1167-
getCustomAuthorizedProjectsResolverOrDefault(extensionComponents),
1168+
authorizedProjectsResolver,
11681169
new CrossProjectModeDecider(settings)
11691170
);
11701171

11711172
components.add(nativeRolesStore); // used by roles actions
11721173
components.add(reservedRolesStore); // used by roles actions
11731174
components.add(allRolesStore); // for SecurityInfoTransportAction and clear roles cache
11741175
components.add(authzService);
1176+
components.add(new PluginComponentBinding<>(AuthorizedProjectsResolver.class, authorizedProjectsResolver));
11751177

11761178
final SecondaryAuthenticator secondaryAuthenticator = new SecondaryAuthenticator(
11771179
securityContext.get(),

0 commit comments

Comments
 (0)