This commit is contained in:
2023-10-15 13:57:17 +02:00
parent ace83c6b30
commit 394fbd6d30
8 changed files with 503 additions and 486 deletions

View File

@@ -1,16 +1,16 @@
resource "authentik_group" "employes" {
name = "employes"
attributes = jsonencode({for app in var.employes.apps: app => true})
attributes = jsonencode({for app in lookup(var.employes, "apps", []): app => true})
}
resource "authentik_group" "fournisseurs" {
count = var.fournisseurs.enable ? 1 : 0
name = "fournisseurs"
attributes = jsonencode({for app in var.fournisseurs.apps: app => true})
attributes = jsonencode({for app in lookup(var.fournisseurs, "apps", []): app => true})
}
resource "authentik_group" "clients" {
count = var.clients.enable ? 1 : 0
name = "clients"
attributes = jsonencode({for app in var.clients.apps: app => true})
attributes = jsonencode({for app in lookup(var.clients, "apps", []): app => true})
}

View File

@@ -6,6 +6,18 @@ metadata:
name: accounts-management
description: null
options:
employes:
default:
apps: []
examples:
- apps: []
properties:
apps:
default: []
items:
type: string
type: array
type: object
domain:
default: your-company
examples:
@@ -13,49 +25,37 @@ options:
type: string
clients:
default:
enable: false
apps: []
enable: false
examples:
- apps: []
enable: false
properties:
enable:
type: boolean
default: false
apps:
type: array
default: []
items:
type: string
default: []
examples:
- enable: false
apps: []
type: array
enable:
default: false
type: boolean
type: object
fournisseurs:
default:
apps: []
enable: false
apps: []
properties:
enable:
type: boolean
default: false
apps:
type: array
items:
type: string
default: []
examples:
- enable: false
apps: []
type: object
employes:
default:
apps: []
properties:
apps:
type: array
items:
type: string
default: []
examples:
- apps: []
enable: false
properties:
apps:
default: []
items:
type: string
type: array
enable:
default: false
type: boolean
type: object
dependencies:
- dist: null
@@ -68,4 +68,5 @@ providers:
postgresql: null
restapi: null
http: true
gitea: null
tfaddtype: true

View File

@@ -5,7 +5,9 @@ locals {
sorted-teams = flatten([
for name in local.sorted-team-names: [
for team in var.teams:
team if team.name == name
merge({
"apps" = []
}, team) if team.name == name
]
])
}

View File

@@ -6,25 +6,6 @@ metadata:
name: division
description: null
options:
teams:
default: []
items:
properties:
apps:
default: []
items:
type: string
type: array
name:
default: ''
type: string
type: object
type: array
domain:
default: your-company
examples:
- your-company
type: string
parent:
default: employes
enum:
@@ -39,6 +20,25 @@ options:
items:
type: string
type: array
domain:
default: your-company
examples:
- your-company
type: string
teams:
default: []
items:
properties:
apps:
default: []
items:
type: string
type: array
name:
default: ''
type: string
type: object
type: array
dependencies:
- dist: null
category: share
@@ -50,4 +50,5 @@ providers:
postgresql: null
restapi: null
http: true
gitea: null
tfaddtype: true