{"action":"created","issue":{"url":"https://api.github.com/repos/codice/ddf/issues/1318","repository_url":"https://api.github.com/repos/codice/ddf","labels_url":"https://api.github.com/repos/codice/ddf/issues/1318/labels{/name}","comments_url":"https://api.github.com/repos/codice/ddf/issues/1318/comments","events_url":"https://api.github.com/repos/codice/ddf/issues/1318/events","html_url":"https://github.com/codice/ddf/pull/1318","id":179921959,"number":1318,"title":"DDF-2500: Expose client info within request properties using a PreAuthorizationPlugin and a servlet filter.","user":{"login":"Lambeaux","id":7215534,"avatar_url":"https://avatars.githubusercontent.com/u/7215534?v=3","gravatar_id":"","url":"https://api.github.com/users/Lambeaux","html_url":"https://github.com/Lambeaux","followers_url":"https://api.github.com/users/Lambeaux/followers","following_url":"https://api.github.com/users/Lambeaux/following{/other_user}","gists_url":"https://api.github.com/users/Lambeaux/gists{/gist_id}","starred_url":"https://api.github.com/users/Lambeaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lambeaux/subscriptions","organizations_url":"https://api.github.com/users/Lambeaux/orgs","repos_url":"https://api.github.com/users/Lambeaux/repos","events_url":"https://api.github.com/users/Lambeaux/events{/privacy}","received_events_url":"https://api.github.com/users/Lambeaux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"pklinef","id":700518,"avatar_url":"https://avatars.githubusercontent.com/u/700518?v=3","gravatar_id":"","url":"https://api.github.com/users/pklinef","html_url":"https://github.com/pklinef","followers_url":"https://api.github.com/users/pklinef/followers","following_url":"https://api.github.com/users/pklinef/following{/other_user}","gists_url":"https://api.github.com/users/pklinef/gists{/gist_id}","starred_url":"https://api.github.com/users/pklinef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pklinef/subscriptions","organizations_url":"https://api.github.com/users/pklinef/orgs","repos_url":"https://api.github.com/users/pklinef/repos","events_url":"https://api.github.com/users/pklinef/events{/privacy}","received_events_url":"https://api.github.com/users/pklinef/received_events","type":"User","site_admin":false},"assignees":[{"login":"pklinef","id":700518,"avatar_url":"https://avatars.githubusercontent.com/u/700518?v=3","gravatar_id":"","url":"https://api.github.com/users/pklinef","html_url":"https://github.com/pklinef","followers_url":"https://api.github.com/users/pklinef/followers","following_url":"https://api.github.com/users/pklinef/following{/other_user}","gists_url":"https://api.github.com/users/pklinef/gists{/gist_id}","starred_url":"https://api.github.com/users/pklinef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pklinef/subscriptions","organizations_url":"https://api.github.com/users/pklinef/orgs","repos_url":"https://api.github.com/users/pklinef/repos","events_url":"https://api.github.com/users/pklinef/events{/privacy}","received_events_url":"https://api.github.com/users/pklinef/received_events","type":"User","site_admin":false},{"login":"stustison","id":4391679,"avatar_url":"https://avatars.githubusercontent.com/u/4391679?v=3","gravatar_id":"","url":"https://api.github.com/users/stustison","html_url":"https://github.com/stustison","followers_url":"https://api.github.com/users/stustison/followers","following_url":"https://api.github.com/users/stustison/following{/other_user}","gists_url":"https://api.github.com/users/stustison/gists{/gist_id}","starred_url":"https://api.github.com/users/stustison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stustison/subscriptions","organizations_url":"https://api.github.com/users/stustison/orgs","repos_url":"https://api.github.com/users/stustison/repos","events_url":"https://api.github.com/users/stustison/events{/privacy}","received_events_url":"https://api.github.com/users/stustison/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-09-29T00:07:23Z","updated_at":"2016-10-06T01:46:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/codice/ddf/pulls/1318","html_url":"https://github.com/codice/ddf/pull/1318","diff_url":"https://github.com/codice/ddf/pull/1318.diff","patch_url":"https://github.com/codice/ddf/pull/1318.patch"},"body":"#### What does this PR do?\r\nAdds client-specific information (from the javax.servlet API) to catalog framework request properties, using a servlet filter (_platform-filter-clientinfo_) and a `PreAuthorizationPlugin` (_catalog-plugin-clientinfo_) to ensure the information is available as early as possible in the processing chain. \r\n\r\n##### Actions Taken\r\nExpose client info within request properties using a `PreAuthorizationPlugin` and a servlet filter.\r\nClient-specific information (e.g. IP address, hostname, etc) is needed for metacard enrichment.\r\n\r\n* Added a PreAuthorizationPlugin extension point.\r\n* Updated relevant catalog operations.\r\n* Added a servlet filter to copy servlet request data into the ThreadContext.\r\n* Added a PreAuthorizationPlugin implementation to copy client info from the ThreadContext to the catalog request properties.\r\n* Cleaned up resources allocated in the ThreadContext within the servlet filter.\r\n* Added the 'clientinfo-filter' feature to the platform app.\r\n* Added the 'catalog-metacard-enrichment' feature to the catalog app.\r\n* Added tests. \r\n\r\n#### Who is reviewing it?\r\n@coyotesqrl \r\n@lessarderic \r\n@shaundmorris \r\n@millerw8 \r\n\r\n#### Choose 2 committers to review/merge the PR.\r\n@pklinef \r\n@stustison\r\n\r\n#### How should this be tested?\r\nFull build (PRBS). \r\n\r\n#### Any background context you want to provide?\r\nThis work is being done as a generic (expandable) feature for multiple use cases. It was spawned primarily out of the need for security markings to be tweaked based on where a metacard comes from. \r\n\r\n#### What are the relevant tickets?\r\nDDF-2500, DDF-2502\r\n\r\n#### Checklist:\r\n- [ ] Documentation Updated\r\n- [ ] Update / Add Unit Tests\r\n- [ ] Update / Add Integration Tests\r\n"},"comment":{"url":"https://api.github.com/repos/codice/ddf/issues/comments/251847342","html_url":"https://github.com/codice/ddf/pull/1318#issuecomment-251847342","issue_url":"https://api.github.com/repos/codice/ddf/issues/1318","id":251847342,"user":{"login":"Lambeaux","id":7215534,"avatar_url":"https://avatars.githubusercontent.com/u/7215534?v=3","gravatar_id":"","url":"https://api.github.com/users/Lambeaux","html_url":"https://github.com/Lambeaux","followers_url":"https://api.github.com/users/Lambeaux/followers","following_url":"https://api.github.com/users/Lambeaux/following{/other_user}","gists_url":"https://api.github.com/users/Lambeaux/gists{/gist_id}","starred_url":"https://api.github.com/users/Lambeaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lambeaux/subscriptions","organizations_url":"https://api.github.com/users/Lambeaux/orgs","repos_url":"https://api.github.com/users/Lambeaux/repos","events_url":"https://api.github.com/users/Lambeaux/events{/privacy}","received_events_url":"https://api.github.com/users/Lambeaux/received_events","type":"User","site_admin":false},"created_at":"2016-10-06T01:46:51Z","updated_at":"2016-10-06T01:46:51Z","body":"#### Important Note\r\n\r\n##### The Design: \r\n`ClientInfoFilter` >> `ThreadContext` >> `ClientInfoSetupPlugin : PreAuthorizationPlugin` >> `CatalogFramework\r\n\r\n##### Current Issue\r\n\r\n@pklinef Interesting observations to report. In an earlier comment (and discussion) with @stustison it was mentioned that the `ClientInfoFilter` needs to run _after_ the `LoginFilter` in order for the strategy with `ThreadContext` to work. Note that `LoginFilter` has a service ranking of *99*. \r\n\r\nRegarding `ClientInfoFilter`, some debugging experiments were performed *without success* using _create_ and _query_ operations with the default service ranking (omission of the attribute), along with service rankings of 98, 100, and 200. The client information reaches the `ThreadContext` in the `ClientInfoFilter` but the `ClientInfoSetupPlugin` can't find it within the `ThreadContext`. I suspect we missed a threading issue. I have commented the relevant line. \r\n\r\n##### Exceptional Case\r\n\r\nBy configuring `ClientInfoFilter` with a service ranking of 10, the client information map is *successfully* showing up in request properties *for a create operation only*. Query operations still *do not* receive that map on either the request or the response. "}}
{"actor":{"display_login":"Lambeaux"}}