Skip to content

Commit

Permalink
ldap_source: fix missing SNI flag (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
BeryJu authored Nov 13, 2024
2 parents 5aa50f2 + 65f32fc commit f8d24b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/resources/source_ldap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 7 additions & 0 deletions internal/provider/resource_source_ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)),
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f8d24b5

Please sign in to comment.