Skip to content

feat: add LDAP authentication support to Infisical Ansible Collection#19

Merged
victorvhs017 merged 1 commit intomainfrom
feature/ldap-login
Feb 19, 2026
Merged

feat: add LDAP authentication support to Infisical Ansible Collection#19
victorvhs017 merged 1 commit intomainfrom
feature/ldap-login

Conversation

@victorvhs017
Copy link
Copy Markdown
Contributor

Summary

Adds LDAP authentication to the Infisical Ansible collection, aligned with the Infisical Python SDK LDAP auth and PR #55.

Changes

  • Authenticator (_authenticator.py): Added ldap_auth method using identity_id, ldap_username, and ldap_password. Requires infisicalsdk >= 1.0.16.
  • Login module (login.py): New ldap_auth choice and parameters ldap_username, ldap_password.
  • Login lookup (login.py): LDAP support and example usage.
  • Auth doc fragment (auth.py): LDAP options for modules and lookups, including env vars INFISICAL_LDAP_USERNAME and INFISICAL_LDAP_PASSWORD.
  • README: LDAP auth section with parameters, env vars, and usage example.

Usage

- name: Login with LDAP
  infisical.vault.login:
    auth_method: ldap_auth
    identity_id: "{{ ldap_identity_id }}"
    ldap_username: "{{ ldap_username }}"
    ldap_password: "{{ ldap_password }}"
  register: infisical_login

- Updated README.md to include LDAP Auth details and example usage.
- Modified authentication modules to support LDAP credentials.
- Enhanced documentation fragments and lookup options for LDAP Auth.
- Added example for using LDAP authentication in the login module.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Feb 19, 2026

Greptile Summary

Adds LDAP authentication support to the Infisical Ansible Collection, aligning with the Python SDK's LDAP auth feature. The implementation follows the existing authentication patterns consistently across all plugin types.

Key Changes:

  • Introduced ldap_auth as a new authentication method requiring identity_id, ldap_username, and ldap_password
  • Added minimum SDK version check (>= 1.0.16) for LDAP auth compatibility
  • Properly marked sensitive parameters (ldap_password) with no_log: true for security
  • Added environment variable support: INFISICAL_LDAP_USERNAME and INFISICAL_LDAP_PASSWORD
  • Updated documentation fragments, README, and examples comprehensively

Quality:

  • Code follows established patterns from existing auth methods (universal_auth, oidc_auth, token_auth)
  • Proper input validation and error handling maintained
  • Documentation is complete and includes usage examples

Confidence Score: 5/5

  • This PR is safe to merge with no security concerns
  • The implementation is clean, follows existing patterns precisely, includes proper security measures (no_log for sensitive data), has comprehensive validation and version checking, and provides complete documentation. No breaking changes or security issues detected.
  • No files require special attention

Important Files Changed

Filename Overview
plugins/module_utils/_authenticator.py Added LDAP auth method with proper validation and version checking, consistent with existing auth patterns
plugins/modules/login.py Added ldap_username and ldap_password parameters with proper no_log marking for security
plugins/lookup/login.py Added LDAP support and example usage to lookup plugin, consistent with module implementation
plugins/doc_fragments/auth.py Added LDAP auth documentation fragments with environment variable support, properly integrated
README.md Added comprehensive LDAP auth documentation with parameters, environment variables, and usage examples

Last reviewed commit: 26d4535

@victorvhs017 victorvhs017 merged commit 8eb30f7 into main Feb 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants