Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* Portions Copyrighted 2026 3A Systems LLC.
*/

package org.identityconnectors.contract.test;
Expand All @@ -32,12 +34,9 @@

import org.identityconnectors.common.StringUtil;
import org.identityconnectors.contract.data.DataProvider;
import org.identityconnectors.framework.api.ConnectorFacade;
import org.identityconnectors.framework.common.objects.Schema;
import org.testng.IObjectFactory;
import org.testng.ITestContext;
import org.testng.annotations.Factory;
import org.testng.internal.ObjectFactoryImpl;

import com.google.inject.Guice;
import com.google.inject.Injector;
Expand Down Expand Up @@ -111,14 +110,4 @@ public Injector getInjector(ITestContext context) {
public DataProvider getDataProvider(ITestContext context) {
return ConnectorHelper.createDataProvider();
}

private static class ContractTestFactory {

private ConnectorFacade connectorFacade = null;

private Schema schema = null;

private IObjectFactory objectFactory = new ObjectFactoryImpl();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,13 @@ public boolean equals(Object o) {
public int hashCode() {
return base64SHA1Hash.hashCode();
}

/**
* Never prints the clear text; the default {@link Object#toString()} would not either,
* but its output is just a class name and hash code, not useful for logging.
*/
@Override
public String toString() {
return "GuardedString(...)";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
* ====================
*
* Portions Copyrighted 2026 3A Systems LLC.
*/
package org.identityconnectors.common.security;

Expand Down Expand Up @@ -121,6 +123,13 @@ public void testDispose() {
}
}

@Test
public void testToStringNeverExposesTheClearText() {
GuardedString str = new GuardedString("secret".toCharArray());
assertFalse(str.toString().contains("secret"),
"toString() must never leak the clear text");
}

@Test
public void testUnicode() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* "Portions Copyrighted [year] [name of copyright owner]"
* ====================
* "Portions Copyrighted 2014 ForgeRock AS"
* Portions Copyrighted 2026 3A Systems LLC.
*/
package org.identityconnectors.ldap.search;

Expand Down Expand Up @@ -59,9 +60,9 @@ public LdapInternalSearch(LdapConnection conn, String filter, List<String> baseD
}

public void execute(LdapSearchResultsHandler handler) {
String filter = blankAsAllObjects(this.filter);
String effectiveFilter = blankAsAllObjects(this.filter);
try {
strategy.doSearch(conn.getInitialContext(), baseDNs, filter, controls, handler);
strategy.doSearch(conn.getInitialContext(), baseDNs, effectiveFilter, controls, handler);
} catch (IOException e) {
throw new ConnectorException(e);
} catch (PartialResultException e) {
Expand Down
Loading