Skip to content

Commit

Permalink
Merge branch 'feature/fix_client_id_with_dot' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
fhanik committed May 18, 2015
2 parents 7c7a82c + 62874fb commit ee06e1e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions login/src/main/resources/login-ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
<mvc:message-converters>
<bean class="org.cloudfoundry.identity.uaa.login.AutologinRequestConverter" />
</mvc:message-converters>
<mvc:path-matching registered-suffixes-only="true"/>
</mvc:annotation-driven>

<bean id="autologinAuthenticationFilter" class="org.cloudfoundry.identity.uaa.authentication.AuthzAuthenticationFilter">
Expand Down
2 changes: 0 additions & 2 deletions uaa/src/main/webapp/WEB-INF/spring-servlet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@
</bean>
<!--<mvc:resources location="/" mapping="/**" />-->

<mvc:annotation-driven />

<mvc:default-servlet-handler />

<!--Basic application beans. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import static org.junit.Assert.assertTrue;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
Expand Down Expand Up @@ -111,7 +110,7 @@ public static void stopMailServer() throws Exception {
public void testCreateActivationEmailPage() throws Exception {
((MockEnvironment) webApplicationContext.getEnvironment()).setProperty("login.brand", "oss");

mockMvc.perform(get("/create_account.do"))
mockMvc.perform(get("/create_account"))
.andExpect(content().string(containsString("Create your account")))
.andExpect(content().string(not(containsString("Pivotal ID"))));
}
Expand All @@ -120,7 +119,7 @@ public void testCreateActivationEmailPage() throws Exception {
public void testCreateActivationEmailPageWithPivotalBrand() throws Exception {
((MockEnvironment) webApplicationContext.getEnvironment()).setProperty("login.brand", "pivotal");

mockMvc.perform(get("/create_account.do"))
mockMvc.perform(get("/create_account"))
.andExpect(content().string(containsString("Create your Pivotal ID")))
.andExpect(content().string(not(containsString("Create your account"))));
}
Expand Down Expand Up @@ -274,7 +273,6 @@ public void testCreatingAnAccountInAnotherZoneWithNoClientRedirect() throws Exce
MvcResult mvcResult = mockMvc.perform(get("/verify_user")
.param("code", "test" + generator.counter.get())
.with(new SetServerNameRequestPostProcessor("mysubdomain.localhost")))
.andDo(print())
.andExpect(status().isFound())
.andExpect(redirectedUrl("home"))
.andReturn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ private void setupAdminUserToken() throws Exception {
ClientDetails adminClient = createAdminClient(adminToken);

adminUserToken = testClient.getUserOAuthAccessToken(adminClient.getClientId(),
"secret",
testUser.getUsername(),
testPassword,
"uaa.admin,clients.read,clients.write");
"secret",
testUser.getUsername(),
testPassword,
"uaa.admin,clients.read,clients.write");
}

@AfterClass
Expand Down Expand Up @@ -265,7 +265,7 @@ public void testUpdateClientsTxSuccess() throws Exception {
assertEquals(new Integer(120), client.getRefreshTokenValiditySeconds());
}
//create and then update events
verify(applicationEventPublisher, times(count*2)).publishEvent(captor.capture());
verify(applicationEventPublisher, times(count * 2)).publishEvent(captor.capture());
int index = 0;
for (AbstractUaaEvent event : captor.getAllValues()) {
if (index<count) {
Expand Down Expand Up @@ -851,7 +851,7 @@ public void testSecretChangeModifyTxApprovalsNotDeleted() throws Exception {
testUser.getUsername(),
testPassword,
"oauth.approvals");
assertEquals(3, getApprovals(userToken,c.getClientId()).length);
assertEquals(3, getApprovals(userToken, c.getClientId()).length);
}

//change the secret, and we know don't the old secret
Expand Down Expand Up @@ -1049,6 +1049,15 @@ public void testGetClientDetailsSortedByLastModified() throws Exception{
}


@Test
public void testClientWithDotInID() throws Exception {
ClientDetails details = createClient(adminToken, "testclient", "client_credentials");
ClientDetails detailsv2 = createClient(adminToken, "testclient.v2", "client_credentials");
assertEquals("testclient.v2", detailsv2.getClientId());
}



private Approval[] getApprovals(String token, String clientId) throws Exception {
String filter = "client_id eq \""+clientId+"\"";

Expand Down

0 comments on commit ee06e1e

Please sign in to comment.