Previous commit did not include newly created files.
Removed local-value.conf from git tracking since it should not be tracked.pull/59/head
parent
6078c68f96
commit
1fbe4632bb
|
@ -0,0 +1,88 @@
|
|||
package org.mitre.openid.connect.model;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@Entity
|
||||
public class Address {
|
||||
|
||||
private String formatted;
|
||||
private String street_address;
|
||||
private String locality;
|
||||
private String region;
|
||||
private String postal_code;
|
||||
private String country;
|
||||
|
||||
/**
|
||||
* @return the formatted
|
||||
*/
|
||||
public String getFormatted() {
|
||||
return formatted;
|
||||
}
|
||||
/**
|
||||
* @param formatted the formatted to set
|
||||
*/
|
||||
public void setFormatted(String formatted) {
|
||||
this.formatted = formatted;
|
||||
}
|
||||
/**
|
||||
* @return the street_address
|
||||
*/
|
||||
public String getStreet_address() {
|
||||
return street_address;
|
||||
}
|
||||
/**
|
||||
* @param street_address the street_address to set
|
||||
*/
|
||||
public void setStreet_address(String street_address) {
|
||||
this.street_address = street_address;
|
||||
}
|
||||
/**
|
||||
* @return the locality
|
||||
*/
|
||||
public String getLocality() {
|
||||
return locality;
|
||||
}
|
||||
/**
|
||||
* @param locality the locality to set
|
||||
*/
|
||||
public void setLocality(String locality) {
|
||||
this.locality = locality;
|
||||
}
|
||||
/**
|
||||
* @return the region
|
||||
*/
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
/**
|
||||
* @param region the region to set
|
||||
*/
|
||||
public void setRegion(String region) {
|
||||
this.region = region;
|
||||
}
|
||||
/**
|
||||
* @return the postal_code
|
||||
*/
|
||||
public String getPostal_code() {
|
||||
return postal_code;
|
||||
}
|
||||
/**
|
||||
* @param postal_code the postal_code to set
|
||||
*/
|
||||
public void setPostal_code(String postal_code) {
|
||||
this.postal_code = postal_code;
|
||||
}
|
||||
/**
|
||||
* @return the country
|
||||
*/
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
/**
|
||||
* @param country the country to set
|
||||
*/
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package org.mitre.openid.connect.model.serializer;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.web.servlet.view.AbstractView;
|
||||
|
||||
import com.google.gson.ExclusionStrategy;
|
||||
import com.google.gson.FieldAttributes;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
public class JSONIdTokenView extends AbstractView {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.view.AbstractView#renderMergedOutputModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||
*/
|
||||
protected void renderMergedOutputModel(Map<String, Object> model,
|
||||
HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception {
|
||||
|
||||
Gson gson = new GsonBuilder()
|
||||
.setExclusionStrategies(new ExclusionStrategy() {
|
||||
|
||||
public boolean shouldSkipField(FieldAttributes f) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean shouldSkipClass(Class<?> clazz) {
|
||||
// skip the JPA binding wrapper
|
||||
if (clazz.equals(BeanPropertyBindingResult.class)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}).create();
|
||||
|
||||
response.setContentType("application/json");
|
||||
|
||||
Writer out = response.getWriter();
|
||||
|
||||
Object obj = model.get("entity");
|
||||
if (obj == null) {
|
||||
obj = model;
|
||||
}
|
||||
|
||||
gson.toJson(obj, out);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package org.mitre.openid.connect.model.serializer;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.web.servlet.view.AbstractView;
|
||||
|
||||
import com.google.gson.ExclusionStrategy;
|
||||
import com.google.gson.FieldAttributes;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
public class JSONUserInfoView extends AbstractView{
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.web.servlet.view.AbstractView#renderMergedOutputModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||
*/
|
||||
protected void renderMergedOutputModel(Map<String, Object> model,
|
||||
HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception {
|
||||
|
||||
Gson gson = new GsonBuilder()
|
||||
.setExclusionStrategies(new ExclusionStrategy() {
|
||||
|
||||
public boolean shouldSkipField(FieldAttributes f) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean shouldSkipClass(Class<?> clazz) {
|
||||
// skip the JPA binding wrapper
|
||||
if (clazz.equals(BeanPropertyBindingResult.class)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}).create();
|
||||
|
||||
response.setContentType("application/json");
|
||||
|
||||
Writer out = response.getWriter();
|
||||
|
||||
Object obj = model.get("entity");
|
||||
if (obj == null) {
|
||||
obj = model;
|
||||
}
|
||||
|
||||
gson.toJson(obj, out);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue