b3a09803afceba6e56bb59867c68df5f7a206f8c
[aaa.git] / aaa-shiro / impl / src / main / resources / OSGI-INF / blueprint / impl-blueprint.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- vi: set et smarttab sw=4 tabstop=4: -->
3 <!--
4 Copyright © 2017 Brocade Communications Systems and others. All rights reserved.
5
6 This program and the accompanying materials are made available under the
7 terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 and is available at http://www.eclipse.org/legal/epl-v10.html
9 -->
10 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
11   xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
12   xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
13   odl:use-default-for-reference-types="true">
14
15   <odl:clustered-app-config
16           binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.ShiroConfiguration"
17           id="shiroConfiguration" default-config-file-name="aaa-app-config.xml" />
18
19   <odl:clustered-app-config id="datastoreConfig"
20         default-config-file-name="aaa-datastore-config.xml"
21         binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.DatastoreConfig" />
22
23   <reference id="authService" interface="org.opendaylight.aaa.api.AuthenticationService"/>
24   <reference id="passwordService" interface="org.opendaylight.aaa.api.password.service.PasswordHashService"/>
25   <reference id="idmStore" interface ="org.opendaylight.aaa.api.IIDMStore"/>
26
27   <reference id="passwordCredentialAuth" interface="org.opendaylight.aaa.api.PasswordCredentialAuth"/>
28   <reference id="claimCache" interface="org.opendaylight.aaa.api.ClaimCache"/>
29
30   <reference id="dataBroker"
31     interface="org.opendaylight.mdsal.binding.api.DataBroker"
32     odl:type="default" />
33
34   <reference id="certManager"
35     interface="org.opendaylight.aaa.cert.api.ICertificateManager"
36     odl:type="default-certificate-manager" />
37
38   <reference id="httpService"
39              interface="org.osgi.service.http.HttpService"/>
40
41   <bean id="provider"
42         class="org.opendaylight.aaa.AAAShiroProvider"
43         init-method="init" destroy-method="close">
44     <argument ref="dataBroker" />
45     <argument ref="certManager" />
46     <argument ref="passwordCredentialAuth" />
47     <argument ref="shiroConfiguration" />
48     <argument ref="httpService" />
49     <argument value="/moon" />
50     <argument value="/oauth2" />
51     <argument ref="datastoreConfig" />
52     <argument ref="idmStore" />
53     <argument ref="authService" />
54     <argument ref="passwordService" />
55   </bean>
56
57   <bean id="shiroWebEnvLoader" class="org.opendaylight.aaa.shiro.web.env.ShiroWebEnvironmentLoaderListener">
58     <argument ref="shiroConfiguration"/>
59     <argument ref="dataBroker"/>
60     <argument ref="certManager"/>
61     <argument ref="authService" />
62     <argument>
63       <bean factory-ref="provider" factory-method="getTokenAuthenticators"/>
64     </argument>
65     <argument>
66       <bean factory-ref="provider" factory-method="getTokenStore"/>
67     </argument>
68     <argument ref="passwordService" />
69   </bean>
70
71   <reference id="customFilterAdapterConfig"
72       interface="org.opendaylight.aaa.filterchain.configuration.CustomFilterAdapterConfiguration"/>
73
74   <bean id="webContextSecurer" class="org.opendaylight.aaa.shiro.web.env.ShiroWebContextSecurer">
75     <argument ref="shiroWebEnvLoader"/>
76   </bean>
77   <service ref="webContextSecurer" interface="org.opendaylight.aaa.web.WebContextSecurer" />
78
79   <reference id="webServer" interface="org.opendaylight.aaa.web.WebServer" />
80
81   <reference id="servletSupport" interface="org.opendaylight.aaa.web.servlet.ServletSupport" />
82
83   <bean id="webInitializer" class="org.opendaylight.aaa.shiro.web.env.WebInitializer" destroy-method="close">
84     <argument ref="webServer"/>
85     <argument ref="claimCache"/>
86     <argument ref="idmStore"/>
87     <argument ref="webContextSecurer"/>
88     <argument ref="servletSupport"/>
89     <argument ref="customFilterAdapterConfig"/>
90   </bean>
91 </blueprint>