Why does the REST API have email in the tenantUser model?

Since a Tenant User can only be created via additional values when creating a user via PUT api/users, or created from an existing user via PUT api/tenant/{tenantId}/users which has to include the UserId, why do we also need to have “email” in the tenantUser model ?

It seems that email is a property that in all respects only exists as an attribute of a User - it can’t for example be updated via api/tenant/{tenantId}/users.

I understand that in the UI it’s nice to work with users by their e-mail attribute, but it seems strange that this leaks into tah API model. Not a big issue, just a bit confusing when working against the API

The idea is that in the web-interface when adding an user to a tenant, you would know the e-mail address, not the UUID of this user. Internally ChirpStack will perform an e-mail to UUID lookup, thus the database-record links to the user UUID, not the e-mail address.

Hi Brocaar,

Sure, that makes sense in the UI, but the UI could still do that without the e-mail being part of the tenantUser model in the API.

I’m open for a pull-request to improve this :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.