> On Feb. 12, 2015, 11:21 p.m., Alejandro Fernandez wrote: > > Does it still work in a kerberized cluster? I remember that > > AppCookieManager was needed for that reason in the Jobs View.
Thanks for reviewing. Funny thing was that the AppCookieManager was not even being used in the Impersonator. It was set but never accessed (see the changes in HttpImpersonator). It works because the use of AppCookieManager is already baked into the org.apache.ambari.server.controller.internal.URLStreamProvider. > On Feb. 12, 2015, 11:21 p.m., Alejandro Fernandez wrote: > > ambari-server/src/main/java/org/apache/ambari/server/view/ViewURLStreamProvider.java, > > line 89 > > <https://reviews.apache.org/r/30953/diff/1/?file=862336#file862336line89> > > > > Can we rename params to body? I agree that body might be a better name but I'd like to stay consistent with the existing URLStreamProvider readFrom method. > On Feb. 12, 2015, 11:21 p.m., Alejandro Fernandez wrote: > > ambari-server/src/main/java/org/apache/ambari/server/view/ViewURLStreamProvider.java, > > line 103 > > <https://reviews.apache.org/r/30953/diff/1/?file=862336#file862336line103> > > > > What if headers already contains DO_AS_PARAM? Then it gets replaced with the given "doAs" name. We could assert that it is not already set, but I don't reallt see the harm if the end result is that the given name is set as the "doAs" name. - Tom ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/30953/#review72264 ----------------------------------------------------------- On Feb. 12, 2015, 11:06 p.m., Tom Beerbower wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/30953/ > ----------------------------------------------------------- > > (Updated Feb. 12, 2015, 11:06 p.m.) > > > Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, and Nate > Cole. > > > Bugs: AMBARI-9609 > https://issues.apache.org/jira/browse/AMBARI-9609 > > > Repository: ambari > > > Description > ------- > > org.apache.ambari.view.HttpImpersonator allows the user to specify > requestType in ... > > {code} > public String requestURL(String urlToRead, String requestType, > ImpersonatorSetting impersonatorSetting); > {code} > > but no way to pass a body or headers. > > The patch makes use of the desired functionality on the existing view > URLStreamProvider and deprecates the view HttpImpersonator since the > functionality is redundant. It's cleaner to expose a method to use the > "doAs" user on the existing URLStreamProvider interface and do it all through > a single interface. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/view/HttpImpersonatorImpl.java > 9d63d80 > > ambari-server/src/main/java/org/apache/ambari/server/view/ViewContextImpl.java > 3c736cc > ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java > dc0ce01 > > ambari-server/src/main/java/org/apache/ambari/server/view/ViewURLStreamProvider.java > 87e2753 > > ambari-server/src/test/java/org/apache/ambari/server/view/HttpImpersonatorImplTest.java > 5a86c23 > > ambari-server/src/test/java/org/apache/ambari/server/view/ViewContextImplTest.java > 88110f7 > > ambari-server/src/test/java/org/apache/ambari/server/view/ViewURLStreamProviderTest.java > 3241e46 > ambari-views/src/main/java/org/apache/ambari/view/HttpImpersonator.java > 00d5d86 > ambari-views/src/main/java/org/apache/ambari/view/ImpersonatorSetting.java > 53f6189 > ambari-views/src/main/java/org/apache/ambari/view/URLStreamProvider.java > 8976cea > > Diff: https://reviews.apache.org/r/30953/diff/ > > > Testing > ------- > > Manual testing to verify that "doAs" user is set in header when calling > URLStreamProvider.readAs() and URLStreamProvider.readAsCurrent(). > > New unit tests added. > > All existing tests pass. > INFO] ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 32:12 min > [INFO] Finished at: 2015-02-12T18:02:41-05:00 > [INFO] Final Memory: 42M/624M > [INFO] > ------------------------------------------------------------------------ > > > Thanks, > > Tom Beerbower > >
