Class: PEClient::Resource::RBACV1::LDAP

Inherits:
Base
  • Object
show all
Defined in:
lib/pe_client/resources/rbac.v1/ldap.rb

Overview

Use the v1 LDAP endpoints to test and configure LDAP directory service connections.

Constant Summary collapse

BASE_PATH =
Deprecated.

Use COMMAND_BASE_PATH methods instead.

The base path for RBAC API v1 LDAP endpoints.

"#{RBACV1::BASE_PATH}/ds".freeze
COMMAND_BASE_PATH =

The base path for RBAC API v1 LDAP command endpoints.

"#{RBACV1::BASE_PATH}/command/ldap".freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PEClient::Resource::Base

Instance Method Details

#create(attributes) ⇒ Hash

Configure a new LDAP connection.

Parameters:

  • attributes (Hash)

    The attributes for the new LDAP connection.

Options Hash (attributes):

  • :display_name (String)

    Directory name.

  • :"help-link" (String)

    Login help.

  • :hostname (String)

    Hostname.

  • :port (Integer)

    Port.

  • :login (String)

    Lookup user.

  • :password (String)

    Lookup password.

  • :connect_timeout (Integer)

    Connection timeout in seconds.

  • :ssl (Boolean)

    Connect using SSL. Cannot be set to true if :start_tls is true.

  • :start_tls (Boolean)

    Connect using StartTLS. Cannot be set to true if :ssl is true.

  • :cert_chain (String)

    Certificate Chain.

  • :ssl_hostname_validation (String)

    Validate the hostname.

  • :ssl_wildcard_validation (String)

    Allow wildcards in SSL certificate.

  • :base_dn (String)

    Base distinguished name.

  • :user_lookup_attr (String)

    User login attribute.

  • :user_email_attr (String)

    User email address field.

  • :user_display_name_attr (String)

    User full name.

  • :user_rdn (String)

    User relative distinguished name.

  • :group_object_class (String)

    Group object class.

  • :group_member_attr (String)

    Group membership field.

  • :group_name_attr (String)

    Group name attribute.

  • :group_lookup_attr (String)

    Group lookup attribute.

  • :group_rdn (String)

    Group relative distinguished name.

  • :disable_ldap_matching_rule_in_chain (String)

    Turn off LDAP_MATCHING_RULE_IN_CHAIN.

  • :search_nested_groups (String)

    Search nested groups.

Returns:

  • (Hash)

See Also:



64
65
66
# File 'lib/pe_client/resources/rbac.v1/ldap.rb', line 64

def create(attributes)
  @client.post("#{COMMAND_BASE_PATH}/create", body: attributes)
end

#delete(id) ⇒ Hash

Delete an existing directory service connection.

Parameters:

  • id (String)

    The ID of the LDAP connection to delete.

Returns:

  • (Hash)

    If successful, returns an empty JSON object.



84
85
86
# File 'lib/pe_client/resources/rbac.v1/ldap.rb', line 84

def delete(id)
  @client.post "#{COMMAND_BASE_PATH}/delete", body: {id:}
end

#ds(attributes) ⇒ Hash

Deprecated.

Use #create, #update, #delete instead.

Replace current directory service connection settings. You can update the settings or disconnect the service (by removing all settings).

Parameters:

  • attributes (Hash)

    The attributes for the new LDAP connection.

Returns:

  • (Hash)

See Also:



127
128
129
130
# File 'lib/pe_client/resources/rbac.v1/ldap.rb', line 127

def ds(attributes)
  PEClient.deprecated "ds", "create, update, or delete"
  @client.put("#{BASE_PATH}/ds", body: attributes)
end

#ds_test(attributes = nil) ⇒ Hash

Deprecated.

Use #test instead.

Test the connection to the connected directory service.

Parameters:

  • attributes (Hash) (defaults to: nil)

    The attributes for the new LDAP connection.

Returns:

  • (Hash)

See Also:



108
109
110
111
112
113
114
115
# File 'lib/pe_client/resources/rbac.v1/ldap.rb', line 108

def ds_test(attributes = nil)
  PEClient.deprecated "ds_test", "test"
  if attributes.nil?
    @client.get "#{BASE_PATH}/test"
  else
    @client.put "#{BASE_PATH}/test", body: attributes
  end
end

#test(attributes) ⇒ Hash

Test a directory service connection based on supplied settings.

Parameters:

  • attributes (Hash)

    The attributes for the new LDAP connection.

Returns:

  • (Hash)

See Also:



95
96
97
# File 'lib/pe_client/resources/rbac.v1/ldap.rb', line 95

def test(attributes)
  @client.post "#{COMMAND_BASE_PATH}/test", body: attributes
end

#update(attributes) ⇒ Hash

Replace an existing directory service connection’s settings.

Parameters:

  • attributes (Hash)

    The attributes for the new LDAP connection.

Returns:

  • (Hash)

See Also:



75
76
77
# File 'lib/pe_client/resources/rbac.v1/ldap.rb', line 75

def update(attributes)
  @client.put "#{COMMAND_BASE_PATH}/update", body: attributes
end