Hi Nipuni, better have null checks and initialize default value otherwise there could be issues in migrating from old version to new version.
Thanks, Johann. On Thu, Aug 14, 2014 at 2:21 PM, Nipuni Perera <[email protected]> wrote: > Hi, > > I have added 2 new properties and set values as "users" and "groups" as > follows, so that they will be used as default values. > > <Property > name="OrganizationalSubContextUserContextName">users</Property> > <Property > name="OrganizationalSubContextGroupContextName">groups</Property> > > I guess a null check is not required as the default values are set as > above. Find the updated patch attached. > > Thanks, > Nipuni > > > On Thu, Aug 14, 2014 at 1:32 PM, Johann Nallathamby <[email protected]> > wrote: > >> Hi Nipuni, >> >> Two more suggestions. >> >> 1. The same fix needs to be done for the Groups as well. You can define a >> new property for this also. >> >> 2. If these two properties are not there we can go with the default >> values like before, 'users' and 'groups'. >> >> Regards, >> Johann. >> >> >> On Thu, Aug 14, 2014 at 1:25 PM, Nipuni Perera <[email protected]> wrote: >> >>> Hi, >>> >>> Please find the attached patch for the issue. I have added a new >>> property to tenant-mgt.xml. >>> >>> <Property name="OrganizationalSubContextAttributeValue">user</Property> >>> >>> Removed the constant "LDAPConstants.USER_CONTEXT_NAME" and used the >>> value of newly added property instead. >>> >>> >>> >>> tenantMgtConfig.getTenantStoreProperties().get(UserCoreConstants.TenantMgtConfig.PROPERTY_ORG_SUB_CONTEXT_ATTRIBUTE_VALUE); >>> >>> Thanks, >>> Nipuni >>> >>> >>> On Wed, Aug 13, 2014 at 8:53 PM, Johann Nallathamby <[email protected]> >>> wrote: >>> >>>> Hi Nipuni, >>>> >>>> >>>> On Wed, Aug 13, 2014 at 10:52 AM, Nipuni Perera <[email protected]> >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> I am working on issue[1]. According to the existing implementation the >>>>> constant "LDAPConstants.USER_CONTEXT_NAME" has been used in several places >>>>> to build OrganizationalSubContextAttribute. If the tenant-mgt.xml is >>>>> updated to read value of property "OrganizationalSubContextAttribute" as >>>>> follows, (current implementation reads only "ou" value: <Property >>>>> name="OrganizationalSubContextAttribute">ou</Property> ) >>>>> >>>>> <Property >>>>> name="OrganizationalSubContextAttribute">ou=users</Property> >>>>> >>>> >>>> Better to have it as a separate property rather than having it as part >>>> of OrganizationSubContextAttribute. You can introduce a new property for >>>> the value only. Otherwise it looks odd and half complete like. >>>> >>>>> >>>>> >>>>> Implementation should updated as below, >>>>> >>>>> 1. CommonHybridLDAPTenantManager.java[3] (line 177), >>>>> CommonLDAPRealmConfigBuilder.java[2] (line 120) and >>>>> FileSystemRealmConfigBuilder.java[4] (line 123) should updated >>>>> accordingly. >>>>> Is this a proper solution? Is there a limited set of values that can >>>>> be set >>>>> to OrganizationalSubContextAttribute? >>>>> 2. It seems line 161 of [3] should read the value >>>>> "PROPERTY_ORGANIZATIONAL_ATTRIBUTE" instead of " >>>>> PROPERTY_ORG_SUB_CONTEXT_ATTRIBUTE". This works fine as the >>>>> default configuration set values of both properties to "ou" >>>>> >>>>> eg: current tenant-mgt.xml contains properties below; >>>>> >>>>> <Property name="OrganizationalAttribute">ou</Property> >>>>> <Property >>>>> name="OrganizationalSubContextObjectClass">organizationalUnit</Property> >>>>> <Property >>>>> name="OrganizationalSubContextAttribute">ou</Property> >>>>> >>>>> Thus the correction should be to change, >>>>> >>>>> String organizationNameAttribute = tenantMgtConfig. >>>>> getTenantStoreProperties().get( UserCoreConstants.TenantMgtConfig. >>>>> PROPERTY_ORG_SUB_CONTEXT_ATTRIBUTE); >>>>> >>>>> to >>>>> >>>>> String organizationNameAttribute = tenantMgtConfig. >>>>> getTenantStoreProperties().get( UserCoreConstants.TenantMgtConfig. >>>>> PROPERTY_ORGANIZATIONAL_ATTRIBUTE); >>>>> >>>> >>>> This fix is correct. >>>> >>>> >>>>> >>>>> [1] https://wso2.org/jira/browse/CARBON-14863 >>>>> [2] >>>>> https://github.com/wso2-dev/carbon4-kernel/blob/master/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/config/multitenancy/CommonLDAPRealmConfigBuilder.java >>>>> [3] >>>>> https://github.com/wso2-dev/carbon4-kernel/blob/master/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/tenant/CommonHybridLDAPTenantManager.java >>>>> [4] >>>>> https://github.com/wso2-dev/carbon4-kernel/blob/master/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/config/multitenancy/FileSystemRealmConfigBuilder.java >>>>> >>>>> Thanks, >>>>> Nipuni >>>>> -- >>>>> Nipuni Perera >>>>> Software Engineer; WSO2 Inc.; http://wso2.com >>>>> Email: [email protected] >>>>> Git hub profile: https://github.com/nipuni >>>>> Mobile: +94 (71) 5626680 >>>>> <http://wso2.com> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Thanks & Regards, >>>> >>>> *Johann Dilantha Nallathamby* >>>> Associate Technical Lead & Product Lead of WSO2 Identity Server >>>> Integration Technologies Team >>>> WSO2, Inc. >>>> lean.enterprise.middleware >>>> >>>> Mobile - *+94777776950* >>>> Blog - *http://nallaa.wordpress.com <http://nallaa.wordpress.com>* >>>> >>> >>> >>> >>> -- >>> Nipuni Perera >>> Software Engineer; WSO2 Inc.; http://wso2.com >>> Email: [email protected] >>> Git hub profile: https://github.com/nipuni >>> Mobile: +94 (71) 5626680 >>> <http://wso2.com> >>> >>> >> >> >> -- >> Thanks & Regards, >> >> *Johann Dilantha Nallathamby* >> Associate Technical Lead & Product Lead of WSO2 Identity Server >> Integration Technologies Team >> WSO2, Inc. >> lean.enterprise.middleware >> >> Mobile - *+94777776950* >> Blog - *http://nallaa.wordpress.com <http://nallaa.wordpress.com>* >> > > > > -- > Nipuni Perera > Software Engineer; WSO2 Inc.; http://wso2.com > Email: [email protected] > Git hub profile: https://github.com/nipuni > Mobile: +94 (71) 5626680 > <http://wso2.com> > > -- Thanks & Regards, *Johann Dilantha Nallathamby* Associate Technical Lead & Product Lead of WSO2 Identity Server Integration Technologies Team WSO2, Inc. lean.enterprise.middleware Mobile - *+94777776950* Blog - *http://nallaa.wordpress.com <http://nallaa.wordpress.com>*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
