#!/usr/bin/env bash
set +x

LDAP_PROPS="-Djava.naming.provider.url=ldaps://dc.sp.se:636"
LDAP_PROPS="${LDAP_PROPS} -Dhopsworks.ldap.base.dn=DC=sp,DC=se"
LDAP_PROPS="${LDAP_PROPS} -Djava.naming.security.authentication=simple"
LDAP_PROPS="${LDAP_PROPS} -Djava.naming.security.principal='CN=svc-hopsworks,OU=Service,OU=Admin,OU=SP Group,DC=sp,DC=se'"
LDAP_PROPS="${LDAP_PROPS} -Djava.naming.security.credentials=${LDAP_PASS}"
LDAP_PROPS="${LDAP_PROPS} -Djava.naming.security.protocol=ssl"

LDAP_PROPS="${LDAP_PROPS} -Dhopsworks.ldap.user.filter=userPrincipalName=antonios.kouzoupis@ri.se"
LDAP_PROPS="${LDAP_PROPS} -Dhopsworks.ldap.user.dn="
LDAP_PROPS="${LDAP_PROPS} -Dhopsworks.ldap.group.filter=member=%d"
LDAP_PROPS="${LDAP_PROPS} -Dhopsworks.ldap.binary.attribute=objectGUID"

java -cp tooling-1.0-SNAPSHOT.jar $LDAP_PROPS ai.hopsworks.ldap.LdapQuery
