Skip to content
This repository was archived by the owner on Jan 15, 2020. It is now read-only.

Commit 2bebb12

Browse files
committed
CLOUDSTACK-1729: a partical resolution for user authenticators to unblock developers who are currently working on and relying on the fix
1 parent 1ea5d6c commit 2bebb12

3 files changed

Lines changed: 35 additions & 13 deletions

File tree

client/tomcatconf/componentContext.xml.in

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,25 @@
3636
-->
3737
<bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker" />
3838
<bean id="encryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker" />
39-
40-
<bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" />
4139
<bean id="configurationServerImpl" class="com.cloud.server.ConfigurationServerImpl" />
40+
41+
<bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl" >
42+
<property name="UserAuthenticators">
43+
<list>
44+
<ref bean="MD5UserAuthenticator"/>
45+
<ref bean="LDAPUserAuthenticator"/>
46+
</list>
47+
</property>
48+
</bean>
49+
50+
<bean id ="AccountManagerImpl" class="com.cloud.user.AccountManagerImpl">
51+
<property name="UserAuthenticators">
52+
<list>
53+
<ref bean="MD5UserAuthenticator"/>
54+
<ref bean="LDAPUserAuthenticator"/>
55+
</list>
56+
</property>
57+
</bean>
4258

4359
<bean id="clusterManagerImpl" class="com.cloud.cluster.ClusterManagerImpl" />
4460
<bean id="clusteredAgentManagerImpl" class="com.cloud.agent.manager.ClusteredAgentManagerImpl" />

server/src/com/cloud/server/ManagementServerImpl.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,6 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
414414
@Inject
415415
S3Manager _s3Mgr;
416416

417-
/*
418-
@Inject
419-
ComponentContext _forceContextRef; // create a dependency to ComponentContext so that it can be loaded beforehead
420-
421-
@Inject
422-
EventUtils _forceEventUtilsRef;
423-
*/
424417
private final ScheduledExecutorService _eventExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("EventChecker"));
425418
private final ScheduledExecutorService _alertExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("AlertChecker"));
426419
private KeystoreManager _ksMgr;
@@ -429,14 +422,22 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
429422

430423
private Map<String, Boolean> _availableIdsMap;
431424

432-
@Inject List<UserAuthenticator> _userAuthenticators;
425+
List<UserAuthenticator> _userAuthenticators;
433426

434427
@Inject ClusterManager _clusterMgr;
435428
private String _hashKey = null;
436429

437430
public ManagementServerImpl() {
438431
setRunLevel(ComponentLifecycle.RUN_LEVEL_APPLICATION_MAINLOOP);
439432
}
433+
434+
public List<UserAuthenticator> getUserAuthenticators() {
435+
return _userAuthenticators;
436+
}
437+
438+
public void setUserAuthenticators(List<UserAuthenticator> authenticators) {
439+
_userAuthenticators = authenticators;
440+
}
440441

441442
@Override
442443
public boolean configure(String name, Map<String, Object> params)

server/src/com/cloud/user/AccountManagerImpl.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
4949
import org.apache.commons.codec.binary.Base64;
5050
import org.apache.log4j.Logger;
51-
import org.springframework.stereotype.Component;
5251

5352
import com.cloud.api.ApiDBUtils;
5453
import com.cloud.api.query.dao.UserAccountJoinDao;
@@ -140,7 +139,6 @@
140139
import com.cloud.vm.dao.UserVmDao;
141140
import com.cloud.vm.dao.VMInstanceDao;
142141

143-
@Component
144142
@Local(value = { AccountManager.class, AccountService.class })
145143
public class AccountManagerImpl extends ManagerBase implements AccountManager, Manager {
146144
public static final Logger s_logger = Logger.getLogger(AccountManagerImpl.class);
@@ -223,7 +221,6 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
223221
private AutoScaleManager _autoscaleMgr;
224222
@Inject VolumeManager volumeMgr;
225223

226-
@Inject
227224
private List<UserAuthenticator> _userAuthenticators;
228225

229226
private final ScheduledExecutorService _executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("AccountChecker"));
@@ -237,6 +234,14 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
237234
List<SecurityChecker> _securityCheckers;
238235
int _cleanupInterval;
239236

237+
public List<UserAuthenticator> getUserAuthenticators() {
238+
return _userAuthenticators;
239+
}
240+
241+
public void setUserAuthenticators(List<UserAuthenticator> authenticators) {
242+
_userAuthenticators = authenticators;
243+
}
244+
240245
@Override
241246
public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
242247
_systemAccount = _accountDao.findById(AccountVO.ACCOUNT_ID_SYSTEM);

0 commit comments

Comments
 (0)