mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-09 19:57:16 +02:00
web-svc-logout: merge logout domains into CSP connect-src and refactor task flow
• Add tasks/01_core.yml to set applications[application_id].server.csp.whitelist['connect-src'] = LOGOUT_CONNECT_SRC_NEW. • Switch tasks/main.yml to include 01_core.yml (run-once guard preserved). • Update templates/env.j2 to emit LOGOUT_DOMAINS as a comma-separated list. • Rework vars/main.yml: compute LOGOUT_DOMAINS, derive LOGOUT_ORIGINS with WEB_PROTOCOL, read connect-src via the get_app_conf filter, and merge/dedupe (unique). Rationale: ensure CSP allows cross-domain logout requests for all configured services. Conversation: https://chatgpt.com/share/68b5b07d-b208-800f-b6b2-f26934607c8a
This commit is contained in:
31
roles/web-svc-logout/tasks/01_core.yml
Normal file
31
roles/web-svc-logout/tasks/01_core.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
- name: "Add logout domains to CSP connect-src"
|
||||
set_fact:
|
||||
applications: >-
|
||||
{{
|
||||
applications | combine(
|
||||
{
|
||||
application_id: {
|
||||
'server': {
|
||||
'csp': {
|
||||
'whitelist': {
|
||||
'connect-src': LOGOUT_CONNECT_SRC_NEW
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
recursive=True
|
||||
)
|
||||
}}
|
||||
|
||||
- name: "load docker, proxy for '{{ application_id }}'"
|
||||
include_role:
|
||||
name: sys-stk-full-stateless
|
||||
|
||||
- name: Create symbolic link from .env file to repository
|
||||
file:
|
||||
src: "{{ docker_compose.files.env }}"
|
||||
dest: "{{ [ docker_repository_path, '.env' ] | path_join }}"
|
||||
state: link
|
||||
|
||||
- include_tasks: utils/run_once.yml
|
@@ -1,14 +1,4 @@
|
||||
---
|
||||
- block:
|
||||
- name: "load docker, proxy for '{{ application_id }}'"
|
||||
include_role:
|
||||
name: sys-stk-full-stateless
|
||||
|
||||
- name: Create symbolic link from .env file to repository
|
||||
file:
|
||||
src: "{{ docker_compose.files.env }}"
|
||||
dest: "{{ [ docker_repository_path, '.env' ] | path_join }}"
|
||||
state: link
|
||||
|
||||
- include_tasks: utils/run_once.yml
|
||||
- include_tasks: 01_core.yml
|
||||
when: run_once_web_svc_logout is not defined
|
Reference in New Issue
Block a user