ldap2slack-user-sync

command module
v0.0.0-...-be0bac2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

ldap2slack-user-sync

purpose

Adds User from a specific LDAP Group to a specific Slack Group. Yeah - more flexibility would be good #later - it's a simple script.

It does not add Users to Slack. It just adds exsisting Slack User, which map to a LDAP User, to the group. If deleted in the LDAP group than this causes a remove from the SLACK group, too.

debug hints

You can use either Enviroment or command line attributes - but this must be set.

Environment Var sample
LDAP_REGION e.g. development
LDAP_BIND_USER_CN e.g. CN=user_cn_dummy,OU=Users,DC=%s,DC=COMPANY,DC=com (%s will be filled with LDAP_REGION)
LDAP_BIND_PWD well password for LDAP_BIND_USER_CN for Read Request
LDAP_HOST e.g. ldap host, e.g. ldap.%s.company.com
LDAP_PORT 636
LDAP_SEARCH_CN LDAP search string e.g CN=USER_CN,OU=Identities,DC=%s,DC=COMPANY,DC=COM
LDAP_BASE_CN LDAP entry layer e.g. DC=%s,DC=COMPANY,DC=COM
SLACK_TOKEN SLACK access token, e.g. xoxp-........-............-..............-50235a12bf60f31c0CCcec5ac72d93F68

Visual Studio Code launch.json

If you use Visual Studio Code, you could use this .launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "showLog": false,
            "program": "${file}",
            "env": { 
                "LDAP_BIND_USER_CN":"CN=USER_CN,OU=Identities,DC=%s,DC=COMPANY,DC=com", 
                "LDAP_HOST":"ldap.%s.company.com",
                "LDAP_BIND_USER_CN":"CN=user_cn_dummy,OU=Users,DC=%s,DC=COMPANY,DC=com",
                "LDAP_BIND_PWD":"whateverIsSecret" 
                "LDAP_SEARCH_CN":"CN=USER_CN,OU=Identities,DC=%s,DC=COMPANY,DC=COM",
                "LDAP_BASE_CN":"DC=%s,DC=COMPANY,DC=COM",
                "SLACK_TOKEN":"xoxp-........-............-..............-50235a12bf60f31c0CCcec5ac72d93F68"
            }
        }
    ]
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL