Puppet Function: openldap::flatten_ldap_id_assert_bind

Defined in:
functions/flatten_ldap_id_assert_bind.pp
Function type:
Puppet Language

Overview

openldap::flatten_ldap_id_assert_bind(Optional[OpenLDAP::LDAP::IDAssertBind] $value)Optional[String]

Flatten the proxy authentication specification to string form.

Examples:

openldap::flatten_ldap_id_assert_bind({'bindmethod' => 'simple', 'binddn' => 'cn=Manager,dc=example,dc=com'})

Parameters:

  • value (Optional[OpenLDAP::LDAP::IDAssertBind])

    The specification to flatten, undef is passed through.

Returns:

  • (Optional[String])

    The flattened specification.

Since:

  • 2.0.0



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'functions/flatten_ldap_id_assert_bind.pp', line 11

function openldap::flatten_ldap_id_assert_bind(Optional[OpenLDAP::LDAP::IDAssertBind] $value) {

  $value ? {
    undef   => undef,
    default => join($value.map |$x| {
      case $x[0] {
        'binddn': {
          "${x[0]}=\"${x[1]}\""
        }
        'flags': {
          "${x[0]}=${join($x[1], ',')}"
        }
        default: {
          "${x[0]}=${x[1]}"
        }
      }
    }, ' '),
  }
}