diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/navmenu.tag b/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/navmenu.tag
index 78bfe15cb..2a87607e1 100644
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/navmenu.tag
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/navmenu.tag
@@ -21,14 +21,6 @@
-
-
-
-
-
-
-
-
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/views/home.jsp b/openid-connect-server-webapp/src/main/webapp/WEB-INF/views/home.jsp
index 5fa2495a5..c8194d690 100644
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/views/home.jsp
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/views/home.jsp
@@ -39,46 +39,8 @@
-
-
-
-
-
-
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/views/stats.jsp b/openid-connect-server-webapp/src/main/webapp/WEB-INF/views/stats.jsp
deleted file mode 100644
index 8e97e6b36..000000000
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/views/stats.jsp
+++ /dev/null
@@ -1,28 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
-<%@ taglib prefix="o" tagdir="/WEB-INF/tags"%>
-<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
-<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
-
-
-
-
-
-
-
-
diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/client.js b/openid-connect-server-webapp/src/main/webapp/resources/js/client.js
index a4c8097b0..bc3c7b55f 100644
--- a/openid-connect-server-webapp/src/main/webapp/resources/js/client.js
+++ b/openid-connect-server-webapp/src/main/webapp/resources/js/client.js
@@ -200,10 +200,6 @@ var RegistrationTokenModel = Backbone.Model.extend({
urlRoot: 'api/tokens/registration'
});
-var ClientStatsModel = Backbone.Model.extend({
- urlRoot: 'api/stats/byclientid'
-});
-
var ClientCollection = Backbone.Collection.extend({
initialize: function() {
@@ -303,7 +299,6 @@ var ClientView = Backbone.View.extend({
});
this.updateMatched();
- this.updateStats();
$(this.el).i18n();
@@ -312,12 +307,6 @@ var ClientView = Backbone.View.extend({
return this;
},
- updateStats: function(eventName) {
- $('.count', this.el).html(this.countTemplate({
- count: this.options.clientStat.get('approvedSiteCount')
- }));
- },
-
showRegistrationToken: function(e) {
e.preventDefault();
@@ -471,8 +460,6 @@ var ClientListView = Backbone.View.extend({
tagName: 'span',
- stats: {},
-
initialize: function(options) {
this.options = options;
this.filteredModel = this.model;
@@ -542,10 +529,8 @@ var ClientListView = Backbone.View.extend({
// togglePlaceholder)
_.each(this.filteredModel.models, function(client, index) {
- var clientStat = this.getStat(client.get('clientId'));
var view = new ClientView({
model: client,
- clientStat: clientStat,
systemScopeList: this.options.systemScopeList,
whiteList: this.options.whiteListList.getByClientId(client.get('clientId'))
});
@@ -569,15 +554,6 @@ var ClientListView = Backbone.View.extend({
return this.views[index];
},
- getStat: function(index) {
- if (!this.stats[index]) {
- this.stats[index] = new ClientStatsModel({
- id: index
- });
- }
- return this.stats[index];
- },
-
togglePlaceholder: function() {
// set up pagination
var numPages = Math.ceil(this.filteredModel.length / 10);
@@ -637,17 +613,6 @@ var ClientListView = Backbone.View.extend({
} else {
if (!view.isRendered) {
view.render();
- var clientStat = view.options.clientStat;
-
- // load and display the stats
- $.when(clientStat.fetchIfNeeded({
- success: function(e) {
-
- },
- error: app.errorHandlerView.handleError()
- })).done(function(e) {
- view.updateStats();
- });
}
$(view.el).show();
}
diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java b/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java
index 3416b84ea..b730329e3 100644
--- a/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java
+++ b/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java
@@ -17,17 +17,13 @@
*******************************************************************************/
package org.mitre.oauth2.service.impl;
-import java.math.BigInteger;
-import java.security.SecureRandom;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-
+import com.google.common.base.Strings;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import com.google.common.util.concurrent.UncheckedExecutionException;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParser;
import org.apache.commons.codec.binary.Base64;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
@@ -42,7 +38,6 @@ import org.mitre.openid.connect.config.ConfigurationPropertiesBean;
import org.mitre.openid.connect.model.WhitelistedSite;
import org.mitre.openid.connect.service.ApprovedSiteService;
import org.mitre.openid.connect.service.BlacklistedSiteService;
-import org.mitre.openid.connect.service.StatsService;
import org.mitre.openid.connect.service.WhitelistedSiteService;
import org.mitre.uma.model.ResourceSet;
import org.mitre.uma.service.ResourceSetService;
@@ -57,13 +52,16 @@ import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;
-import com.google.common.base.Strings;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.util.concurrent.UncheckedExecutionException;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
+import java.math.BigInteger;
+import java.security.SecureRandom;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
@Service
public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEntityService {
@@ -91,9 +89,6 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
@Autowired
private SystemScopeService scopeService;
- @Autowired
- private StatsService statsService;
-
@Autowired
private ResourceSetService resourceSetService;
@@ -142,14 +137,8 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
// check the sector URI
checkSectorIdentifierUri(client);
-
ensureNoReservedScopes(client);
-
- ClientDetailsEntity c = clientRepository.saveClient(client);
-
- statsService.resetCache();
-
- return c;
+ return clientRepository.saveClient(client);
}
/**
@@ -379,9 +368,6 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
// take care of the client itself
clientRepository.deleteClient(client);
-
- statsService.resetCache();
-
}
/**
diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthConfirmationController.java b/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthConfirmationController.java
index 29c9a1419..3d7a7b734 100644
--- a/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthConfirmationController.java
+++ b/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthConfirmationController.java
@@ -20,18 +20,11 @@
*/
package org.mitre.oauth2.web;
-import static org.mitre.openid.connect.request.ConnectRequestParameters.PROMPT;
-import static org.mitre.openid.connect.request.ConnectRequestParameters.PROMPT_SEPARATOR;
-
-import java.net.URISyntaxException;
-import java.security.Principal;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
+import com.google.common.base.Joiner;
+import com.google.common.base.Splitter;
+import com.google.common.base.Strings;
+import com.google.common.collect.Sets;
+import com.google.gson.JsonObject;
import org.apache.http.client.utils.URIBuilder;
import org.mitre.oauth2.model.ClientDetailsEntity;
import org.mitre.oauth2.model.SystemScope;
@@ -39,7 +32,6 @@ import org.mitre.oauth2.service.ClientDetailsEntityService;
import org.mitre.oauth2.service.SystemScopeService;
import org.mitre.openid.connect.model.UserInfo;
import org.mitre.openid.connect.service.ScopeClaimTranslationService;
-import org.mitre.openid.connect.service.StatsService;
import org.mitre.openid.connect.service.UserInfoService;
import org.mitre.openid.connect.view.HttpCodeView;
import org.slf4j.Logger;
@@ -55,11 +47,16 @@ import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;
-import com.google.common.base.Joiner;
-import com.google.common.base.Splitter;
-import com.google.common.base.Strings;
-import com.google.common.collect.Sets;
-import com.google.gson.JsonObject;
+import java.net.URISyntaxException;
+import java.security.Principal;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import static org.mitre.openid.connect.request.ConnectRequestParameters.PROMPT;
+import static org.mitre.openid.connect.request.ConnectRequestParameters.PROMPT_SEPARATOR;
/**
* @author jricher
@@ -82,9 +79,6 @@ public class OAuthConfirmationController {
@Autowired
private UserInfoService userInfoService;
- @Autowired
- private StatsService statsService;
-
@Autowired
private RedirectResolver redirectResolver;
@@ -201,25 +195,12 @@ public class OAuthConfirmationController {
model.put("claims", claimsForScopes);
- // client stats
- Integer count = statsService.getCountForClientId(client.getClientId()).getApprovedSiteCount();
- model.put("count", count);
-
-
// contacts
if (client.getContacts() != null) {
String contacts = Joiner.on(", ").join(client.getContacts());
model.put("contacts", contacts);
}
-
- // if the client is over a week old and has more than one registration, don't give such a big warning
- // instead, tag as "Generally Recognized As Safe" (gras)
- Date lastWeek = new Date(System.currentTimeMillis() - (60 * 60 * 24 * 7 * 1000));
- if (count > 1 && client.getCreatedAt() != null && client.getCreatedAt().before(lastWeek)) {
- model.put("gras", true);
- } else {
- model.put("gras", false);
- }
+ model.put("gras", true);
return "approve";
}
diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/model/ClientStat.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/model/ClientStat.java
deleted file mode 100644
index 0fd03f2c4..000000000
--- a/openid-connect-server/src/main/java/org/mitre/openid/connect/model/ClientStat.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright 2018 The MIT Internet Trust Consortium
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
-
-package org.mitre.openid.connect.model;
-
-/**
- * @author jricher
- */
-public class ClientStat {
-
- private Integer approvedSiteCount;
-
- public Integer getApprovedSiteCount() {
- return approvedSiteCount;
- }
-
- public void setApprovedSiteCount(Integer count) {
- this.approvedSiteCount = count;
- }
-
-}
diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/StatsService.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/StatsService.java
deleted file mode 100644
index 0b0042867..000000000
--- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/StatsService.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright 2018 The MIT Internet Trust Consortium
- *
- * Portions copyright 2011-2013 The MITRE Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
-/**
- *
- */
-package org.mitre.openid.connect.service;
-
-import java.util.Map;
-
-import org.mitre.openid.connect.model.ClientStat;
-
-/**
- * @author jricher
- *
- */
-public interface StatsService {
-
- /**
- * Calculate summary statistics
- * approvalCount: total approved sites
- * userCount: unique users
- * clientCount: unique clients
- *
- * @return
- */
- Map getSummaryStats();
-
- /**
- * Calculate the usage count for a single client
- *
- * @param clientId the id of the client to search on
- * @return
- */
- ClientStat getCountForClientId(String clientId);
-
- /**
- * Trigger the stats to be recalculated upon next update.
- */
- void resetCache();
-
-}
diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultApprovedSiteService.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultApprovedSiteService.java
index 05ddd5c0c..c3e91f711 100644
--- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultApprovedSiteService.java
+++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultApprovedSiteService.java
@@ -17,17 +17,13 @@
*******************************************************************************/
package org.mitre.openid.connect.service.impl;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
import org.mitre.oauth2.model.OAuth2AccessTokenEntity;
import org.mitre.oauth2.repository.OAuth2TokenRepository;
import org.mitre.openid.connect.model.ApprovedSite;
import org.mitre.openid.connect.repository.ApprovedSiteRepository;
import org.mitre.openid.connect.service.ApprovedSiteService;
-import org.mitre.openid.connect.service.StatsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -35,8 +31,10 @@ import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
/**
* Implementation of the ApprovedSiteService
@@ -58,9 +56,6 @@ public class DefaultApprovedSiteService implements ApprovedSiteService {
@Autowired
private OAuth2TokenRepository tokenRepository;
- @Autowired
- private StatsService statsService;
-
@Override
public Collection getAll() {
return approvedSiteRepository.getAll();
@@ -69,9 +64,7 @@ public class DefaultApprovedSiteService implements ApprovedSiteService {
@Override
@Transactional(value="defaultTransactionManager")
public ApprovedSite save(ApprovedSite approvedSite) {
- ApprovedSite a = approvedSiteRepository.save(approvedSite);
- statsService.resetCache();
- return a;
+ return approvedSiteRepository.save(approvedSite);
}
@Override
@@ -94,8 +87,6 @@ public class DefaultApprovedSiteService implements ApprovedSiteService {
}
approvedSiteRepository.remove(approvedSite);
-
- statsService.resetCache();
}
@Override
diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultStatsService.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultStatsService.java
deleted file mode 100644
index 2305fc16e..000000000
--- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultStatsService.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright 2018 The MIT Internet Trust Consortium
- *
- * Portions copyright 2011-2013 The MITRE Corporation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
-/**
- *
- */
-package org.mitre.openid.connect.service.impl;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-import org.mitre.openid.connect.model.ApprovedSite;
-import org.mitre.openid.connect.model.ClientStat;
-import org.mitre.openid.connect.service.ApprovedSiteService;
-import org.mitre.openid.connect.service.StatsService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
-
-/**
- * @author jricher
- *
- */
-@Service
-public class DefaultStatsService implements StatsService {
-
- @Autowired
- private ApprovedSiteService approvedSiteService;
-
- // stats cache
- private Supplier