Jasig CAS Client for Java - Trunk

Build: #126 failed Changes by Scott <scott.battaglia@gmail.com>

Build result summary

Details

Completed
Duration
24 seconds
Labels
None
Agent
CAS Agent
Revision
aee4676272332f20743c625e891b34d822a85c2c aee4676272332f20743c625e891b34d822a85c2c
Total tests
146
Failing since
#108 (Changes by Scott <scott.battaglia@gmail.com> and Marvin S. Addison <marvin.addison@gmail.com>)

Responsible

This build has been failing since #108
No one has taken responsibility

Code commits

Author Commit Message Commit date
Scott &lt;scott.battaglia@gmail.com&gt; Scott <scott.battaglia@gmail.com> aee4676272332f20743c625e891b34d822a85c2c aee4676272332f20743c625e891b34d822a85c2c Merge pull request #213 from lxbzmy/patch-1
Add JIRA Rest API support
Alex Lei ? &lt;lxbzmy@gmail.com&gt; Alex Lei ? <lxbzmy@gmail.com> 06b6b0c718107e79a9a25926092fce73976dad3b m 06b6b0c718107e79a9a25926092fce73976dad3b Add JIRA Rest API support
new JIRA 6 has rest api begin with url /rest when I use cas authentication filter which skip filter /rest ,there will be thrown exception:

java.lang.NullPointerException
    at com.atlassian.jira.security.login.JiraSeraphAuthenticator.getUserFromBasicAuthentication(JiraSeraphAuthenticator.java:149)
    at com.atlassian.seraph.auth.DefaultAuthenticator.getUser(DefaultAuthenticator.java:339) [atlassian-seraph-3.0.3.jar:?]
    at org.jasig.cas.client.integration.atlassian.Jira44CasAuthenticator.getUser(Jira44CasAuthenticator.java:76) [cas-client-integration-atlassian-3.4.1.jar:3.4.1]
    at com.atlassian.seraph.auth.AbstractAuthenticator.getUser(AbstractAuthenticator.java:45) [atlassian-seraph-3.0.3.jar:?]
    at com.atlassian.seraph.filter.BaseLoginFilter$SecurityHttpRequestWrapper.getUserPrincipal(BaseLoginFilter.java:238) [atlassian-seraph-3.0.3.jar:?]
    at com.atlassian.seraph.filter.BaseLoginFilter$SecurityHttpRequestWrapper.getRemoteUser(BaseLoginFilter.java:225) [atlassian-seraph-3.0.3.jar:?]
    at javax.servlet.http.HttpServletRequestWrapper.getRemoteUser(HttpServletRequestWrapper.java:168) [servlet-api.jar:?]
    at com.atlassian.jira.web.filters.accesslog.AccessLogFilter.preFilterCallStep(AccessLogFilter.java:175) [classes/:?]
    at com.atlassian.jira.web.filters.accesslog.AccessLogFilter.executeRequest(AccessLogFilter.java:86) [classes/:?]
    at com.atlassian.jira.web.filters.accesslog.AccessLogFilter.doFilter(AccessLogFilter.java:78) [classes/:?]

After hard debug work I found key program flow different from default authenitcator  :

in `com.atlassian.seraph.filter.BaseLoginFilter#SecurityHttpRequestWrapper#getUserPrincipal()`

public Principal getUserPrincipal() {
            return BaseLoginFilter.this.getAuthenticator().getClass().isAnnotationPresent(AuthenticationContextAwareAuthenticator.class)?BaseLoginFilter.this.getAuthenticationContext().getUser():BaseLoginFilter.this.getAuthenticator().getUser(this.delegateHttpServletRequest);
        }

The `AuthenticationContextAwareAuthenticator` annotation cause different flow.

So, add `AuthenticationContextAwareAuthenticator` annotation can slow problem.

Tests

Existing test failures 3
Status Test Failing since View job Duration
java.lang.Exception: Unexpected exception, expected<org.jasig.cas.client.validation.TicketValidationException> but was<java.lang.UnsupportedClassVersionError>
	at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:28)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
(29 more lines...)
java.lang.UnsupportedClassVersionError: com/fasterxml/jackson/databind/ObjectMapper
	at org.jasig.cas.client.validation.json.JsonValidationResponseParser.<init>(JsonValidationResponseParser.java:18)
	at org.jasig.cas.client.validation.json.Cas30JsonServiceTicketValidator.parseResponseFromServer(Cas30JsonServiceTicketValidator.java:30)
	at org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.java:201)
	at org.jasig.cas.client.validation.json.Cas30JsonServiceTicketValidatorTests.testSuccessfulXmlResponseWithJson(Cas30JsonServiceTicketValidatorTests.java:88)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
(25 more lines...)
java.lang.UnsupportedClassVersionError: com/fasterxml/jackson/databind/ObjectMapper : Unsupported major.minor version 51.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
(37 more lines...)