import static java.util.Objects.requireNonNull;
import javax.servlet.ServletException;
-import org.opendaylight.aaa.api.AuthenticationService;
import org.opendaylight.aaa.api.IDMStoreException;
import org.opendaylight.aaa.api.IIDMStore;
import org.opendaylight.aaa.api.PasswordCredentialAuth;
import org.opendaylight.aaa.api.StoreBuilder;
import org.opendaylight.aaa.api.TokenStore;
-import org.opendaylight.aaa.api.password.service.PasswordHashService;
-import org.opendaylight.aaa.cert.api.ICertificateManager;
import org.opendaylight.aaa.datastore.h2.H2TokenStore;
import org.opendaylight.aaa.shiro.moon.MoonTokenEndpoint;
import org.opendaylight.aaa.tokenauthrealm.auth.HttpBasicAuth;
import org.opendaylight.aaa.tokenauthrealm.auth.TokenAuthenticators;
-import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.DatastoreConfig;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.ShiroConfiguration;
import org.osgi.service.http.HttpService;
import org.osgi.service.http.NamespaceException;
import org.slf4j.Logger;
public final class AAAShiroProvider {
private static final Logger LOG = LoggerFactory.getLogger(AAAShiroProvider.class);
- private final DataBroker dataBroker;
- private final ICertificateManager certificateManager;
private final HttpService httpService;
private final TokenStore tokenStore;
- private final ShiroConfiguration shiroConfiguration;
private final String moonEndpointPath;
private final TokenAuthenticators tokenAuthenticators;
- private final AuthenticationService authenticationService;
- private final PasswordHashService passwordHashService;
/**
* Constructor.
*/
- public AAAShiroProvider(final DataBroker dataBroker,
- final ICertificateManager certificateManager,
- final PasswordCredentialAuth credentialAuth,
- final ShiroConfiguration shiroConfiguration,
+ public AAAShiroProvider(final PasswordCredentialAuth credentialAuth,
final HttpService httpService,
final String moonEndpointPath,
final DatastoreConfig datastoreConfig,
- final IIDMStore iidmStore,
- final AuthenticationService authenticationService,
- final PasswordHashService passwordHashService) {
- this.dataBroker = dataBroker;
- this.certificateManager = certificateManager;
- this.shiroConfiguration = shiroConfiguration;
+ final IIDMStore iidmStore) {
this.httpService = httpService;
this.moonEndpointPath = moonEndpointPath;
- this.authenticationService = authenticationService;
- this.passwordHashService = passwordHashService;
if (datastoreConfig == null || !datastoreConfig.getStore().equals(DatastoreConfig.Store.H2DataStore)) {
LOG.info("AAA Datastore has not been initialized");
}
}
- /**
- * Extract the data broker.
- *
- * @return the data broker
- */
- public DataBroker getDataBroker() {
- return dataBroker;
- }
-
- /**
- * Extract the certificate manager.
- *
- * @return the certificate manager.
- */
- public ICertificateManager getCertificateManager() {
- return certificateManager;
- }
-
- /**
- * Extract Shiro related configuration.
- *
- * @return Shiro related configuration.
- */
- public ShiroConfiguration getShiroConfiguration() {
- return shiroConfiguration;
- }
-
public TokenStore getTokenStore() {
return tokenStore;
}
public TokenAuthenticators getTokenAuthenticators() {
return tokenAuthenticators;
}
-
- public AuthenticationService getAuthenticationService() {
- return authenticationService;
- }
-
- public PasswordHashService getPasswordHashService() {
- return passwordHashService;
- }
}
<reference id="httpService"
interface="org.osgi.service.http.HttpService"/>
- <bean id="provider"
- class="org.opendaylight.aaa.AAAShiroProvider"
- init-method="init" destroy-method="close">
- <argument ref="dataBroker" />
- <argument ref="certManager" />
+ <bean id="provider" class="org.opendaylight.aaa.AAAShiroProvider" init-method="init" destroy-method="close">
<argument ref="passwordCredentialAuth" />
- <argument ref="shiroConfiguration" />
<argument ref="httpService" />
<argument value="/moon" />
<argument ref="datastoreConfig" />
<argument ref="idmStore" />
- <argument ref="authService" />
- <argument ref="passwordService" />
</bean>
<bean id="shiroWebEnvLoader" class="org.opendaylight.aaa.shiro.web.env.ShiroWebEnvironmentLoaderListener">