multi-tenancy in v 0.40

75 views
Skip to first unread message

Flavio Araki

unread,
Dec 23, 2014, 11:42:24 PM12/23/14
to mayoca...@googlegroups.com
First of all, thanks for the great open source software!

I'm trying to setup a multi-tenancy shop.

My understanding of multi-tenancy is that with a single instance of the marketplace I can manage multiple sellers,
so in this case, with a single instance of Mayocat Shop I can manage multiple sellers (tenants).

I followed the installation steps until the end (i.e. turned multi-tenancy: activated: true) and some questions started to pop out.

First, there were authentication issues. It seems to be required to have entity.type == 'user' and entity.tenant_id == null, but
my admin user (the first user that I created through the API call) has entity.tenant_id not null, so I changed
org.mayocat.accounts.store.jdbi.mapper.UserMapper and UserDAO.sql.stg to stop checking for null entity.tenant_id.
After the changes above, I was able to login and create a new tenant.

Then, from the tenants list (http://<host>:8080/manager/#/) I clicked on the "Back-office" link expecting it to show me the
tenant's page, but the URL was broken. When I created the tenant, I chose id = "1", so the href for the Back-office link is
"http://1./admin/".

Because the URL generated does not use my current hostname, nor my current port number, I wondered if "Mayocat Shop
multi-tenancy" means "multi-instance". Also, in the documentation, it is mentioned that "in Mayocat, a shop has its own folder"
but I can't find the folder for the newly created tenant.

Could you clarify how multi-tenancy works in Mayocat?

Thank you in advance.

Jerome Velociter

unread,
Dec 30, 2014, 1:36:03 AM12/30/14
to Flavio Araki, mayoca...@googlegroups.com
Hello Flavio,

Sorry for the late reply. See my answers below :

On Wed, Dec 24, 2014 at 5:42 AM, Flavio Araki <flavi...@gmail.com> wrote:
> First of all, thanks for the great open source software!
>
> I'm trying to setup a multi-tenancy shop.
>
> My understanding of multi-tenancy is that with a single instance of the
> marketplace I can manage multiple sellers,
> so in this case, with a single instance of Mayocat Shop I can manage
> multiple sellers (tenants).

That's correct.

>
> I followed the installation steps until the end (i.e. turned multi-tenancy:
> activated: true) and some questions started to pop out.
>
> First, there were authentication issues. It seems to be required to have
> entity.type == 'user' and entity.tenant_id == null, but
> my admin user (the first user that I created through the API call) has
> entity.tenant_id not null, so I changed
>
> org.mayocat.accounts.store.jdbi.mapper.UserMapper and UserDAO.sql.stg to
> stop checking for null entity.tenant_id.

Actually the global admin user is supposed to have it's tenant set to
null, and local admins have a tenant id set. The issue is not in the
authentication code, but rathers in the code that creates the first
global admin. This will be fixed in next release

>
> After the changes above, I was able to login and create a new tenant.
>
>
> Then, from the tenants list (http://<host>:8080/manager/#/) I clicked on the
> "Back-office" link expecting it to show me the
>
> tenant's page, but the URL was broken. When I created the tenant, I chose id
> = "1", so the href for the Back-office link is
>
> "http://1./admin/".

The correct form would then be : http://1.<host>:8080/ (currently
mayocat uses sub-domain to resolve tenants). The fact the URL is wrong
in the back-office is a bug, and it's fixed in next release as well.

>
>
> Because the URL generated does not use my current hostname, nor my current
> port number, I wondered if "Mayocat Shop
>
> multi-tenancy" means "multi-instance". Also, in the documentation, it is
> mentioned that "in Mayocat, a shop has its own folder"
>
> but I can't find the folder for the newly created tenant.

Yep, currently this one has to be created manually, under the data
directory. For example, in your case, it's
"path/to/data/dir/tenants/1/"

Hope this helps,

Cheers,

Jérôme

>
>
> Could you clarify how multi-tenancy works in Mayocat?
>
>
> Thank you in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "mayocat-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mayocat-user...@googlegroups.com.
> To post to this group, send email to mayoca...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mayocat-users/8591a629-9b1c-47df-b734-68f2db54a691%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages