Skip to content

Commit

Permalink
Upgrade to master
Browse files Browse the repository at this point in the history
  • Loading branch information
Continuous integration committed Sep 26, 2024
1 parent 6ffeef3 commit 84608d8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
5 changes: 3 additions & 2 deletions CONST_CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ Information

1. Hostname check:
We add a hostname check on the `came_from` parameter, in the oauth2 login, allowed by
`vars.authentication.allowed_hosts` and in the OGC server clear cache, allowed by `vars.allowed_hosts`.
The behavior change a little bit in the `shortener.allowed_hosts` and in the `authorized_referers`.
`vars.authentication.allowed_hosts` and in the OGC server clear cache, allowed by `vars.admin_interface.allowed_hosts`.
The behavior change a little bit in the `vars.shortener.allowed_hosts` and in the `vars.authorized_referers`.
Now everywhere:
- If the hostname (with port) of the candidate URL equals to the request's header "Host", then it's OK.
- If the hostname (with port) of the candidate URL is in the allowed list, then it's OK.
And they should be netloc (hostname with port) without schema or path.
The `vars.allowed_hosts` is added to allowed only some authorized host.

2. We replace checks (formatting) done by `c2cciutils` by `pre-commit` hooks.
This will me more standard and transparent for the project.
Expand Down
5 changes: 4 additions & 1 deletion CONST_create_template/geoportal/vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ vars:
Sincerely yours
The GeoMapFish team
allowed_hosts:
# TODO: Add the allowed hosts for the application (themes and dynamic.json)
- localhost:8484

# Checker configuration
checker:
fulltextsearch:
Expand Down Expand Up @@ -403,7 +407,6 @@ update_paths:
- interfaces_theme
- resourceproxy
- servers
- shortener.allowed_hosts
- smtp
- sqlalchemy
- sqlalchemy_slave
Expand Down
11 changes: 11 additions & 0 deletions geoportal/CONST_config-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ mapping:
oauth2_token_expire_minutes:
type: scalar
required: false
allowed_hosts:
type: seq
sequence:
- type: str
openid_connect:
type: map
required: false
Expand Down Expand Up @@ -256,10 +260,17 @@ mapping:
type: seq
sequence:
- type: str

authorized_referers:
type: seq
sequence:
- type: str

allowed_hosts:
type: seq
sequence:
- type: str

global_headers:
type: seq
sequence:
Expand Down
10 changes: 3 additions & 7 deletions geoportal/CONST_vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1072,10 +1072,9 @@ vars:
'self'
{content_security_policy_c2c_default_src_extra}"
content_security_policy_c2c_script_src: "
'self'
'unsafe-inline'
{content_security_policy_c2c_script_src_extra}"
content_security_policy_c2c_style_src: "
'self'
'unsafe-inline'
https://cdnjs.cloudflare.com/
{content_security_policy_c2c_style_src_extra}"
Expand Down Expand Up @@ -1110,15 +1109,12 @@ vars:
Access-Control-Allow-Origin: '*'
Access-Control-Allow-Headers: X-Requested-With, Content-Type
- pattern: '^/c2c$'
headers:
headers: &c2c_headers
Content-Security-Policy: 'default-src {content_security_policy_c2c_default_src};
script-src {content_security_policy_c2c_script_src};
style-src {content_security_policy_c2c_style_src};'
- pattern: '^/c2c/.*'
headers:
Content-Security-Policy: 'default-src {content_security_policy_c2c_default_src};
script-src {content_security_policy_c2c_script_src};
style-src {content_security_policy_c2c_style_src};'
headers: *c2c_headers
- pattern: '^/iframe_api(/theme/.*)?$'
headers:
Content-Security-Policy: 'default-src {content_security_policy_main_default_src};
Expand Down
5 changes: 4 additions & 1 deletion geoportal/vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,10 @@ vars:
servers:
wmts: '{WMTS_URL}'

allowed_hosts:
# TODO: Add the allowed hosts for the application (themes and dynamic.json)
- localhost:8484

# Checker configuration
checker_ogc_server: Main PNG
checker:
Expand Down Expand Up @@ -960,7 +964,6 @@ update_paths:
- interfaces_theme
- resourceproxy
- servers
- shortener.allowed_hosts
- smtp
- sqlalchemy
- sqlalchemy_slave
Expand Down

0 comments on commit 84608d8

Please sign in to comment.