Skip to content

Commit

Permalink
Merge branch 'releases/2.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
fhanik committed Nov 30, 2015
2 parents 79188ac + 57fc1e6 commit 868d1b6
Show file tree
Hide file tree
Showing 176 changed files with 5,860 additions and 2,106 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ coverage.ec
.gradle
build/
/classes/
common/src/main/resources/build.properties
common/src/main/resources/git.properties
payload/src/main/resources/build.properties
payload/src/main/resources/git.properties
bin
phantomjsdriver.log

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ addons:
hosts:
- testzone1.localhost
- testzone2.localhost
- testzone3.localhost
artifacts:
key:
secure: yRJd/NtH3uwSCtHLiJKt+X3ZPb57euSZA+gMG4/HkOTdkB0NuZnZaYb0GjKaLRbTAelqottjqPf5LVJXebBvjIAVH5R9C6yC1ghRYBPtHR3AJaod8ZTSUs+mLijvvhwfksKId4aZaF/GgNfPgFnC4IPybh21vTcAfrX4qS9FmN4=
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The apps all work together with the apps running on the same port
You can also build the app and push it to Cloud Foundry, e.g.

$ ./gradlew :cloudfoundry-identity-uaa:war
$ cf push myuaa --no-start -m 512M -b https://github.com/cloudfoundry/java-buildpack#v2.4 -p uaa/build/libs/cloudfoundry-identity-uaa-2.3.2-SNAPSHOT.war
$ cf push myuaa --no-start -m 512M -b https://github.com/cloudfoundry/java-buildpack#v3.3.1 -p uaa/build/libs/cloudfoundry-identity-uaa-2.3.2-SNAPSHOT.war
$ cf set-env myuaa SPRING_PROFILES_ACTIVE default
$ cf set-env myuaa UAA_URL http://myuaa.<domain>
$ cf set-env myuaa LOGIN_URL http://myuaa.<domain>
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ project.gradle.taskGraph.whenReady { TaskExecutionGraph graph ->

apply plugin: 'coveralls'

Project identityPayload = subprojects.find { it.name.equals('cloudfoundry-identity-payload') }
Project identityCommon = subprojects.find { it.name.equals('cloudfoundry-identity-common') }
Project identityScim = subprojects.find { it.name.equals('cloudfoundry-identity-scim') }
Project identityLogin = subprojects.find { it.name.equals('cloudfoundry-identity-login') }
Expand All @@ -316,6 +317,7 @@ Project identityUaa = subprojects.find { it.name.equals('cloudfoundry-identity-u
cobertura {
coverageFormats = ['xml', 'html']
coverageSourceDirs = [
identityPayload.sourceSets.main.java.srcDirs,
identityCommon.sourceSets.main.java.srcDirs,
identityScim.sourceSets.main.java.srcDirs,
identityLogin.sourceSets.main.java.srcDirs,
Expand Down
13 changes: 13 additions & 0 deletions client-lib/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Project identityPayload = parent.subprojects.find { it.name.equals('cloudfoundry-identity-payload') }

description = 'CloudFoundry Identity Common Jar'

dependencies {
compile identityPayload
}

processResources {
//maven replaces project.artifactId in the log4j.properties file
//https://www.pivotaltracker.com/story/show/74344574
filter { line -> line.contains('${project.artifactId}') ? line.replace('${project.artifactId}','cloudfoundry-identity-common') : line }
}
4 changes: 3 additions & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Project identityPayload = parent.subprojects.find { it.name.equals('cloudfoundry-identity-payload') }

description = 'CloudFoundry Identity Common Jar'

dependencies {
compile identityPayload
compile group: 'org.passay', name: 'passay', version:'1.0'
compile group: 'com.google.guava', name: 'guava', version: '18.0'
compile group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version:parent.bcpkixVersion
Expand Down Expand Up @@ -70,7 +73,6 @@ dependencies {
testCompile group: 'org.springframework.security', name: 'spring-security-test', version:parent.springSecurityVersion
}

apply from: file('build_properties.gradle')
processResources {
//maven replaces project.artifactId in the log4j.properties file
//https://www.pivotaltracker.com/story/show/74344574
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@

package org.cloudfoundry.identity.uaa;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public abstract class AbstractIdentityProviderDefinition {
public class AbstractIdentityProviderDefinition {
public static final String EMAIL_DOMAIN_ATTR = "emailDomain";

private List<String> emailDomain;
private Map<String,Object> additionalConfiguration;

public List<String> getEmailDomain() {
return emailDomain;
Expand All @@ -29,4 +32,37 @@ public AbstractIdentityProviderDefinition setEmailDomain(List<String> emailDomai
this.emailDomain = emailDomain;
return this;
}

public Map<String, Object> getAdditionalConfiguration() {
return additionalConfiguration;
}

public AbstractIdentityProviderDefinition setAdditionalConfiguration(Map<String, Object> additionalConfiguration) {
this.additionalConfiguration = additionalConfiguration;
return this;
}

public AbstractIdentityProviderDefinition addAdditionalConfiguration(String key, Object value) {
if (additionalConfiguration==null) {
additionalConfiguration = new HashMap<>();
}
additionalConfiguration.put(key, value);
return this;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

AbstractIdentityProviderDefinition that = (AbstractIdentityProviderDefinition) o;

return !(emailDomain != null ? !emailDomain.equals(that.emailDomain) : that.emailDomain != null);

}

@Override
public int hashCode() {
return emailDomain != null ? emailDomain.hashCode() : 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,26 @@ public Map<String, Object> getAttributeMappings() {
public void addAttributeMapping(String key, Object value) {
attributeMappings.put(key, value);
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;

ExternalIdentityProviderDefinition that = (ExternalIdentityProviderDefinition) o;

if (getExternalGroupsWhitelist() != null ? !getExternalGroupsWhitelist().equals(that.getExternalGroupsWhitelist()) : that.getExternalGroupsWhitelist() != null)
return false;
return !(getAttributeMappings() != null ? !getAttributeMappings().equals(that.getAttributeMappings()) : that.getAttributeMappings() != null);

}

@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (getExternalGroupsWhitelist() != null ? getExternalGroupsWhitelist().hashCode() : 0);
result = 31 * result + (getAttributeMappings() != null ? getAttributeMappings().hashCode() : 0);
return result;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* *****************************************************************************
* Cloud Foundry
* Copyright (c) [2009-2015] Pivotal Software, Inc. All Rights Reserved.
* This product is licensed to you under the Apache License, Version 2.0 (the "License").
* You may not use this product except in compliance with the License.
*
* This product includes a number of subcomponents with
* separate copyright notices and license terms. Your use of these
* subcomponents is subject to the terms and conditions of the
* subcomponent's license, as noted in the LICENSE file.
* *****************************************************************************
*/

package org.cloudfoundry.identity.uaa;

import java.util.Map;

public class KeystoneIdentityProviderDefinition extends ExternalIdentityProviderDefinition {

public KeystoneIdentityProviderDefinition() {
this(null);
}

public KeystoneIdentityProviderDefinition(Map<String, Object> configuration) {
setAdditionalConfiguration(configuration);
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
return true;
}

@Override
public int hashCode() {
return super.hashCode();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class Origin {
public static final String KEYSTONE = "keystone";
public static final String SAML = "saml";
public static final String NotANumber = "NaN";
public static final String UNKNOWN = "unknown";

public static String getUserId(Authentication authentication) {
String id;
Expand Down
Loading

0 comments on commit 868d1b6

Please sign in to comment.