fixed information leaks from approved site API

pull/607/head
Justin Richer 2014-05-28 18:21:46 -04:00
parent a84c10fc1c
commit dfdc4ed52d
2 changed files with 8 additions and 3 deletions

View File

@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.mitre.oauth2.model.OAuth2AccessTokenEntity;
import org.mitre.openid.connect.model.WhitelistedSite;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
@ -73,13 +74,17 @@ public class JsonApprovedSiteView extends AbstractView {
})
.registerTypeAdapter(OAuth2AccessTokenEntity.class, new JsonSerializer<OAuth2AccessTokenEntity>() {
@Override
public JsonElement serialize(OAuth2AccessTokenEntity src,
Type typeOfSrc, JsonSerializationContext context) {
return new JsonPrimitive(src.getId());
}
})
.registerTypeAdapter(WhitelistedSite.class, new JsonSerializer<WhitelistedSite>() {
@Override
public JsonElement serialize(WhitelistedSite src, Type typeOfSrc, JsonSerializationContext context) {
return new JsonPrimitive(src.getId());
}
})
.serializeNulls()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")

View File

@ -65,7 +65,7 @@ public class ApprovedSiteAPI {
m.put("entity", all);
return "jsonEntityView";
return "jsonApprovedSiteView";
}
/**