Refactor part 3

pull/210/head
Amanda Anganes 2012-09-18 15:01:05 -04:00
parent ef80676dc1
commit 51073a7f8d
21 changed files with 6 additions and 66 deletions

View File

@ -3,7 +3,6 @@ package org.mitre.jwt.encryption;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import com.google.common.primitives.Bytes;
import com.google.common.primitives.Ints;
public abstract class AbstractJweEncrypter implements JweEncrypter {

View File

@ -20,7 +20,6 @@ import java.util.List;
import org.mitre.jwt.model.Jwt;
import com.google.common.base.Objects;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;

View File

@ -18,8 +18,6 @@ package org.mitre.jwt.signer;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
/**
* Enum to translate between the JWS defined algorithm names and the JSE algorithm names
*

View File

@ -33,7 +33,6 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

View File

@ -19,12 +19,9 @@
package org.mitre.oauth2.model;
import java.util.Date;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

View File

@ -16,10 +16,8 @@
package org.mitre.oauth2.service;
import java.util.Collection;
import java.util.Set;
import org.mitre.oauth2.model.ClientDetailsEntity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
import org.springframework.security.oauth2.provider.ClientDetailsService;

View File

@ -15,7 +15,6 @@
******************************************************************************/
package org.mitre.openid.connect.config;
import java.net.URI;
/**
* @author nemonik

View File

@ -17,7 +17,6 @@ package org.mitre.openid.connect.repository;
import java.util.Collection;
import org.mitre.openid.connect.model.DefaultUserInfo;
import org.mitre.openid.connect.model.UserInfo;
/**

View File

@ -59,6 +59,7 @@ public class X509CertificateView extends AbstractView {
private long daysNotValidBefore = 30;
private long daysNotValidAfter = 365;
@SuppressWarnings("deprecation")
@Override
protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws IOException {

View File

@ -1,28 +0,0 @@
/*******************************************************************************
* Copyright 2012 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.util;
import javax.servlet.http.HttpServletRequest;
/**
* A collection of utility methods.
*
*/
public class Utility {
// currently empty
}

View File

@ -14,10 +14,6 @@
* limitations under the License.
******************************************************************************/
package org.mitre.oauth2.exception;
/**
*
*/
/**
* @author aanganes
@ -25,10 +21,7 @@ package org.mitre.oauth2.exception;
*/
public class ClientNotFoundException extends RuntimeException {
/**
*
*/
private static final Long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
*

View File

@ -27,7 +27,7 @@ public class PermissionDeniedException extends RuntimeException {
/**
*
*/
private static final Long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
*

View File

@ -21,7 +21,6 @@ import java.util.Collection;
import java.util.UUID;
import org.apache.commons.codec.binary.Base64;
import org.bouncycastle.asn1.cmp.GenRepContent;
import org.mitre.oauth2.model.ClientDetailsEntity;
import org.mitre.oauth2.repository.OAuth2ClientRepository;
import org.mitre.oauth2.repository.OAuth2TokenRepository;
@ -30,19 +29,15 @@ import org.mitre.openid.connect.model.ApprovedSite;
import org.mitre.openid.connect.model.WhitelistedSite;
import org.mitre.openid.connect.repository.ApprovedSiteRepository;
import org.mitre.openid.connect.repository.WhitelistedSiteRepository;
import org.mitre.openid.connect.service.ApprovedSiteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.common.exceptions.InvalidClientException;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.common.base.Strings;
@Service
public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEntityService {
private SecureRandom random = new SecureRandom();
@Autowired
private OAuth2ClientRepository clientRepository;

View File

@ -24,7 +24,6 @@ import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationDetails;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
@Controller

View File

@ -21,9 +21,6 @@ package org.mitre.oauth2.web;
import org.mitre.oauth2.exception.ClientNotFoundException;
import org.mitre.oauth2.service.ClientDetailsEntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.oauth2.provider.AuthorizationRequest;
import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.stereotype.Controller;

View File

@ -23,8 +23,6 @@ import org.mitre.oauth2.model.OAuth2RefreshTokenEntity;
import org.mitre.oauth2.service.OAuth2TokenEntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.oauth2.common.exceptions.InvalidTokenException;
import org.springframework.security.oauth2.provider.AuthorizationRequest;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
@ -73,6 +71,7 @@ public class RevocationEndpoint {
}
if (principal instanceof OAuth2Authentication) {
//TODO what is this variable for? It is unused. is it just a validation check?
OAuth2AccessTokenEntity tok = tokenServices.getAccessToken((OAuth2Authentication) principal);
// we've got a client acting on its own behalf, not an admin

View File

@ -2,6 +2,8 @@ package org.mitre.openid.connect.exception;
public class UserNotFoundException extends RuntimeException {
private static final long serialVersionUID = 1L;
public UserNotFoundException() {
super();
// TODO Auto-generated constructor stub

View File

@ -30,7 +30,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.provider.ClientDetailsService;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.security.oauth2.provider.token.TokenEnhancer;
import org.springframework.stereotype.Service;

View File

@ -12,11 +12,8 @@ import javax.servlet.http.HttpServletResponse;
import org.mitre.oauth2.model.ClientDetailsEntity;
import org.springframework.stereotype.Component;
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;
import com.google.gson.JsonObject;

View File

@ -21,7 +21,6 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.http.HttpResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;

View File

@ -161,7 +161,6 @@ public class ClientDynamicRegistrationEndpoint {
}
}
@SuppressWarnings("unchecked")
@Override
public String getAsText() {
Set<String> set = (Set<String>) getValue();