removed some vestigial service/repository calls, closes #513
parent
ecfb72bc50
commit
b376bc6059
|
@ -67,7 +67,7 @@ public class ClientKeyPublisher implements BeanDefinitionRegistryPostProcessor {
|
|||
// view bean
|
||||
BeanDefinitionBuilder jwkView = BeanDefinitionBuilder.rootBeanDefinition(JWKSetView.class);
|
||||
registry.registerBeanDefinition(JWKSetView.VIEWNAME, jwkView.getBeanDefinition());
|
||||
viewResolver.addPropertyReference("jwk", "jwkKeyList");
|
||||
viewResolver.addPropertyReference("jwk", JWKSetView.VIEWNAME);
|
||||
}
|
||||
|
||||
registry.registerBeanDefinition("clientKeyMapping", clientKeyMapping.getBeanDefinition());
|
||||
|
|
|
@ -34,7 +34,6 @@ import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
|||
@Table(name = "authentication_holder")
|
||||
@NamedQueries ({
|
||||
@NamedQuery(name = "AuthenticationHolderEntity.getAll", query = "select a from AuthenticationHolderEntity a"),
|
||||
@NamedQuery(name = "AuthenticationHolderEntity.getByAuthentication", query = "select a from AuthenticationHolderEntity a where a.authentication = :authentication"),
|
||||
@NamedQuery(name = "AuthenticationHolderEntity.getUnusedAuthenticationHolders", query = "select a from AuthenticationHolderEntity a where a.id not in (select t.authenticationHolder.id from OAuth2AccessTokenEntity t) and a.id not in (select r.authenticationHolder.id from OAuth2RefreshTokenEntity r)")
|
||||
})
|
||||
public class AuthenticationHolderEntity {
|
||||
|
|
|
@ -26,10 +26,6 @@ public interface AuthenticationHolderRepository {
|
|||
|
||||
public AuthenticationHolderEntity getById(Long id);
|
||||
|
||||
public AuthenticationHolderEntity getByAuthentication(OAuth2Authentication a);
|
||||
|
||||
public void removeById(Long id);
|
||||
|
||||
public void remove(AuthenticationHolderEntity a);
|
||||
|
||||
public AuthenticationHolderEntity save(AuthenticationHolderEntity a);
|
||||
|
|
|
@ -35,28 +35,4 @@ public interface AddressRepository {
|
|||
*/
|
||||
public Address getById(Long id);
|
||||
|
||||
/**
|
||||
* Removes the given Address from the repository
|
||||
*
|
||||
* @param address
|
||||
* the Address object to remove
|
||||
*/
|
||||
public void remove(Address address);
|
||||
|
||||
/**
|
||||
* Removes an Address from the repository
|
||||
*
|
||||
* @param id
|
||||
* the id of the Address to remove
|
||||
*/
|
||||
public void removeById(Long id);
|
||||
|
||||
/**
|
||||
* Persists a Address
|
||||
*
|
||||
* @param address
|
||||
* the Address to be saved
|
||||
* @return
|
||||
*/
|
||||
public Address save(Address address);
|
||||
}
|
||||
|
|
|
@ -26,22 +26,6 @@ import org.mitre.openid.connect.model.UserInfo;
|
|||
*/
|
||||
public interface UserInfoRepository {
|
||||
|
||||
/**
|
||||
* Persists a UserInfo object, if possible.
|
||||
*
|
||||
* @param user
|
||||
* @return the persisted object
|
||||
*/
|
||||
public UserInfo save(UserInfo userInfo);
|
||||
|
||||
/**
|
||||
* Removes the given UserInfo from the repository, if possible.
|
||||
*
|
||||
* @param userInfo
|
||||
* the UserInfo object to remove
|
||||
*/
|
||||
public void remove(UserInfo userInfo);
|
||||
|
||||
/**
|
||||
* Get a UserInfo object by its preferred_username field
|
||||
* @param username
|
||||
|
|
|
@ -26,23 +26,6 @@ import org.mitre.openid.connect.model.UserInfo;
|
|||
*/
|
||||
public interface UserInfoService {
|
||||
|
||||
/**
|
||||
* Save an UserInfo
|
||||
*
|
||||
* @param userInfo
|
||||
* the UserInfo to be saved
|
||||
*/
|
||||
public void save(UserInfo userInfo);
|
||||
|
||||
/**
|
||||
* Remove the UserInfo
|
||||
*
|
||||
* @param userInfo
|
||||
* the UserInfo to remove
|
||||
*/
|
||||
public void remove(UserInfo userInfo);
|
||||
|
||||
|
||||
/**
|
||||
* Get the UserInfo for the given username (usually maps to the
|
||||
* preferredUsername field).
|
||||
|
|
|
@ -52,13 +52,7 @@ public interface WhitelistedSiteService {
|
|||
*/
|
||||
public WhitelistedSite getByClientId(String clientId);
|
||||
|
||||
/**
|
||||
* Return a collection of the WhitelistedSites created by a given user
|
||||
*
|
||||
* @param creator the user id of an admin who may have made some WhitelistedSites
|
||||
* @return the collection of corresponding WhitelistedSites, if any, or null
|
||||
*/
|
||||
public Collection<WhitelistedSite> getByCreator(String creatorId);
|
||||
|
||||
|
||||
/**
|
||||
* Removes the given WhitelistedSite from the repository
|
||||
|
|
|
@ -49,24 +49,6 @@ public class JpaAuthenticationHolderRepository implements AuthenticationHolderRe
|
|||
return manager.find(AuthenticationHolderEntity.class, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuthenticationHolderEntity getByAuthentication(OAuth2Authentication a) {
|
||||
TypedQuery<AuthenticationHolderEntity> query = manager.createNamedQuery("AuthenticationHolderEntity.getByAuthentication", AuthenticationHolderEntity.class);
|
||||
query.setParameter("authentication", a);
|
||||
return JpaUtil.getSingleResult(query.getResultList());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void removeById(Long id) {
|
||||
AuthenticationHolderEntity found = getById(id);
|
||||
if (found != null) {
|
||||
manager.remove(found);
|
||||
} else {
|
||||
throw new IllegalArgumentException("AuthenticationHolderEntity not found: " + id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void remove(AuthenticationHolderEntity a) {
|
||||
|
|
|
@ -44,29 +44,4 @@ public class JpaAddressRepository implements AddressRepository {
|
|||
return manager.find(Address.class, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void remove(Address address) {
|
||||
Address found = manager.find(Address.class, address.getId());
|
||||
|
||||
if (found != null) {
|
||||
manager.remove(address);
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void removeById(Long id) {
|
||||
Address found = getById(id);
|
||||
|
||||
manager.remove(found);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Address save(Address address) {
|
||||
return saveOrUpdate(address.getId(), manager, address);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,26 +41,6 @@ public class JpaUserInfoRepository implements UserInfoRepository {
|
|||
@PersistenceContext
|
||||
private EntityManager manager;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public UserInfo save(UserInfo userInfo) {
|
||||
DefaultUserInfo dui = (DefaultUserInfo)userInfo;
|
||||
return saveOrUpdate(dui.getId(), manager, dui);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void remove(UserInfo userInfo) {
|
||||
DefaultUserInfo dui = (DefaultUserInfo)userInfo;
|
||||
UserInfo found = manager.find(DefaultUserInfo.class, dui.getId());
|
||||
|
||||
if (found != null) {
|
||||
manager.remove(userInfo);
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single UserInfo object by its username
|
||||
*/
|
||||
|
|
|
@ -44,16 +44,6 @@ public class DefaultUserInfoService implements UserInfoService {
|
|||
@Autowired
|
||||
private PairwiseIdentiferService pairwiseIdentifierService;
|
||||
|
||||
@Override
|
||||
public void save(UserInfo userInfo) {
|
||||
userInfoRepository.save(userInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(UserInfo userInfo) {
|
||||
userInfoRepository.remove(userInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserInfo getByUsername(String username) {
|
||||
return userInfoRepository.getByUsername(username);
|
||||
|
|
|
@ -66,11 +66,6 @@ public class DefaultWhitelistedSiteService implements WhitelistedSiteService {
|
|||
return repository.getByClientId(clientId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<WhitelistedSite> getByCreator(String creatorId) {
|
||||
return repository.getByCreator(creatorId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WhitelistedSite update(WhitelistedSite oldWhitelistedSite, WhitelistedSite whitelistedSite) {
|
||||
if (oldWhitelistedSite == null || whitelistedSite == null) {
|
||||
|
|
Loading…
Reference in New Issue