fix
This commit is contained in:
@@ -8,7 +8,7 @@ locals {
|
||||
forward-outpost-pk = jsondecode(data.http.get_forward_outpost.response_body).results[0].pk
|
||||
app-name = var.component == var.instance ? var.instance : format("%s-%s", var.component, var.instance)
|
||||
app-icon = "dashboard/statics/icons/favicon-96x96.png"
|
||||
main-group = format("%s-users", local.app-name)
|
||||
main-group = format("app-%s", local.app-name)
|
||||
sub-groups = []
|
||||
access-token-validity = "minutes=10"
|
||||
rules-icons = [ for v in local.dns-names : {
|
||||
@@ -67,6 +67,7 @@ resource "authentik_application" "prj_application" {
|
||||
|
||||
resource "authentik_group" "prj_users" {
|
||||
name = local.main-group
|
||||
attributes = jsonencode({local.app-name = true})
|
||||
}
|
||||
|
||||
resource "authentik_group" "subgroup" {
|
||||
@@ -75,6 +76,14 @@ resource "authentik_group" "subgroup" {
|
||||
parent = authentik_group.prj_users.id
|
||||
}
|
||||
|
||||
resource "authentik_policy_expression" "policy" {
|
||||
name = local.main-group
|
||||
expression = <<-EOF
|
||||
attr = request.user.group_attributes()
|
||||
return attr['${local.app-name}'] if '${local.app-name}' in attr else False
|
||||
EOF
|
||||
}
|
||||
|
||||
data "authentik_group" "vynil-admin" {
|
||||
depends_on = [authentik_group.prj_users] # fake dependency so it is not evaluated at plan stage
|
||||
name = "vynil-forward-admins"
|
||||
@@ -82,7 +91,7 @@ data "authentik_group" "vynil-admin" {
|
||||
|
||||
resource "authentik_policy_binding" "prj_access_users" {
|
||||
target = authentik_application.prj_application.uuid
|
||||
group = authentik_group.prj_users.id
|
||||
policy = authentik_policy_expression.policy.id
|
||||
order = 0
|
||||
}
|
||||
resource "authentik_policy_binding" "prj_access_vynil" {
|
||||
|
||||
@@ -6,31 +6,31 @@ metadata:
|
||||
name: traefik-ui
|
||||
description: Access to the Traefik UI
|
||||
options:
|
||||
ingress-class:
|
||||
default: traefik
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
examples:
|
||||
- traefik
|
||||
type: string
|
||||
sub-domain:
|
||||
default: traefik
|
||||
examples:
|
||||
- traefik
|
||||
- letsencrypt-prod
|
||||
type: string
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
examples:
|
||||
- your_company.com
|
||||
type: string
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
ingress-class:
|
||||
default: traefik
|
||||
examples:
|
||||
- letsencrypt-prod
|
||||
- traefik
|
||||
type: string
|
||||
domain:
|
||||
default: your-company
|
||||
examples:
|
||||
- your-company
|
||||
type: string
|
||||
sub-domain:
|
||||
default: traefik
|
||||
examples:
|
||||
- traefik
|
||||
type: string
|
||||
dependencies:
|
||||
- dist: null
|
||||
category: share
|
||||
|
||||
Reference in New Issue
Block a user