From 65f32fcd64e68ecb9947940be24c3df8ff842b1b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 13 Nov 2024 19:43:43 +0100 Subject: [PATCH] ldap_source: fix missing SNI flag --- docs/resources/source_ldap.md | 1 + go.mod | 5 +++-- internal/provider/resource_source_ldap.go | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/resources/source_ldap.md b/docs/resources/source_ldap.md index dcac0751..91da788f 100644 --- a/docs/resources/source_ldap.md +++ b/docs/resources/source_ldap.md @@ -48,6 +48,7 @@ resource "authentik_source_ldap" "name" { - `password_login_update_internal_password` (Boolean) Defaults to `false`. - `property_mappings` (List of String) - `property_mappings_group` (List of String) +- `sni` (Boolean) Defaults to `false`. - `start_tls` (Boolean) Defaults to `true`. - `sync_groups` (Boolean) Defaults to `true`. - `sync_parent_group` (String) diff --git a/go.mod b/go.mod index a09f8153..522a6ca0 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,8 @@ module goauthentik.io/terraform-provider-authentik -go 1.22.0 -toolchain go1.23.2 +go 1.22.7 + +toolchain go1.23.3 require ( github.com/getsentry/sentry-go v0.29.1 diff --git a/internal/provider/resource_source_ldap.go b/internal/provider/resource_source_ldap.go index 3d2b5baf..da2af875 100644 --- a/internal/provider/resource_source_ldap.go +++ b/internal/provider/resource_source_ldap.go @@ -61,6 +61,11 @@ func resourceSourceLDAP() *schema.Resource { Optional: true, Default: true, }, + "sni": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, "base_dn": { Type: schema.TypeString, Required: true, @@ -149,6 +154,7 @@ func resourceSourceLDAPSchemaToSource(d *schema.ResourceData) *api.LDAPSourceReq BindCn: api.PtrString(d.Get("bind_cn").(string)), BindPassword: api.PtrString(d.Get("bind_password").(string)), StartTls: api.PtrBool(d.Get("start_tls").(bool)), + Sni: api.PtrBool(d.Get("sni").(bool)), AdditionalUserDn: api.PtrString(d.Get("additional_user_dn").(string)), AdditionalGroupDn: api.PtrString(d.Get("additional_group_dn").(string)), @@ -204,6 +210,7 @@ func resourceSourceLDAPRead(ctx context.Context, d *schema.ResourceData, m inter setWrapper(d, "server_uri", res.ServerUri) setWrapper(d, "bind_cn", res.BindCn) setWrapper(d, "start_tls", res.StartTls) + setWrapper(d, "sni", res.Sni) setWrapper(d, "base_dn", res.BaseDn) setWrapper(d, "additional_user_dn", res.AdditionalUserDn) setWrapper(d, "additional_group_dn", res.AdditionalGroupDn)