123123import com .cloud .projects .ProjectVO ;
124124import com .cloud .projects .dao .ProjectAccountDao ;
125125import com .cloud .projects .dao .ProjectDao ;
126+ import com .cloud .region .ha .GlobalLoadBalancingRulesService ;
126127import com .cloud .server .auth .UserAuthenticator ;
127128import com .cloud .server .auth .UserAuthenticator .ActionOnFailedAuthentication ;
128129import com .cloud .storage .VMTemplateVO ;
129130import com .cloud .storage .Volume ;
130131import com .cloud .storage .VolumeApiService ;
131132import com .cloud .storage .VolumeVO ;
132- import com .cloud .storage .dao .SnapshotDao ;
133133import com .cloud .storage .dao .VMTemplateDao ;
134134import com .cloud .storage .dao .VolumeDao ;
135135import com .cloud .storage .snapshot .SnapshotManager ;
@@ -180,9 +180,7 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
180180 @ Inject
181181 private AccountDao _accountDao ;
182182 @ Inject
183- private AccountManager _accountMgr ;
184- @ Inject
185- ConfigurationDao _configDao ;
183+ private ConfigurationDao _configDao ;
186184 @ Inject
187185 private ResourceCountDao _resourceCountDao ;
188186 @ Inject
@@ -204,10 +202,6 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
204202 @ Inject
205203 private VMInstanceDao _vmDao ;
206204 @ Inject
207- protected SnapshotDao _snapshotDao ;
208- @ Inject
209- protected VMTemplateDao _vmTemplateDao ;
210- @ Inject
211205 private SecurityGroupManager _networkGroupMgr ;
212206 @ Inject
213207 private NetworkOrchestrationService _networkMgr ;
@@ -250,11 +244,11 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
250244 @ Inject
251245 private VpcManager _vpcMgr ;
252246 @ Inject
253- Site2SiteVpnManager _vpnMgr ;
247+ private Site2SiteVpnManager _vpnMgr ;
254248 @ Inject
255249 private AutoScaleManager _autoscaleMgr ;
256250 @ Inject
257- VolumeApiService volumeService ;
251+ private VolumeApiService volumeService ;
258252 @ Inject
259253 private AffinityGroupDao _affinityGroupDao ;
260254 @ Inject
@@ -272,29 +266,29 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
272266 @ Inject
273267 private SSHKeyPairDao _sshKeyPairDao ;
274268
275- List <QuerySelector > _querySelectors ;
269+ private List <QuerySelector > _querySelectors ;
276270
277271 @ Inject
278- MessageBus _messageBus ;
272+ private MessageBus _messageBus ;
279273
280274 @ Inject
281- public com . cloud . region . ha . GlobalLoadBalancingRulesService _gslbService ;
275+ private GlobalLoadBalancingRulesService _gslbService ;
282276
283277 private List <UserAuthenticator > _userAuthenticators ;
284- List <UserAuthenticator > _userPasswordEncoders ;
278+ protected List <UserAuthenticator > _userPasswordEncoders ;
285279
286280 @ Inject
287- protected IpAddressManager _ipAddrMgr ;
281+ private IpAddressManager _ipAddrMgr ;
288282
289283 private final ScheduledExecutorService _executor = Executors .newScheduledThreadPool (1 , new NamedThreadFactory ("AccountChecker" ));
290284
291- int _allowedLoginAttempts ;
285+ private int _allowedLoginAttempts ;
292286
293- UserVO _systemUser ;
294- AccountVO _systemAccount ;
287+ private UserVO _systemUser ;
288+ private AccountVO _systemAccount ;
295289
296- List <SecurityChecker > _securityCheckers ;
297- int _cleanupInterval ;
290+ private List <SecurityChecker > _securityCheckers ;
291+ private int _cleanupInterval ;
298292
299293 public List <UserAuthenticator > getUserAuthenticators () {
300294 return _userAuthenticators ;
@@ -493,8 +487,6 @@ public void checkAccess(Account caller, Domain domain) throws PermissionDeniedEx
493487 return ;
494488 }
495489 }
496-
497- assert false : "How can all of the security checkers pass on checking this caller?" ;
498490 throw new PermissionDeniedException ("There's no way to confirm " + caller + " has access to " + domain );
499491 }
500492
@@ -2292,8 +2284,8 @@ public UserAccount authenticateUser(final String username, final String password
22922284 }
22932285
22942286 // We authenticated successfully by now, let's check if we are allowed to login from the ip address the reqest comes from
2295- final Account account = _accountMgr . getAccount (user .getAccountId ());
2296- final DomainVO domain = (DomainVO )_domainMgr .getDomain (account .getDomainId ());
2287+ final Account account = getAccount (user .getAccountId ());
2288+ final DomainVO domain = (DomainVO ) _domainMgr .getDomain (account .getDomainId ());
22972289
22982290 // Get the CIDRs from where this account is allowed to make calls
22992291 final String accessAllowedCidrs = ApiServiceConfiguration .ApiAllowedSourceCidrList .valueIn (account .getId ()).replaceAll ("\\ s" , "" );
@@ -2858,4 +2850,4 @@ public String getConfigComponentName() {
28582850 public ConfigKey <?>[] getConfigKeys () {
28592851 return new ConfigKey <?>[] {UseSecretKeyInResponse };
28602852 }
2861- }
2853+ }
0 commit comments