Hi Amalka, The issue is not only during the database creation time. I am considering the following scenario : After a user created the databases with different names under different apps, he cant create the user (by clicking the button "Add New User") with the same name under these databases.
Thanks. Mahendran Pirinthapan Software Engineer | WSO2 Inc. Mobile +94772378732. On Wed, Jun 3, 2015 at 1:19 PM, Amalka Subasinghe <[email protected]> wrote: > Without creating user with database name, can't we generate 7 character > user name randomly? > > There's another scenario: if we try create a new database with a name > which was deleted earlier, that does not allow to create the user again > with the same name. (user is exist although we remove the database) in that > case, when we create the database, we have appended randomly generated 2 > letters at the end of the "user defined user name" to make the user name > unique. > So if we generate the full 7 character user name randomly each time we > will not require to append 2 letter at the end. > > Further, because of the above UI allows to enter 5 letters for database > name, we can remove that validation also if we can give a randomly > generated user name > > > > On Wed, Jun 3, 2015 at 12:17 PM, Danushka Fernando <[email protected]> > wrote: > >> Hi Pirinthapan >> I guess what we need to do is create the final user name as following >> >> <user defined user name>_<hash code of applicaiton key + "_" + tenant >> domain> >> >> So this won't support by OOTB in SS. >> >> @Dimuthu : Is it OK if we add another service to RSSAdmin service to >> create a application specific database user? WDYT? >> >> >> Thanks & Regards >> Danushka Fernando >> Software Engineer >> WSO2 inc. http://wso2.com/ >> Mobile : +94716332729 >> >> On Wed, Jun 3, 2015 at 12:05 PM, Rajeevan Vimalanathan < >> [email protected]> wrote: >> >>> Hi Pirinthapan, >>> >>> Since the user name is not unique at the tenant domain (but it should be >>> unique at application domain), can't we simply use the following pattern to >>> the verification of user name? >>> >>> <user defined user name>_<base64 encoding of the application key> >>> >>> I hope this should resolve your issue. >>> >>> Thanks, >>> Rajeevan >>> >>> On Wed, Jun 3, 2015 at 11:52 AM, Pirinthapan Mahendran < >>> [email protected]> wrote: >>> >>>> Hi all, >>>> >>>> In App Factory, the database users are application local. That means if >>>> we create a database user under one application its not visible to another >>>> application even within the same tenant. So if we try to create a user with >>>> the same name in different applications within same tenant, we are getting >>>> 'user already exists exception'. >>>> >>>> This is because the RSSAdmin service only allows to create the user >>>> with the same name in different tenants. Not within same tenant. >>>> >>>> To overcome this issue I tried to append the base64 encoding of the >>>> application key to the user name in template layer level. This also failing >>>> because of the following reason. >>>> >>>> By default mysql user name length is limited to 16 characters. In the >>>> current implementation of App Factory, we have allocated these 16 >>>> characters in the following pattern. >>>> >>>> <user defined user name>_<hash code of tenant domain> >>>> >>>> 1. First 7 characters for the user name, provided by the user. (Limited >>>> this to 7 characters in UI level) >>>> 2. 8th character is for the connector '_'. >>>> 3. last 8 characters for the base64 encoding of the hash code of tenant >>>> domain (this is created by 'carbon-storage-management' component). >>>> >>>> I kindly expect your thoughts to overcome this issue. >>>> >>>> Thanks & Regards. >>>> Mahendran Pirinthapan >>>> Software Engineer | WSO2 Inc. >>>> Mobile +94772378732. >>>> >>>> _______________________________________________ >>>> Dev mailing list >>>> [email protected] >>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>> >>>> >>> >>> >>> -- >>> >>> Vimalanathan Rajeevan >>> Software Engineer >>> WSO2 Inc.:http://wso2.com >>> lean.enterprise.middleware >>> >>> >>> Mobile : +94 773090875 >>> >>> _______________________________________________ >>> Dev mailing list >>> [email protected] >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Amalka Subasinghe > Senior Software Engineer > WSO2 Inc. > Mobile: +94 77 9401267 >
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
