Search in sources :

Example 1 with Int

use of net.sourceforge.myvd.types.Int in project OpenUnison by TremoloSecurity.

the class AccessLog method bind.

public void bind(BindInterceptorChain chain, DistinguishedName dn, Password pwd, LDAPConstraints constraints) throws LDAPException {
    long start = System.currentTimeMillis();
    long end = 0;
    int result = -1;
    Int op = new Int(0);
    Int con = new Int(0);
    this.getOpNum(chain.getSession(), con, op);
    StringBuffer buf = new StringBuffer("BIND op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" dn='").append(dn.getDN()).append("'");
    logger.info(buf.toString());
    try {
        chain.nextBind(dn, pwd, constraints);
        result = 0;
    } catch (LDAPException le) {
        result = le.getResultCode();
        throw le;
    } finally {
        end = System.currentTimeMillis();
        if (result == -1) {
            result = LDAPException.OPERATIONS_ERROR;
        }
        buf.setLength(0);
        buf.append("RESULT op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" result=").append(result).append(" time=").append(end - start);
        logger.info(buf.toString());
    }
}
Also used : LDAPException(com.novell.ldap.LDAPException) Int(net.sourceforge.myvd.types.Int)

Example 2 with Int

use of net.sourceforge.myvd.types.Int in project OpenUnison by TremoloSecurity.

the class AccessLog method compare.

public void compare(CompareInterceptorChain chain, DistinguishedName dn, Attribute attrib, LDAPConstraints constraints) throws LDAPException {
    long start = System.currentTimeMillis();
    long end = 0;
    int result = -1;
    Int op = new Int(0);
    Int con = new Int(0);
    this.getOpNum(chain.getSession(), con, op);
    StringBuffer buf = new StringBuffer("COMPARE op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" dn='").append(dn.getDN()).append("' attribute='").append(attrib.getAttribute().getName()).append("' value='").append(attrib.getAttribute().getName()).append("'");
    logger.info(buf.toString());
    try {
        chain.nextCompare(dn, attrib, constraints);
        result = 0;
    } catch (LDAPException le) {
        result = le.getResultCode();
        throw le;
    } finally {
        end = System.currentTimeMillis();
        if (result == -1) {
            result = LDAPException.OPERATIONS_ERROR;
        }
        buf.setLength(0);
        buf.append("RESULT op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" result=").append(result).append(" time=").append(end - start);
        logger.info(buf.toString());
    }
}
Also used : LDAPException(com.novell.ldap.LDAPException) Int(net.sourceforge.myvd.types.Int)

Example 3 with Int

use of net.sourceforge.myvd.types.Int in project OpenUnison by TremoloSecurity.

the class AccessLog method rename.

public void rename(RenameInterceptorChain chain, DistinguishedName dn, DistinguishedName newRdn, Bool deleteOldRdn, LDAPConstraints constraints) throws LDAPException {
    long start = System.currentTimeMillis();
    long end = 0;
    int result = -1;
    Int op = new Int(0);
    Int con = new Int(0);
    this.getOpNum(chain.getSession(), con, op);
    StringBuffer buf = new StringBuffer("RENAME op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" dn='").append(dn.getDN()).append("'");
    logger.info(buf.toString());
    try {
        chain.nextRename(dn, newRdn, deleteOldRdn, constraints);
        result = 0;
    } catch (LDAPException le) {
        result = le.getResultCode();
        throw le;
    } finally {
        end = System.currentTimeMillis();
        if (result == -1) {
            result = LDAPException.OPERATIONS_ERROR;
        }
        buf.setLength(0);
        buf.append("RESULT op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" result=").append(result).append(" time=").append(end - start);
        logger.info(buf.toString());
    }
}
Also used : LDAPException(com.novell.ldap.LDAPException) Int(net.sourceforge.myvd.types.Int)

Example 4 with Int

use of net.sourceforge.myvd.types.Int in project OpenUnison by TremoloSecurity.

the class AccessLog method postSearchComplete.

public void postSearchComplete(PostSearchCompleteInterceptorChain chain, DistinguishedName base, Int scope, Filter filter, ArrayList<Attribute> attributes, Bool typesOnly, LDAPSearchConstraints constraints) throws LDAPException {
    chain.nextPostSearchComplete(base, scope, filter, attributes, typesOnly, constraints);
    StringBuffer b = new StringBuffer();
    b.append(AccessLog.ACCESS_LOG_SRCH_BEGIN).append(this.name);
    long start = (Long) chain.getRequest().get(b.toString());
    b.setLength(0);
    b.append(AccessLog.ACCESS_LOG_SRCH_OP).append(this.name);
    Int op = (Int) chain.getRequest().get(b.toString());
    b.setLength(0);
    b.append(AccessLog.ACCESS_LOG_SRCH_CON).append(this.name);
    Int con = (Int) chain.getRequest().get(b.toString());
    b.setLength(0);
    b.append(AccessLog.ACCESS_LOG_SRCH_COUNT).append(this.name);
    Int nentries = (Int) chain.getRequest().get(b.toString());
    long end = System.currentTimeMillis();
    StringBuffer buf = new StringBuffer();
    buf.append("SRCH-RESULT op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" entries=").append(nentries.getValue()).append(" time=").append(end - start);
    logger.info(buf);
}
Also used : Int(net.sourceforge.myvd.types.Int)

Example 5 with Int

use of net.sourceforge.myvd.types.Int in project OpenUnison by TremoloSecurity.

the class AccessLog method delete.

public void delete(DeleteInterceptorChain chain, DistinguishedName dn, LDAPConstraints constraints) throws LDAPException {
    long start = System.currentTimeMillis();
    long end = 0;
    int result = -1;
    Int op = new Int(0);
    Int con = new Int(0);
    this.getOpNum(chain.getSession(), con, op);
    StringBuffer buf = new StringBuffer("DELETE op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" dn='").append(dn.getDN()).append("'");
    logger.info(buf.toString());
    try {
        chain.nextDelete(dn, constraints);
        result = 0;
    } catch (LDAPException le) {
        result = le.getResultCode();
        throw le;
    } finally {
        end = System.currentTimeMillis();
        if (result == -1) {
            result = LDAPException.OPERATIONS_ERROR;
        }
        buf.setLength(0);
        buf.append("RESULT op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" result=").append(result).append(" time=").append(end - start);
        logger.info(buf.toString());
    }
}
Also used : LDAPException(com.novell.ldap.LDAPException) Int(net.sourceforge.myvd.types.Int)

Aggregations

Int (net.sourceforge.myvd.types.Int)13 LDAPException (com.novell.ldap.LDAPException)10 LDAPAttribute (com.novell.ldap.LDAPAttribute)3 LDAPSearchConstraints (com.novell.ldap.LDAPSearchConstraints)3 SearchInterceptorChain (net.sourceforge.myvd.chain.SearchInterceptorChain)3 Attribute (net.sourceforge.myvd.types.Attribute)3 Bool (net.sourceforge.myvd.types.Bool)3 DistinguishedName (net.sourceforge.myvd.types.DistinguishedName)3 Filter (net.sourceforge.myvd.types.Filter)3 Results (net.sourceforge.myvd.types.Results)3 LDAPEntry (com.novell.ldap.LDAPEntry)2 ArrayList (java.util.ArrayList)2 Gson (com.google.gson.Gson)1 LDAPSearchResults (com.novell.ldap.LDAPSearchResults)1 DN (com.novell.ldap.util.DN)1 Token (com.tremolosecurity.json.Token)1 TOTPKey (com.tremolosecurity.proxy.auth.otp.TOTPKey)1 GoogleAuthenticator (com.warrenstrange.googleauth.GoogleAuthenticator)1 GoogleAuthenticatorConfig (com.warrenstrange.googleauth.GoogleAuthenticatorConfig)1 GoogleAuthenticatorConfigBuilder (com.warrenstrange.googleauth.GoogleAuthenticatorConfig.GoogleAuthenticatorConfigBuilder)1