Repository: aurora Updated Branches: refs/heads/master a4e7b3a43 -> c624414b5
Show principal in auth failure messaage. Bugs closed: AURORA-1628 Reviewed at https://reviews.apache.org/r/44354/ Project: http://git-wip-us.apache.org/repos/asf/aurora/repo Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/c624414b Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/c624414b Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/c624414b Branch: refs/heads/master Commit: c624414b581568d6958c10628fc2c5ea9e8f14b7 Parents: a4e7b3a Author: Zameer Manji <[email protected]> Authored: Fri Mar 4 13:36:10 2016 -0500 Committer: Zameer Manji <[email protected]> Committed: Fri Mar 4 13:36:10 2016 -0500 ---------------------------------------------------------------------- .../http/api/security/ShiroAuthorizingParamInterceptor.java | 2 +- .../http/api/security/ShiroAuthorizingParamInterceptorTest.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aurora/blob/c624414b/src/main/java/org/apache/aurora/scheduler/http/api/security/ShiroAuthorizingParamInterceptor.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/aurora/scheduler/http/api/security/ShiroAuthorizingParamInterceptor.java b/src/main/java/org/apache/aurora/scheduler/http/api/security/ShiroAuthorizingParamInterceptor.java index 3043dfa..d9039c9 100644 --- a/src/main/java/org/apache/aurora/scheduler/http/api/security/ShiroAuthorizingParamInterceptor.java +++ b/src/main/java/org/apache/aurora/scheduler/http/api/security/ShiroAuthorizingParamInterceptor.java @@ -343,7 +343,7 @@ class ShiroAuthorizingParamInterceptor implements MethodInterceptor { return Responses.addMessage( Responses.empty(), ResponseCode.AUTH_FAILED, - "Subject " + subject + " is not permitted to " + targetPermission + "."); + "Subject " + subject.getPrincipal() + " is not permitted to " + targetPermission + "."); } } else { badRequests.incrementAndGet(); http://git-wip-us.apache.org/repos/asf/aurora/blob/c624414b/src/test/java/org/apache/aurora/scheduler/http/api/security/ShiroAuthorizingParamInterceptorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/aurora/scheduler/http/api/security/ShiroAuthorizingParamInterceptorTest.java b/src/test/java/org/apache/aurora/scheduler/http/api/security/ShiroAuthorizingParamInterceptorTest.java index b5b405b..a704730 100644 --- a/src/test/java/org/apache/aurora/scheduler/http/api/security/ShiroAuthorizingParamInterceptorTest.java +++ b/src/test/java/org/apache/aurora/scheduler/http/api/security/ShiroAuthorizingParamInterceptorTest.java @@ -145,6 +145,7 @@ public class ShiroAuthorizingParamInterceptorTest extends EasyMockTest { .andReturn(false); expect(subject.isPermitted(interceptor.makeTargetPermission("killTasks", JOB_KEY))) .andReturn(false); + expect(subject.getPrincipal()).andReturn("zmanji"); replayAndInitialize();
