Hi,
as this discussion is going on and the other components need to adapt,
we need to come to
an end.
The preferred form is to have the Tenant id in the header as:
Hawkular-Tenant:
acme.org
This has been agreed upon by everyone I think and been committed to
hawkular-metrics yesterday as
https://issues.jboss.org/browse/HWKMETRICS-86
Now the question is if we need a fallback in the case a client can not
supply a
header.
Following some discussion here and on irc yesterday, a queryParameter
(?tenantid=acme.org) seems to be preferred over a matrix parameter.
Last but not least is the question if we need that fallback at all.
My litmus test here is always the usage via curl.
As curl allows to pass headers via -H "Hawkular-tenant: acme.org" I can
imagine not using a fallback at all.
Hawkular itself needs to check if a tenant is provided and otherwise
reject the request with a
403 error code, providing a "missing Hawkular-Tenant" reason phrase.
While a 403 has a slightly different meaning, a 401 code is not
applicable, as for a 401 the
response must indicate a challenge to be met for successful
authentication.
If a tenant header is provided, but does not match a known tenant we
should probably
return a 404 not found - I am not sure on this one though. Perhaps a 403
with different reason
phrase is even better.
In cases where there is only one default tenant (e.g. metrics running
standalone), the
check for the provided tenant can be omitted.
For fallback / non-fallback I've created a doodle:
http://doodle.com/extrm4zreh25hhx3
Please respond until 5/20 EOD