Author: bdaw
Date: 2010-11-09 03:59:39 -0500 (Tue, 09 Nov 2010)
New Revision: 545
Modified:
idm/branches/1.1.0/picketlink-idm-hibernate/src/main/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreConfiguration.java
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/SimpleLDAPIdentityStoreConfiguration.java
Log:
- provide option to "switch off" bug fix checking proper case sensitive results
Modified:
idm/branches/1.1.0/picketlink-idm-hibernate/src/main/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
===================================================================
---
idm/branches/1.1.0/picketlink-idm-hibernate/src/main/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2010-11-08
19:33:44 UTC (rev 544)
+++
idm/branches/1.1.0/picketlink-idm-hibernate/src/main/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2010-11-09
08:59:39 UTC (rev 545)
@@ -98,6 +98,8 @@
public static final String ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION =
"allowNotDefinedIdentityObjectTypes";
+ public static final String ALLOW_NOT_CASE_SENSITIVE_SEARCH =
"allowNotCaseSensitiveSearch";
+
public static final String DEFAULT_REALM_NAME =
HibernateIdentityStoreImpl.class.getName() + ".DEFAULT_REALM";
public static final String CREDENTIAL_TYPE_PASSWORD = "PASSWORD";
@@ -116,6 +118,8 @@
private boolean isAllowNotDefinedIdentityObjectTypes = false;
+ private boolean isAllowNotCaseSensitiveSearch = false;
+
private boolean isManageTransactionDuringBootstrap = true;
// TODO: rewrite this into some more handy object
@@ -300,6 +304,13 @@
this.isAllowNotDefinedIdentityObjectTypes = true;
}
+ String allowNotCaseSensitiveSearch =
configurationMD.getOptionSingleValue(ALLOW_NOT_CASE_SENSITIVE_SEARCH);
+
+ if (allowNotCaseSensitiveSearch != null &&
allowNotCaseSensitiveSearch.equalsIgnoreCase("true"))
+ {
+ this.isAllowNotCaseSensitiveSearch = true;
+ }
+
// Default realm
HibernateRealm realm = null;
@@ -672,8 +683,12 @@
}
// Check result with case sensitive compare:
- if (hibernateObject != null && hibernateObject.getName().equals(name))
+ if (isAllowNotCaseSensitiveSearch())
{
+ return hibernateObject;
+ }
+ else if (hibernateObject != null &&
hibernateObject.getName().equals(name))
+ {
return hibernateObject;
@@ -2978,4 +2993,10 @@
{
return isManageTransactionDuringBootstrap;
}
+
+ public boolean isAllowNotCaseSensitiveSearch()
+ {
+ return isAllowNotCaseSensitiveSearch;
+ }
}
+
Modified:
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreConfiguration.java
===================================================================
---
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreConfiguration.java 2010-11-08
19:33:44 UTC (rev 544)
+++
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreConfiguration.java 2010-11-09
08:59:39 UTC (rev 545)
@@ -90,4 +90,6 @@
int getPagedExtensionSize();
+ public boolean isAllowNotCaseSensitiveSearch();
+
}
Modified:
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
===================================================================
---
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2010-11-08
19:33:44 UTC (rev 544)
+++
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2010-11-09
08:59:39 UTC (rev 545)
@@ -628,7 +628,7 @@
IdentityObject io = createIdentityObjectInstance(invocationCtx, type,
res.getAttributes(), dn);
// Check for case insensitive name results
- if (!io.getName().equals(name))
+ if (!configuration.isAllowNotCaseSensitiveSearch() &&
!io.getName().equals(name))
{
io = null;
}
Modified:
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/SimpleLDAPIdentityStoreConfiguration.java
===================================================================
---
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/SimpleLDAPIdentityStoreConfiguration.java 2010-11-08
19:33:44 UTC (rev 544)
+++
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/SimpleLDAPIdentityStoreConfiguration.java 2010-11-09
08:59:39 UTC (rev 545)
@@ -91,7 +91,9 @@
private final boolean createMissingContexts;
+ private final boolean allowNotCaseSensitiveSearch;
+
// Consts
public static final String PROVIDER_URL = "providerURL";
@@ -144,6 +146,8 @@
public static final String CREATE_MISSING_CONTEXTS =
"createMissingContexts";
+ public static final String ALLOW_NOT_CASE_SENSITIVE_SEARCH =
"allowNotCaseSensitiveSearch";
+
public SimpleLDAPIdentityStoreConfiguration(IdentityStoreConfigurationMetaData
storeMD)
{
if (storeMD == null)
@@ -227,6 +231,16 @@
this.createMissingContexts = false;
}
+ String allowNotCaseSensitiveSearch =
storeMD.getOptionSingleValue(ALLOW_NOT_CASE_SENSITIVE_SEARCH);
+ if (allowNotCaseSensitiveSearch != null &&
allowNotCaseSensitiveSearch.equalsIgnoreCase("true"))
+ {
+ this.allowNotCaseSensitiveSearch = true;
+ }
+ else
+ {
+ this.allowNotCaseSensitiveSearch = false;
+ }
+
Map<String, LDAPIdentityObjectTypeConfiguration> types = new
HashMap<String, LDAPIdentityObjectTypeConfiguration>();
for (IdentityObjectTypeMetaData identityObjectTypeMetaData :
storeMD.getSupportedIdentityTypes())
@@ -539,4 +553,9 @@
{
return pagedExtensionSize;
}
+
+ public boolean isAllowNotCaseSensitiveSearch()
+ {
+ return allowNotCaseSensitiveSearch;
+ }
}
Show replies by date