checked in stuff
parent
c4dfe35f44
commit
6cce82f484
6
.project
6
.project
|
@ -10,8 +10,14 @@
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
<nature>org.maven.ide.eclipse.maven2Nature</nature>
|
<nature>org.maven.ide.eclipse.maven2Nature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|
|
@ -4,13 +4,16 @@
|
||||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
|
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
|
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
|
||||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
|
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
|
||||||
<classpathentry kind="src" path="src/main/webapp"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" path="/spring-security-oauth2"/>
|
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -31,8 +31,14 @@
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
<nature>org.maven.ide.eclipse.maven2Nature</nature>
|
<nature>org.maven.ide.eclipse.maven2Nature</nature>
|
||||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
<wb-module deploy-name="openid">
|
<wb-module deploy-name="openid">
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/webapp"/>
|
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/spring-security-oauth2/spring-security-oauth2">
|
<dependent-module archiveName="spring-security-oauth2-1.0.0.BUILD-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/spring-security-oauth2/spring-security-oauth2">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
<property name="java-output-path" value="/openid/target/classes"/>
|
<property name="java-output-path" value="/openid/target/classes"/>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.mitre.openid.connect.model;
|
package org.mitre.openid.connect.model;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.GenerationType;
|
import javax.persistence.GenerationType;
|
||||||
|
@ -8,24 +9,43 @@ import javax.persistence.Id;
|
||||||
@Entity
|
@Entity
|
||||||
public class Address {
|
public class Address {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@Basic
|
||||||
private String formatted;
|
private String formatted;
|
||||||
|
|
||||||
|
@Basic
|
||||||
private String street_address;
|
private String street_address;
|
||||||
|
|
||||||
|
@Basic
|
||||||
private String locality;
|
private String locality;
|
||||||
|
|
||||||
|
@Basic
|
||||||
private String region;
|
private String region;
|
||||||
|
|
||||||
|
@Basic
|
||||||
private String postal_code;
|
private String postal_code;
|
||||||
|
|
||||||
|
@Basic
|
||||||
private String country;
|
private String country;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Empty constructor
|
||||||
|
*/
|
||||||
|
public Address() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the formatted
|
* @return the formatted address string
|
||||||
*/
|
*/
|
||||||
public String getFormatted() {
|
public String getFormatted() {
|
||||||
return formatted;
|
return formatted;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param formatted the formatted to set
|
* @param formatted the formatted address to set
|
||||||
*/
|
*/
|
||||||
public void setFormatted(String formatted) {
|
public void setFormatted(String formatted) {
|
||||||
this.formatted = formatted;
|
this.formatted = formatted;
|
||||||
|
|
|
@ -8,40 +8,56 @@ import javax.persistence.Entity;
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.GenerationType;
|
import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
import org.springframework.security.oauth2.provider.ClientDetails;
|
import org.springframework.security.oauth2.provider.ClientDetails;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
|
@Table(name="approvedsite")
|
||||||
public class ApprovedSite {
|
public class ApprovedSite {
|
||||||
|
|
||||||
// unique id
|
// unique id
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
// which user made the approval
|
// which user made the approval
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name="userinfo_id")
|
||||||
private UserInfo userInfo;
|
private UserInfo userInfo;
|
||||||
|
|
||||||
// which OAuth2 client is this tied to
|
// which OAuth2 client is this tied to
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name="clientdetails_id")
|
||||||
private ClientDetails clientDetails;
|
private ClientDetails clientDetails;
|
||||||
|
|
||||||
// when was this first approved?
|
// when was this first approved?
|
||||||
|
@Temporal(TemporalType.DATE)
|
||||||
private Date creationDate;
|
private Date creationDate;
|
||||||
|
|
||||||
// when was this last accessed?
|
// when was this last accessed?
|
||||||
|
@Temporal(TemporalType.DATE)
|
||||||
private Date accessDate;
|
private Date accessDate;
|
||||||
|
|
||||||
// if this is a time-limited access, when does it run out?
|
// if this is a time-limited access, when does it run out?
|
||||||
|
@Temporal(TemporalType.DATE)
|
||||||
private Date timeoutDate;
|
private Date timeoutDate;
|
||||||
|
|
||||||
// what scopes have been allowed
|
// what scopes have been allowed
|
||||||
// this should include all information for what data to access
|
// this should include all information for what data to access
|
||||||
|
@OneToMany(mappedBy = "approvedsite")
|
||||||
private Collection<String> allowedScopes;
|
private Collection<String> allowedScopes;
|
||||||
|
|
||||||
// TODO: should we store the OAuth2 tokens and IdTokens here?
|
// TODO: should we store the OAuth2 tokens and IdTokens here?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Empty constructor
|
||||||
|
*/
|
||||||
public ApprovedSite() {
|
public ApprovedSite() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,71 @@
|
||||||
package org.mitre.openid.connect.model;
|
package org.mitre.openid.connect.model;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
|
@Table(name="userinfo")
|
||||||
public class UserInfo {
|
public class UserInfo {
|
||||||
|
|
||||||
// TODO: underbars are awkward in java, should we switch all this to camel case and put in underbars in the serialization view?
|
// unique object id for persistence
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
// TODO: underbars are awkward in java, should we switch all this to camel case and put in underbars in the serialization view?
|
||||||
|
@Basic
|
||||||
private String user_id;
|
private String user_id;
|
||||||
|
@Basic
|
||||||
private String name;
|
private String name;
|
||||||
|
@Basic
|
||||||
private String given_name;
|
private String given_name;
|
||||||
|
@Basic
|
||||||
private String family_name;
|
private String family_name;
|
||||||
|
@Basic
|
||||||
private String middle_name;
|
private String middle_name;
|
||||||
|
@Basic
|
||||||
private String nickname;
|
private String nickname;
|
||||||
|
@Basic
|
||||||
private String profile;
|
private String profile;
|
||||||
|
@Basic
|
||||||
private String picture;
|
private String picture;
|
||||||
|
@Basic
|
||||||
private String website;
|
private String website;
|
||||||
|
@Basic
|
||||||
private String email;
|
private String email;
|
||||||
|
@Basic
|
||||||
private Boolean verified;
|
private Boolean verified;
|
||||||
|
@Basic
|
||||||
private String gender;
|
private String gender;
|
||||||
|
@Basic
|
||||||
private String zoneinfo;
|
private String zoneinfo;
|
||||||
|
@Basic
|
||||||
private String locale;
|
private String locale;
|
||||||
|
@Basic
|
||||||
private String phone_number;
|
private String phone_number;
|
||||||
|
@OneToOne
|
||||||
private Address address;
|
private Address address;
|
||||||
|
@Basic
|
||||||
private String updated_time;
|
private String updated_time;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the id
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param id the id to set
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @return the user_id
|
* @return the user_id
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
package org.mitre.openid.connect.model;
|
package org.mitre.openid.connect.model;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.GenerationType;
|
import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.OneToMany;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
import org.springframework.security.oauth2.provider.ClientDetails;
|
import org.springframework.security.oauth2.provider.ClientDetails;
|
||||||
|
|
||||||
|
@ -16,6 +19,8 @@ import org.springframework.security.oauth2.provider.ClientDetails;
|
||||||
* @author jricher
|
* @author jricher
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name="whitelistedsite")
|
||||||
public class WhitelistedSite {
|
public class WhitelistedSite {
|
||||||
|
|
||||||
// unique id
|
// unique id
|
||||||
|
@ -24,13 +29,80 @@ public class WhitelistedSite {
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
// who added this site to the whitelist (should be an admin)
|
// who added this site to the whitelist (should be an admin)
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name="userinfo_id")
|
||||||
private UserInfo userInfo;
|
private UserInfo userInfo;
|
||||||
|
|
||||||
// which OAuth2 client is this tied to
|
// which OAuth2 client is this tied to
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name="clientdetails_id")
|
||||||
private ClientDetails clientDetails;
|
private ClientDetails clientDetails;
|
||||||
|
|
||||||
// what scopes be allowed by default
|
// what scopes be allowed by default
|
||||||
// this should include all information for what data to access
|
// this should include all information for what data to access
|
||||||
@ManyToOne
|
@OneToMany(mappedBy="whitelistedsite")
|
||||||
private Collection<String> allowedScopes;
|
private Collection<String> allowedScopes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Empty constructor
|
||||||
|
*/
|
||||||
|
public WhitelistedSite() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the id
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the id to set
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the userInfo
|
||||||
|
*/
|
||||||
|
public UserInfo getUserInfo() {
|
||||||
|
return userInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param userInfo the userInfo to set
|
||||||
|
*/
|
||||||
|
public void setUserInfo(UserInfo userInfo) {
|
||||||
|
this.userInfo = userInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the clientDetails
|
||||||
|
*/
|
||||||
|
public ClientDetails getClientDetails() {
|
||||||
|
return clientDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param clientDetails the clientDetails to set
|
||||||
|
*/
|
||||||
|
public void setClientDetails(ClientDetails clientDetails) {
|
||||||
|
this.clientDetails = clientDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the allowedScopes
|
||||||
|
*/
|
||||||
|
public Collection<String> getAllowedScopes() {
|
||||||
|
return allowedScopes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param allowedScopes the allowedScopes to set
|
||||||
|
*/
|
||||||
|
public void setAllowedScopes(Collection<String> allowedScopes) {
|
||||||
|
this.allowedScopes = allowedScopes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue