| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Acegi
Revision: 3262
Author: luke_t
Date: 26 Aug 2008 09:20:01
Changes:SEC-955: ability to externalize port mapping for secured channel to a property file
http://jira.springframework.org/browse/SEC-955. Changed schema to make port-mapping type xsd:string to allow placeholders.
| ... | ...@@ -400,9 +400,9 @@ | |
| 400 | 400 | port-mapping = |
| 401 | 401 | element port-mapping {http-port, https-port} |
| 402 | 402 | |
| 403 | http-port = attribute http {xsd:integer} | |
| 403 | http-port = attribute http {xsd:string} | |
| 404 | 404 | |
| 405 | https-port = attribute https {xsd:integer} | |
| 405 | https-port = attribute https {xsd:string} | |
| 406 | 406 | |
| 407 | 407 | |
| 408 | 408 | x509 = |
| ... | ...@@ -301,6 +301,24 @@ | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | @Test |
| 304 | public void portMappingsWorkWithPlaceholders() throws Exception { | |
| 305 | System.setProperty("http", "9080"); | |
| 306 | System.setProperty("https", "9443"); | |
| 307 | setContext( | |
| 308 | " <b:bean id='configurer' class='org.springframework.beans.factory.config.PropertyPlaceholderConfigurer'/>" + | |
| 309 | " <http auto-config='true'>" + | |
| 310 | " <port-mappings>" + | |
| 311 | " <port-mapping http='${http}' https='${https}'/>" + | |
| 312 | " </port-mappings>" + | |
| 313 | " </http>" + AUTH_PROVIDER_XML); | |
| 314 | ||
| 315 | PortMapperImpl pm = (PortMapperImpl) appContext.getBean(BeanIds.PORT_MAPPER); | |
| 316 | assertEquals(1, pm.getTranslatedPortMappings().size()); | |
| 317 | assertEquals(Integer.valueOf(9080), pm.lookupHttpPort(9443)); | |
| 318 | assertEquals(Integer.valueOf(9443), pm.lookupHttpsPort(9080)); | |
| 319 | } | |
| 320 | ||
| 321 | @Test | |
| 304 | 322 | public void externalFiltersAreTreatedCorrectly() throws Exception { |
| 305 | 323 | // Decorated user-filters should be added to stack. The others should be ignored. |
| 306 | 324 | setContext( |
| ... | ...@@ -876,8 +876,8 @@ | |
| 876 | 876 | </xs:attribute> |
| 877 | 877 | <xs:attribute name="requires-channel"> |
| 878 | 878 | <xs:annotation> |
| 879 | <xs:documentation>Used to specify that a URL must be accessed over http or | |
| 880 | https</xs:documentation> | |
| 879 | <xs:documentation>Used to specify that a URL must be accessed over http or https, or that | |
| 880 | there is no preference.</xs:documentation> | |
| 881 | 881 | </xs:annotation> |
| 882 | 882 | <xs:simpleType> |
| 883 | 883 | <xs:restriction base="xs:token"> |
| ... | ...@@ -1042,17 +1042,24 @@ | |
| 1042 | 1042 | </xs:attribute> |
| 1043 | 1043 | </xs:attributeGroup> |
| 1044 | 1044 | <xs:attributeGroup name="concurrent-sessions.attlist"> |
| 1045 | <xs:attribute name="max-sessions" type="xs:positiveInteger"/> | |
| 1045 | <xs:attribute name="max-sessions" type="xs:positiveInteger"> | |
| 1046 | <xs:annotation> | |
| 1047 | <xs:documentation>The maximum number of sessions a single user can have open at the same | |
| 1048 | time. Defaults to "1".</xs:documentation> | |
| 1049 | </xs:annotation> | |
| 1050 | </xs:attribute> | |
| 1046 | 1051 | <xs:attribute name="expired-url" type="xs:string"> |
| 1047 | 1052 | <xs:annotation> |
| 1048 | 1053 | <xs:documentation>The URL a user will be redirected to if they attempt to use a session |
| 1049 | which has been "expired" by the concurrent session controller.</xs:documentation> | |
| 1054 | which has been "expired" by the concurrent session controller because they have logged in | |
| 1055 | again.</xs:documentation> | |
| 1050 | 1056 | </xs:annotation> |
| 1051 | 1057 | </xs:attribute> |
| 1052 | 1058 | <xs:attribute name="exception-if-maximum-exceeded" type="security:boolean"> |
| 1053 | 1059 | <xs:annotation> |
| 1054 | 1060 | <xs:documentation>Specifies that an exception should be raised when a user attempts to login |
| 1055 | twice. The default behaviour is to expire the original session.</xs:documentation> | |
| 1061 | when they already have the maximum configured sessions open. The default behaviour is to | |
| 1062 | expire the original session.</xs:documentation> | |
| 1056 | 1063 | </xs:annotation> |
| 1057 | 1064 | </xs:attribute> |
| 1058 | 1065 | <xs:attribute name="session-registry-alias" type="xs:string"> |
| ... | ...@@ -1152,10 +1159,10 @@ | |
| 1152 | 1159 | </xs:complexType> |
| 1153 | 1160 | </xs:element> |
| 1154 | 1161 | <xs:attributeGroup name="http-port"> |
| 1155 | <xs:attribute name="http" use="required" type="xs:integer"/> | |
| 1162 | <xs:attribute name="http" use="required" type="xs:string"/> | |
| 1156 | 1163 | </xs:attributeGroup> |
| 1157 | 1164 | <xs:attributeGroup name="https-port"> |
| 1158 | <xs:attribute name="https" use="required" type="xs:integer"/> | |
| 1165 | <xs:attribute name="https" use="required" type="xs:string"/> | |
| 1159 | 1166 | </xs:attributeGroup> |
| 1160 | 1167 | <xs:attributeGroup name="x509.attlist"> |
| 1161 | 1168 | <xs:attribute name="subject-principal-regex" type="xs:string"> |