Skip to content

Commit

Permalink
Merge branch 'releases/3.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
fhanik committed Jan 25, 2016
2 parents 2324b38 + d7c32e9 commit 4f37e9b
Show file tree
Hide file tree
Showing 89 changed files with 2,501 additions and 1,027 deletions.
151 changes: 80 additions & 71 deletions docs/UAA-APIs.rst

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=3.0.0
version=3.0.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package org.cloudfoundry.identity.uaa.client;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.net.URL;

/*******************************************************************************
* Cloud Foundry
* Copyright (c) [2009-2015] Pivotal Software, Inc. All Rights Reserved.
* <p>
* 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.
* <p>
* 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.
*******************************************************************************/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ClientMetadata {

private String clientId;
private String identityZoneId;
private boolean showOnHomePage;
private URL appLaunchUrl;
private String appIcon;

public String getClientId() {
return clientId;
}

public void setClientId(String clientId) {
this.clientId = clientId;
}

@JsonIgnore
public String getIdentityZoneId() {
return identityZoneId;
}

@JsonIgnore
public void setIdentityZoneId(String identityZoneId) {
this.identityZoneId = identityZoneId;
}

public boolean isShowOnHomePage() {
return showOnHomePage;
}

public void setShowOnHomePage(boolean showOnHomePage) {
this.showOnHomePage = showOnHomePage;
}

public URL getAppLaunchUrl() {
return appLaunchUrl;
}

public void setAppLaunchUrl(URL appLaunchUrl) {
this.appLaunchUrl = appLaunchUrl;
}

public String getAppIcon() {
return appIcon;
}

public void setAppIcon(String appIcon) {
this.appIcon = appIcon;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@

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

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

public List<String> getEmailDomain() {
return emailDomain;
Expand All @@ -41,6 +43,14 @@ public AbstractIdentityProviderDefinition setAdditionalConfiguration(Map<String,
return this;
}

public String getProviderDescription() {
return providerDescription;
}

public void setProviderDescription(String description) {
this.providerDescription = description;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,23 @@ public SamlIdentityProviderDefinition clone() {
List<String> emailDomain = getEmailDomain() != null ? new ArrayList<>(getEmailDomain()) : null;
List<String> externalGroupsWhitelist = getExternalGroupsWhitelist() != null ? new ArrayList<>(getExternalGroupsWhitelist()) : null;
Map<String, Object> attributeMappings = getAttributeMappings() != null ? new HashMap(getAttributeMappings()) : null;
return Builder.get()
.setMetaDataLocation(metaDataLocation)
.setIdpEntityAlias(idpEntityAlias)
.setNameID(nameID)
.setAssertionConsumerIndex(assertionConsumerIndex)
.setMetadataTrustCheck(metadataTrustCheck)
.setShowSamlLink(showSamlLink)
.setLinkText(linkText)
.setIconUrl(iconUrl)
.setZoneId(zoneId)
.setAddShadowUserOnLogin(addShadowUserOnLogin)
.setEmailDomain(emailDomain)
.setExternalGroupsWhitelist(externalGroupsWhitelist)
.setAttributeMappings(attributeMappings)
.build();
SamlIdentityProviderDefinition def = new SamlIdentityProviderDefinition();
def.setMetaDataLocation(metaDataLocation);
def.setIdpEntityAlias(idpEntityAlias);
def.setZoneId(zoneId);
def.setNameID(nameID);
def.setAssertionConsumerIndex(assertionConsumerIndex);
def.setMetadataTrustCheck(metadataTrustCheck);
def.setShowSamlLink(showSamlLink);
def.setLinkText(linkText);
def.setIconUrl(iconUrl);
def.setAddShadowUserOnLogin(addShadowUserOnLogin);
def.setEmailDomain(emailDomain);
def.setExternalGroupsWhitelist(externalGroupsWhitelist);
def.setAttributeMappings(attributeMappings);
def.setAdditionalConfiguration(getAdditionalConfiguration());
def.setProviderDescription(getProviderDescription());
return def;
}

@JsonIgnore
Expand Down Expand Up @@ -115,48 +117,54 @@ public String getMetaDataLocation() {
return metaDataLocation;
}

public void setMetaDataLocation(String metaDataLocation) {
public SamlIdentityProviderDefinition setMetaDataLocation(String metaDataLocation) {
this.metaDataLocation = metaDataLocation;
return this;
}

public String getIdpEntityAlias() {
return idpEntityAlias;
}

public void setIdpEntityAlias(String idpEntityAlias) {
public SamlIdentityProviderDefinition setIdpEntityAlias(String idpEntityAlias) {
this.idpEntityAlias = idpEntityAlias;
return this;
}

public String getNameID() {
return nameID;
}

public void setNameID(String nameID) {
public SamlIdentityProviderDefinition setNameID(String nameID) {
this.nameID = nameID;
return this;
}

public int getAssertionConsumerIndex() {
return assertionConsumerIndex;
}

public void setAssertionConsumerIndex(int assertionConsumerIndex) {
public SamlIdentityProviderDefinition setAssertionConsumerIndex(int assertionConsumerIndex) {
this.assertionConsumerIndex = assertionConsumerIndex;
return this;
}

public boolean isMetadataTrustCheck() {
return metadataTrustCheck;
}

public void setMetadataTrustCheck(boolean metadataTrustCheck) {
public SamlIdentityProviderDefinition setMetadataTrustCheck(boolean metadataTrustCheck) {
this.metadataTrustCheck = metadataTrustCheck;
return this;
}

public boolean isShowSamlLink() {
return showSamlLink;
}

public void setShowSamlLink(boolean showSamlLink) {
public SamlIdentityProviderDefinition setShowSamlLink(boolean showSamlLink) {
this.showSamlLink = showSamlLink;
return this;
}

public String getSocketFactoryClassName() {
Expand All @@ -173,8 +181,7 @@ public String getSocketFactoryClassName() {
}
}

public void setSocketFactoryClassName(String socketFactoryClassName) {
this.socketFactoryClassName = socketFactoryClassName;
public SamlIdentityProviderDefinition setSocketFactoryClassName(String socketFactoryClassName) {
if (socketFactoryClassName!=null && socketFactoryClassName.trim().length()>0) {
try {
Class.forName(
Expand All @@ -188,38 +195,44 @@ public void setSocketFactoryClassName(String socketFactoryClassName) {
throw new IllegalArgumentException(e);
}
}
this.socketFactoryClassName = socketFactoryClassName;
return this;
}

public String getLinkText() {
return StringUtils.hasText(linkText) ? linkText : idpEntityAlias;
}

public void setLinkText(String linkText) {
public SamlIdentityProviderDefinition setLinkText(String linkText) {
this.linkText = linkText;
return this;
}

public String getIconUrl() {
return iconUrl;
}

public void setIconUrl(String iconUrl) {
public SamlIdentityProviderDefinition setIconUrl(String iconUrl) {
this.iconUrl = iconUrl;
return this;
}

public String getZoneId() {
return zoneId;
}

public void setZoneId(String zoneId) {
public SamlIdentityProviderDefinition setZoneId(String zoneId) {
this.zoneId = zoneId;
return this;
}

public boolean isAddShadowUserOnLogin() {
return addShadowUserOnLogin;
}

public void setAddShadowUserOnLogin(boolean addShadowUserOnLogin) {
public SamlIdentityProviderDefinition setAddShadowUserOnLogin(boolean addShadowUserOnLogin) {
this.addShadowUserOnLogin = addShadowUserOnLogin;
return this;
}

@Override
Expand Down Expand Up @@ -260,111 +273,4 @@ public String toString() {
'}';
}

public static class Builder {

private String metaDataLocation;
private String idpEntityAlias;
private String zoneId;
private String nameID;
private int assertionConsumerIndex;
private boolean metadataTrustCheck;
private boolean showSamlLink;
private String linkText;
private String iconUrl;
private boolean addShadowUserOnLogin = true;
private List<String> emailDomain;
private List<String> externalGroupsWhitelist;
private Map<String, Object> attributeMappings;

private Builder(){}

public static Builder get() {
return new Builder();
}

public SamlIdentityProviderDefinition build() {
SamlIdentityProviderDefinition def = new SamlIdentityProviderDefinition();

def.setMetaDataLocation(metaDataLocation);
def.setIdpEntityAlias(idpEntityAlias);
def.setZoneId(zoneId);
def.setNameID(nameID);
def.setAssertionConsumerIndex(assertionConsumerIndex);
def.setMetadataTrustCheck(metadataTrustCheck);
def.setShowSamlLink(showSamlLink);
def.setLinkText(linkText);
def.setIconUrl(iconUrl);
def.setAddShadowUserOnLogin(addShadowUserOnLogin);
def.setEmailDomain(emailDomain);
def.setExternalGroupsWhitelist(externalGroupsWhitelist);
def.setAttributeMappings(attributeMappings);

return def;
}

public Builder setAttributeMappings(Map<String, Object> attributeMappings) {
this.attributeMappings = attributeMappings;
return this;
}

public Builder setMetaDataLocation(String metaDataLocation) {
this.metaDataLocation = metaDataLocation;
return this;
}

public Builder setIdpEntityAlias(String idpEntityAlias) {
this.idpEntityAlias = idpEntityAlias;
return this;
}

public Builder setZoneId(String zoneId) {
this.zoneId = zoneId;
return this;
}

public Builder setNameID(String nameID) {
this.nameID = nameID;
return this;
}

public Builder setAssertionConsumerIndex(int assertionConsumerIndex) {
this.assertionConsumerIndex = assertionConsumerIndex;
return this;
}

public Builder setMetadataTrustCheck(boolean metadataTrustCheck) {
this.metadataTrustCheck = metadataTrustCheck;
return this;
}

public Builder setShowSamlLink(boolean showSamlLink) {
this.showSamlLink = showSamlLink;
return this;
}

public Builder setLinkText(String linkText) {
this.linkText = linkText;
return this;
}

public Builder setIconUrl(String iconUrl) {
this.iconUrl = iconUrl;
return this;
}

public Builder setAddShadowUserOnLogin(boolean addShadowUserOnLogin) {
this.addShadowUserOnLogin = addShadowUserOnLogin;
return this;
}

public Builder setEmailDomain(List<String> emailDomain) {
this.emailDomain = emailDomain;
return this;
}

public Builder setExternalGroupsWhitelist(List<String> externalGroupsWhitelist) {
this.externalGroupsWhitelist = externalGroupsWhitelist;
return this;
}
}
}
}
Loading

0 comments on commit 4f37e9b

Please sign in to comment.