checked in stuff

pull/59/head
Amanda Anganes 2012-01-10 16:17:12 -05:00
parent c4dfe35f44
commit 6cce82f484
8 changed files with 174 additions and 12 deletions

View File

@ -10,8 +10,14 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>

View File

@ -4,13 +4,16 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<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.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">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="/spring-security-oauth2"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -31,8 +31,14 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>

View File

@ -3,9 +3,9 @@
<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/resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/webapp"/>
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/spring-security-oauth2/spring-security-oauth2">
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<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>
</dependent-module>
<property name="java-output-path" value="/openid/target/classes"/>

View File

@ -1,5 +1,6 @@
package org.mitre.openid.connect.model;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
@ -8,24 +9,43 @@ import javax.persistence.Id;
@Entity
public class Address {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
@Basic
private String formatted;
@Basic
private String street_address;
@Basic
private String locality;
@Basic
private String region;
@Basic
private String postal_code;
@Basic
private String country;
/**
* Empty constructor
*/
public Address() {
}
/**
* @return the formatted
* @return the formatted address string
*/
public String getFormatted() {
return formatted;
}
/**
* @param formatted the formatted to set
* @param formatted the formatted address to set
*/
public void setFormatted(String formatted) {
this.formatted = formatted;

View File

@ -8,40 +8,56 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.springframework.security.oauth2.provider.ClientDetails;
@Entity
@Table(name="approvedsite")
public class ApprovedSite {
// unique id
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
// which user made the approval
@ManyToOne
@JoinColumn(name="userinfo_id")
private UserInfo userInfo;
// which OAuth2 client is this tied to
@ManyToOne
@JoinColumn(name="clientdetails_id")
private ClientDetails clientDetails;
// when was this first approved?
@Temporal(TemporalType.DATE)
private Date creationDate;
// when was this last accessed?
@Temporal(TemporalType.DATE)
private Date accessDate;
// if this is a time-limited access, when does it run out?
@Temporal(TemporalType.DATE)
private Date timeoutDate;
// what scopes have been allowed
// this should include all information for what data to access
@OneToMany(mappedBy = "approvedsite")
private Collection<String> allowedScopes;
// TODO: should we store the OAuth2 tokens and IdTokens here?
/**
* Empty constructor
*/
public ApprovedSite() {
}

View File

@ -1,32 +1,71 @@
package org.mitre.openid.connect.model;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
@Entity
@Table(name="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;
@Basic
private String name;
@Basic
private String given_name;
@Basic
private String family_name;
@Basic
private String middle_name;
@Basic
private String nickname;
@Basic
private String profile;
@Basic
private String picture;
@Basic
private String website;
@Basic
private String email;
@Basic
private Boolean verified;
@Basic
private String gender;
@Basic
private String zoneinfo;
@Basic
private String locale;
@Basic
private String phone_number;
@OneToOne
private Address address;
@Basic
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
*/

View File

@ -1,12 +1,15 @@
package org.mitre.openid.connect.model;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.springframework.security.oauth2.provider.ClientDetails;
@ -16,6 +19,8 @@ import org.springframework.security.oauth2.provider.ClientDetails;
* @author jricher
*
*/
@Entity
@Table(name="whitelistedsite")
public class WhitelistedSite {
// unique id
@ -24,13 +29,80 @@ public class WhitelistedSite {
private Long id;
// who added this site to the whitelist (should be an admin)
@ManyToOne
@JoinColumn(name="userinfo_id")
private UserInfo userInfo;
// which OAuth2 client is this tied to
@ManyToOne
@JoinColumn(name="clientdetails_id")
private ClientDetails clientDetails;
// what scopes be allowed by default
// this should include all information for what data to access
@ManyToOne
@OneToMany(mappedBy="whitelistedsite")
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;
}
}