[
https://issues.apache.org/jira/browse/UNOMI-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Serge Huber updated UNOMI-1008:
-------------------------------
Description:
h3. Summary
After a migration from 3.0, all the data is in the "default" tenant. An admin
request with Basic authentication and no X-Unomi-Tenant-Id header does not see
this data, and nothing tells the user why. A request with a tenant id that does
not exist also gives no error.
The migration guide shows such a request without the header, and two manual
pages disagree about what happens: one says the header is optional, another
says that an unknown tenant gives an error 401.
The goal of this ticket is clear behaviour, matched by the documentation.
h3. Ways to explore
* Answer with a clear error when the tenant id does not exist. Check the tenant
only after authentication succeeds.
* Decide what a request without the header should do, and document it in one
place.
* Add the header to the examples in the migration guide.
h3. How to test
Manual check: send an admin request with a tenant id that does not exist, and
one without the header. Check that each result matches the documentation.
Automated tests to add. Each must fail on the 4.0.0 release candidate and pass
once the fix is in:
* A unit test of the authentication filter: an admin request with an existing
tenant id works in that tenant; with an unknown tenant id it gets the
documented error; without the header it gets the documented behaviour.
* A test that a request with wrong credentials gets the same answer whether the
tenant id exists or not.
* An integration test that an admin request with the tenant header sees that
tenant's data, and only that tenant's data.
* The same checks for the tenant management endpoints, which use the same logic.
was:
h3. Summary
After a migration from 3.0, all the data is in the "default" tenant. An admin
request with Basic authentication and no X-Unomi-Tenant-Id header does not see
this data, and nothing tells the user why. A request with a tenant id that does
not exist also gives no error.
The migration guide shows such a request without the header, and two manual
pages disagree about what happens: one says the header is optional, another
says that an unknown tenant gives an error 401.
The goal of this ticket is clear behaviour, matched by the documentation.
h3. Ways to explore
* Answer with a clear error when the tenant id does not exist. Check the tenant
only after authentication succeeds.
* Decide what a request without the header should do, and document it in one
place.
* Add the header to the examples in the migration guide.
h3. How to test
Send an admin request with a tenant id that does not exist, and check that it
gets a clear error. Send one without the header, and check that the result
matches the documentation.
> Admin requests without a tenant header do not see migrated data
> ---------------------------------------------------------------
>
> Key: UNOMI-1008
> URL: https://issues.apache.org/jira/browse/UNOMI-1008
> Project: Apache Unomi
> Issue Type: Bug
> Affects Versions: unomi-4.0.0
> Reporter: Serge Huber
> Priority: Major
> Fix For: unomi-4.0.0
>
>
> h3. Summary
> After a migration from 3.0, all the data is in the "default" tenant. An admin
> request with Basic authentication and no X-Unomi-Tenant-Id header does not
> see this data, and nothing tells the user why. A request with a tenant id
> that does not exist also gives no error.
> The migration guide shows such a request without the header, and two manual
> pages disagree about what happens: one says the header is optional, another
> says that an unknown tenant gives an error 401.
> The goal of this ticket is clear behaviour, matched by the documentation.
> h3. Ways to explore
> * Answer with a clear error when the tenant id does not exist. Check the
> tenant only after authentication succeeds.
> * Decide what a request without the header should do, and document it in one
> place.
> * Add the header to the examples in the migration guide.
> h3. How to test
> Manual check: send an admin request with a tenant id that does not exist, and
> one without the header. Check that each result matches the documentation.
> Automated tests to add. Each must fail on the 4.0.0 release candidate and
> pass once the fix is in:
> * A unit test of the authentication filter: an admin request with an existing
> tenant id works in that tenant; with an unknown tenant id it gets the
> documented error; without the header it gets the documented behaviour.
> * A test that a request with wrong credentials gets the same answer whether
> the tenant id exists or not.
> * An integration test that an admin request with the tenant header sees that
> tenant's data, and only that tenant's data.
> * The same checks for the tenant management endpoints, which use the same
> logic.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)