Skip to content

Commit

Permalink
Support HSTS configuration updates through deployment.toml (#5420)
Browse files Browse the repository at this point in the history
* Support HSTS configuration updates through deployment.toml

* Add changeset 🦋

* Revise the config name
  • Loading branch information
AfraHussaindeen authored Feb 6, 2024
1 parent 4fc35ed commit cfde931
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-bulldogs-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/identity-apps-core": patch
---

Support HSTS configuration updates through deployment.toml
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,27 @@
<filter>
<filter-name>HttpHeaderSecurityFilter</filter-name>
<filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class>
{% set ns = namespace(hstsEnabledFound=false) %}
{% for parameter in authenticationendpoint.tomcat.http_header_security_filter.parameters %}
<init-param>
<param-name>{{ parameter.name }}</param-name>
<param-value>{{ parameter.value }}</param-value>
</init-param>
{% if parameter.name == 'hstsEnabled' %}
{% set ns.hstsEnabledFound = true %}
{% endif %}
{% endfor %}
{% if not ns.hstsEnabledFound %}
<init-param>
<param-name>hstsEnabled</param-name>
<param-value>false</param-value>
</init-param>
{% endif %}
</filter>

<filter-mapping>
<filter-name>HttpHeaderSecurityFilter</filter-name>
<url-pattern>*</url-pattern>
<url-pattern>{{ authenticationendpoint.tomcat.http_header_security_filter.url_pattern | default('*') }}</url-pattern>
</filter-mapping>

<filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,27 @@
<filter>
<filter-name>HttpHeaderSecurityFilter</filter-name>
<filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class>
{% set ns = namespace(hstsEnabledFound=false) %}
{% for parameter in accountrecoveryendpoint.tomcat.http_header_security_filter.parameters %}
<init-param>
<param-name>{{ parameter.name }}</param-name>
<param-value>{{ parameter.value }}</param-value>
</init-param>
{% if parameter.name == 'hstsEnabled' %}
{% set ns.hstsEnabledFound = true %}
{% endif %}
{% endfor %}
{% if not ns.hstsEnabledFound %}
<init-param>
<param-name>hstsEnabled</param-name>
<param-value>false</param-value>
</init-param>
{% endif %}
</filter>

<filter-mapping>
<filter-name>HttpHeaderSecurityFilter</filter-name>
<url-pattern>*</url-pattern>
<url-pattern>{{ accountrecoveryendpoint.tomcat.http_header_security_filter.url_pattern | default('*') }}</url-pattern>
</filter-mapping>

<filter>
Expand Down

0 comments on commit cfde931

Please sign in to comment.