KNOX-3023 - Include groups in a header in ConfigurableDispatch #903
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR extends configurable dispatch to optionally add authenticated principal and groups to the outbound request as headers (header names are configurable). By default this feature is turned off and will only be enabled if users update the dispatch config in service defition with param
shouldIncludePrincipalAndGroups
(demonstrated below)Following properties are configurable on dispatch
shouldIncludePrincipalAndGroups
Should the principal and groups be passed to the dispatched request as request params.actorIdHeaderName
Header name for the principal, default value is X-Knox-Actor-IDactorGroupsHeaderPrefix
Prefix for header containing groups, default value is X-Knox-Actor-Groups. Note: header names are assigned as X-Knox-Actor-Groups-1, X-Knox-Actor-Groups-2, depending on number of groups. Each header i.e. X-Knox-Actor-Groups-1 can have max 1000 groups, next set of groups will be part of X-Knox-Actor-Groups-2 header and so on.groupFilterPattern
Regex patten to filter groups on, default value is.*
. This is useful when you only want specific groups to flow through dispatch.Complete service definition example:
Example of dispatched request headers.
How was this patch tested?
This patch was tested locally.