Skip to content

Commit fa98c67

Browse files
Merge pull request #13865 from Milanka00/master
Add missing configurations for [admin_console.control_access]
2 parents ac7ccb3 + d9a3f76 commit fa98c67

File tree

4 files changed

+94
-0
lines changed
  • all-in-one-apim/modules/distribution/product/src/main
  • api-control-plane/modules/distribution/product/src/main

4 files changed

+94
-0
lines changed

all-in-one-apim/modules/distribution/product/src/main/assembly/bin.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<exclude>**/conf/tomcat/catalina-server.xml</exclude>
4444
<exclude>**/conf/tomcat/catalina-server.xml.j2</exclude>
4545
<exclude>**/conf/tomcat/carbon/WEB-INF/web.xml.j2</exclude>
46+
<exclude>**/conf/tomcat/carbon/META-INF/context.xml.j2</exclude>
4647
<exclude>**/log4j2.properties</exclude>
4748
<exclude>**/pax-logging.properties</exclude>
4849
<exclude>**/services/sample01.aar</exclude>
@@ -244,6 +245,7 @@
244245
<exclude>**/conf/axis2/*.j2</exclude>
245246
<exclude>**/catalina-server.xml.j2</exclude>
246247
<exclude>**/conf/tomcat/carbon/WEB-INF/web.xml.j2</exclude>
248+
<exclude>**/conf/tomcat/carbon/META-INF/context.xml.j2</exclude>
247249
<exclude>**/webapps/authenticationendpoint/WEB-INF/web.xml.j2</exclude>
248250
</excludes>
249251
</fileSet>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!--
2+
~ Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com).
3+
~
4+
~ WSO2 LLC. licenses this file to you under the Apache License,
5+
~ Version 2.0 (the "License"); you may not use this file except
6+
~ in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing,
12+
~ software distributed under the License is distributed on an
13+
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
~ KIND, either express or implied. See the License for the
15+
~ specific language governing permissions and limitations
16+
~ under the License.
17+
-->
18+
19+
<!-- The contents of this file will be loaded for each web application -->
20+
<Context privileged="true" useHttpOnly="true" useRelativeRedirects="false">
21+
<Resources allowLinking="true" />
22+
23+
<!-- Default set of monitored resources -->
24+
<WatchedResource>WEB-INF/web.xml</WatchedResource>
25+
26+
<!-- comment this out to enable session persistence across Tomcat restarts -->
27+
<Manager pathname=""/>
28+
29+
<JarScanner className="org.wso2.carbon.tomcat.ext.scan.CarbonTomcatJarScanner" scanClassPath="true"
30+
scanAllFiles="false" scanAllDirectories="false"/>
31+
32+
<!-- Following are default values. But we specifically add them in kernel, becuase they get overridden in WSO2 AS -->
33+
<Loader className="org.apache.catalina.loader.WebappLoader"
34+
loaderClass="org.apache.catalina.loader.WebappClassLoader"/>
35+
36+
{% if admin_console.authenticator.iwa_ui_authenticator.enable is sameas true %}
37+
<Valve className="waffle.apache.NegotiateAuthenticator" principalFormat="fqn" roleFormat="both"/>
38+
<Realm className="waffle.apache.WindowsRealm"/>
39+
{% endif %}
40+
41+
{% if admin_console.control_access.enable is sameas true %}
42+
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
43+
allow="{% for ip in admin_console.control_access.allow %}{{ip}}{{ "|" if not loop.last}}{% endfor %}"/>
44+
{% endif %}
45+
</Context>

api-control-plane/modules/distribution/product/src/main/assembly/bin.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<exclude>**/conf/tomcat/catalina-server.xml</exclude>
4444
<exclude>**/conf/tomcat/catalina-server.xml.j2</exclude>
4545
<exclude>**/conf/tomcat/carbon/WEB-INF/web.xml.j2</exclude>
46+
<exclude>**/conf/tomcat/carbon/META-INF/context.xml.j2</exclude>
4647
<exclude>**/log4j2.properties</exclude>
4748
<exclude>**/pax-logging.properties</exclude>
4849
<exclude>**/services/sample01.aar</exclude>
@@ -244,6 +245,7 @@
244245
<exclude>**/conf/axis2/*.j2</exclude>
245246
<exclude>**/catalina-server.xml.j2</exclude>
246247
<exclude>**/conf/tomcat/carbon/WEB-INF/web.xml.j2</exclude>
248+
<exclude>**/conf/tomcat/carbon/META-INF/context.xml.j2</exclude>
247249
<exclude>**/webapps/authenticationendpoint/WEB-INF/web.xml.j2</exclude>
248250
</excludes>
249251
</fileSet>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!--
2+
~ Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com).
3+
~
4+
~ WSO2 LLC. licenses this file to you under the Apache License,
5+
~ Version 2.0 (the "License"); you may not use this file except
6+
~ in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing,
12+
~ software distributed under the License is distributed on an
13+
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
~ KIND, either express or implied. See the License for the
15+
~ specific language governing permissions and limitations
16+
~ under the License.
17+
-->
18+
19+
<!-- The contents of this file will be loaded for each web application -->
20+
<Context privileged="true" useHttpOnly="true" useRelativeRedirects="false">
21+
<Resources allowLinking="true" />
22+
23+
<!-- Default set of monitored resources -->
24+
<WatchedResource>WEB-INF/web.xml</WatchedResource>
25+
26+
<!-- comment this out to enable session persistence across Tomcat restarts -->
27+
<Manager pathname=""/>
28+
29+
<JarScanner className="org.wso2.carbon.tomcat.ext.scan.CarbonTomcatJarScanner" scanClassPath="true"
30+
scanAllFiles="false" scanAllDirectories="false"/>
31+
32+
<!-- Following are default values. But we specifically add them in kernel, becuase they get overridden in WSO2 AS -->
33+
<Loader className="org.apache.catalina.loader.WebappLoader"
34+
loaderClass="org.apache.catalina.loader.WebappClassLoader"/>
35+
36+
{% if admin_console.authenticator.iwa_ui_authenticator.enable is sameas true %}
37+
<Valve className="waffle.apache.NegotiateAuthenticator" principalFormat="fqn" roleFormat="both"/>
38+
<Realm className="waffle.apache.WindowsRealm"/>
39+
{% endif %}
40+
41+
{% if admin_console.control_access.enable is sameas true %}
42+
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
43+
allow="{% for ip in admin_console.control_access.allow %}{{ip}}{{ "|" if not loop.last}}{% endfor %}"/>
44+
{% endif %}
45+
</Context>

0 commit comments

Comments
 (0)