Authelia: Add domain_regex configuration option (#16871)

**Description**
Add _domain_regex_ configuration option (explained here:
https://www.authelia.com/configuration/security/access-control/#domain_regex)
⚒️ Fixes  nothing

**⚙️ Type of change**

- [X] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
I'm using this option on my TrueNas installation to bypass
authentication for all my subdomains for all the clients that connect
from an authorized network. Using a regular expression, I don't have to
modify the Authelia application when I add a new application with its
subdomain.

**📃 Notes:**
None.

**✔️ Checklist:**

- [X] ⚖️ My code follows the style guidelines of this project
- [X] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [X] ⚠️ My changes generate no new warnings
- [X] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [X] ⬆️ I increased versions for any altered app according to semantic
versioning

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._

---------

Signed-off-by: SBado <16034687+SBado@users.noreply.github.com>
Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
This commit is contained in:
SBado 2024-01-12 22:05:00 +01:00 committed by GitHub
parent ac5e8aed3a
commit 46ec1c293a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 1 deletions

View File

@ -1,7 +1,7 @@
kubeVersion: ">=1.24.0-0"
apiVersion: v2
name: authelia
version: 22.2.0
version: 22.2.1
appVersion: 4.37.5
description: Authelia is a Single Sign-On Multi-Factor portal for web apps
home: https://truecharts.org/charts/enterprise/authelia

View File

@ -796,6 +796,19 @@ questions:
type: string
default: ""
required: true
- variable: domain_regex
label: "Domains RegEx"
description: "defines which domain or set of domains the rule applies to using regular expressions."
schema:
type: list
default: []
items:
- variable: domainRegexEntry
label: "Domain RegEx"
schema:
type: string
default: ""
required: true
- variable: policy
label: "Policy"
description: |

View File

@ -327,6 +327,16 @@ data:
{{- end }}
{{- end }}
{{- end -}}
{{- if $rule.domain_regex }}
domain_regex:
{{- if kindIs "string" $rule.domain_regex }}
- {{ $rule.domain_regex | squote }}
{{- else -}}
{{- range $rule.domain_regex }}
- {{ . | squote }}
{{- end }}
{{- end }}
{{- end }}
{{- with $rule.policy }}
policy: {{ . }}
{{- end -}}