KNOX-3033 Add option to set the correct path for sticky session cookies
… instead of appending the role name
What changes were proposed in this pull request?
Add a new dispatch property to generate the sticky session cookie path from the service routes, and use a default or configured sticky session cookie name without appending the service role to it.
This is expected to be necessary for integration with external load balancers like the AWS Application load balancer which expect a single sticky cookie name.
How was this patch tested?
Deployed the changes on a live cluster, set the new parameter and checked the cookie name and path set by Knox. Also added some unit tests.
I have followed up on this, and this won't work with some service definitions.
A few service definition, like hbaseui 2.1.0 have a template in the metadata context field. AFAICT this never gets used anywhere, as up until now context was just an informative field, but this means that my current patch is guaranteed not not work with those services.
We need to one of the following:
- We need to change the context field for those context values for a non-templated one
- We need to find/define another field to use for the cookie context
- We need to determine the context some other way like calculating a prefix of all route entries.
Thanks for the review @moresandeep .
At the moment this is on hold, as we are pursuing another solution.
I will come back to this and try to address your comments later.
Thanks for the review @moresandeep .
At the moment this is on hold, as we are pursuing another solution.
I will come back to this and try to address your comments later.
Sure, thanks for contributing :)
@stoty , @moresandeep - I'm closing this now, feel free to re-open when needed.