From dd2abd94d18e7ecbea352884a1f997fa5271431d Mon Sep 17 00:00:00 2001 From: Amanda Anganes Date: Tue, 18 Sep 2012 14:36:27 -0400 Subject: [PATCH] Refactoring part 2 --- .../connect/service/AddressService.java | 60 ------------- .../openid/connect/service/EventService.java | 78 ----------------- .../connect/service/IdTokenClaimsService.java | 60 ------------- .../connect/service/IdTokenService.java | 60 ------------- .../connect/service/UserInfoService.java | 1 - .../service/impl/AddressServiceImpl.java | 73 ---------------- ...l.java => DefaultApprovedSiteService.java} | 6 +- ...eImpl.java => DefaultUserInfoService.java} | 6 +- ...=> DefaultUserInfoUserDetailsService.java} | 4 +- ...ava => DefaultWhitelistedSiteService.java} | 6 +- .../service/impl/EventServiceImpl.java | 84 ------------------- .../impl/IdTokenClaimsServiceImpl.java | 74 ---------------- .../service/impl/IdTokenServiceImpl.java | 74 ---------------- ...rovedSiteApi.java => ApprovedSiteAPI.java} | 2 +- .../openid/connect/web/UserInfoEndpoint.java | 5 -- .../{WhitelistApi.java => WhitelistAPI.java} | 3 +- 16 files changed, 12 insertions(+), 584 deletions(-) delete mode 100644 openid-connect-common/src/main/java/org/mitre/openid/connect/service/AddressService.java delete mode 100644 openid-connect-common/src/main/java/org/mitre/openid/connect/service/EventService.java delete mode 100644 openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenClaimsService.java delete mode 100644 openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenService.java delete mode 100644 openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/AddressServiceImpl.java rename openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/{ApprovedSiteServiceImpl.java => DefaultApprovedSiteService.java} (94%) rename openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/{UserInfoServiceImpl.java => DefaultUserInfoService.java} (92%) rename openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/{UserInfoUserDetailsService.java => DefaultUserInfoUserDetailsService.java} (91%) rename openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/{WhitelistedSiteServiceImpl.java => DefaultWhitelistedSiteService.java} (92%) delete mode 100644 openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/EventServiceImpl.java delete mode 100644 openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenClaimsServiceImpl.java delete mode 100644 openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenServiceImpl.java rename openid-connect-server/src/main/java/org/mitre/openid/connect/web/{ApprovedSiteApi.java => ApprovedSiteAPI.java} (98%) rename openid-connect-server/src/main/java/org/mitre/openid/connect/web/{WhitelistApi.java => WhitelistAPI.java} (97%) diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/service/AddressService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/AddressService.java deleted file mode 100644 index d4ac7f419..000000000 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/service/AddressService.java +++ /dev/null @@ -1,60 +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.openid.connect.service; - -import org.mitre.openid.connect.model.Address; - -/** - * Interface for Address service - * - * @author Michael Joseph Walsh - * - */ -public interface AddressService { - - /** - * Save an Address - * - * @param address - * the Address to be saved - */ - public void save(Address address); - - /** - * Get Address for id - * - * @param id - * id for Address - * @return Address for id, or null - */ - public Address getById(Long id); - - /** - * Remove the Address - * - * @param address - * the Address to remove - */ - public void remove(Address address); - - /** - * Remove the Address - * - * @param id - * id for Address to remove - */ - public void removeById(Long id); -} diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/service/EventService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/EventService.java deleted file mode 100644 index 0979c031a..000000000 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/service/EventService.java +++ /dev/null @@ -1,78 +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.openid.connect.service; - -import java.util.Collection; -import java.util.Date; - -import org.mitre.openid.connect.model.Event; - -/** - * Interface for Event service - * - * @author Michael Joseph Walsh - * - */ -public interface EventService { - /** - * Returns the Events for a given Date range - * - * @param start - * the Date to start from - * @param end - * the Date to end at - * @param startChunk - * the start chuck of a list you desire - * @param chunkSize - * the size of the chunk you desire - * - * @return a Collection of Events - */ - public Collection getEventsDuringPeriod(Date start, Date end, int startChunk, int chunkSize); - - /** - * Get Event by id - * - * @param id - * id for Event - * @return Event for id, or null - */ - public Event getById(Long id); - - /** - * Remove Event - * - * @param event - * Event to remove - */ - public void remove(Event event); - - /** - * Remove Event for id - * - * @param id - * id for Event to remove - */ - public void removeById(Long id); - - /** - * Save Event - * - * @param event - * Event to be saved - */ - public void save(Event event); -} diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenClaimsService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenClaimsService.java deleted file mode 100644 index 320a6019c..000000000 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenClaimsService.java +++ /dev/null @@ -1,60 +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.openid.connect.service; - -import org.mitre.openid.connect.model.IdTokenClaims; - -/** - * Interface for IdTokenClaims service - * - * @author Michael Joseph Walsh - * - */ -public interface IdTokenClaimsService { - - /** - * Save an IdTokenClaims - * - * @param address - * the Address to be saved - */ - public void save(IdTokenClaims idTokenClaims); - - /** - * Get IdTokenClaims for id - * - * @param id - * id for IdTokenClaims - * @return IdTokenClaims for id, or null - */ - public IdTokenClaims getById(Long id); - - /** - * Remove the IdTokenClaims - * - * @param idTokenClaims - * the IdTokenClaims to remove - */ - public void remove(IdTokenClaims idTokenClaims); - - /** - * Remove the IdTokenClaims - * - * @param id - * id for IdTokenClaims to remove - */ - public void removeById(Long id); -} diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenService.java deleted file mode 100644 index 84281358b..000000000 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenService.java +++ /dev/null @@ -1,60 +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.openid.connect.service; - -import org.mitre.openid.connect.model.IdToken; - -/** - * Interface for IdToken service - * - * @author Michael Joseph Walsh - * - */ -public interface IdTokenService { - - /** - * Save an IdToken - * - * @param idToken - * the IdToken to be saved - */ - public void save(IdToken idToken); - - /** - * Get IdToken for id - * - * @param id - * id for IdToken - * @return IdToken for id, or null - */ - public IdToken getById(Long id); - - /** - * Remove the IdToken - * - * @param idToken - * the IdToken to remove - */ - public void remove(IdToken idToken); - - /** - * Remove the IdToken - * - * @param id - * id for IdToken to remove - */ - public void removeById(Long id); -} diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/service/UserInfoService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/UserInfoService.java index 365cfa9c0..851b0502a 100644 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/service/UserInfoService.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/UserInfoService.java @@ -41,7 +41,6 @@ public interface UserInfoService { * @return UserInfo for user id, or null */ public UserInfo getByUserId(String userId); - /** * Remove the UserInfo * diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/AddressServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/AddressServiceImpl.java deleted file mode 100644 index d31427931..000000000 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/AddressServiceImpl.java +++ /dev/null @@ -1,73 +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.openid.connect.service.impl; - -import org.mitre.openid.connect.model.Address; -import org.mitre.openid.connect.repository.AddressRepository; -import org.mitre.openid.connect.service.AddressService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -/** - * Implementation of the AddressService - * - * @author Michael Joseph Walsh - * - */ -@Service -@Transactional -public class AddressServiceImpl implements AddressService { - - @Autowired - private AddressRepository addressRepository; - - /** - * Default constructor - */ - public AddressServiceImpl() { - - } - - /** - * Constructor for use in test harnesses. - * - * @param repository - */ - public AddressServiceImpl(AddressRepository addressRepository) { - this.addressRepository = addressRepository; - } - - @Override - public void save(Address address) { - this.addressRepository.save(address); - } - - @Override - public Address getById(Long id) { - return addressRepository.getById(id); - } - - @Override - public void remove(Address address) { - this.addressRepository.remove(address); - } - - @Override - public void removeById(Long id) { - this.addressRepository.removeById(id); - } -} diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/ApprovedSiteServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultApprovedSiteService.java similarity index 94% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/ApprovedSiteServiceImpl.java rename to openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultApprovedSiteService.java index cda5f62ed..105281570 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/ApprovedSiteServiceImpl.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultApprovedSiteService.java @@ -35,7 +35,7 @@ import org.springframework.transaction.annotation.Transactional; */ @Service @Transactional -public class ApprovedSiteServiceImpl implements ApprovedSiteService { +public class DefaultApprovedSiteService implements ApprovedSiteService { @Autowired private ApprovedSiteRepository approvedSiteRepository; @@ -43,7 +43,7 @@ public class ApprovedSiteServiceImpl implements ApprovedSiteService { /** * Default constructor */ - public ApprovedSiteServiceImpl() { + public DefaultApprovedSiteService() { } @@ -52,7 +52,7 @@ public class ApprovedSiteServiceImpl implements ApprovedSiteService { * * @param repository */ - public ApprovedSiteServiceImpl(ApprovedSiteRepository approvedSiteRepository) { + public DefaultApprovedSiteService(ApprovedSiteRepository approvedSiteRepository) { this.approvedSiteRepository = approvedSiteRepository; } diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/UserInfoServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultUserInfoService.java similarity index 92% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/UserInfoServiceImpl.java rename to openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultUserInfoService.java index 45c31fd60..64a344931 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/UserInfoServiceImpl.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultUserInfoService.java @@ -30,7 +30,7 @@ import org.springframework.transaction.annotation.Transactional; */ @Service @Transactional -public class UserInfoServiceImpl implements UserInfoService { +public class DefaultUserInfoService implements UserInfoService { @Autowired private UserInfoRepository userInfoRepository; @@ -38,7 +38,7 @@ public class UserInfoServiceImpl implements UserInfoService { /** * Default constructor */ - public UserInfoServiceImpl() { + public DefaultUserInfoService() { } @@ -47,7 +47,7 @@ public class UserInfoServiceImpl implements UserInfoService { * * @param repository */ - public UserInfoServiceImpl(UserInfoRepository userInfoRepository) { + public DefaultUserInfoService(UserInfoRepository userInfoRepository) { this.userInfoRepository = userInfoRepository; } diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/UserInfoUserDetailsService.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultUserInfoUserDetailsService.java similarity index 91% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/UserInfoUserDetailsService.java rename to openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultUserInfoUserDetailsService.java index ae933abf1..498cc35c0 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/UserInfoUserDetailsService.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultUserInfoUserDetailsService.java @@ -6,9 +6,7 @@ import java.util.List; import org.mitre.openid.connect.model.UserInfo; import org.mitre.openid.connect.repository.UserInfoRepository; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Primary; import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.GrantedAuthorityImpl; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; @@ -23,7 +21,7 @@ import org.springframework.stereotype.Service; * */ @Service("userInfoUserDetailsService") -public class UserInfoUserDetailsService implements UserDetailsService { +public class DefaultUserInfoUserDetailsService implements UserDetailsService { @Autowired UserInfoRepository repository; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/WhitelistedSiteServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultWhitelistedSiteService.java similarity index 92% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/WhitelistedSiteServiceImpl.java rename to openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultWhitelistedSiteService.java index 64241d01e..6cfd710c5 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/WhitelistedSiteServiceImpl.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/DefaultWhitelistedSiteService.java @@ -32,7 +32,7 @@ import org.springframework.transaction.annotation.Transactional; */ @Service @Transactional -public class WhitelistedSiteServiceImpl implements WhitelistedSiteService { +public class DefaultWhitelistedSiteService implements WhitelistedSiteService { @Autowired private WhitelistedSiteRepository repository; @@ -40,7 +40,7 @@ public class WhitelistedSiteServiceImpl implements WhitelistedSiteService { /** * Default constructor */ - public WhitelistedSiteServiceImpl() { + public DefaultWhitelistedSiteService() { } @@ -49,7 +49,7 @@ public class WhitelistedSiteServiceImpl implements WhitelistedSiteService { * * @param repository */ - public WhitelistedSiteServiceImpl(WhitelistedSiteRepository whitelistedSiteRepository) { + public DefaultWhitelistedSiteService(WhitelistedSiteRepository whitelistedSiteRepository) { this.repository = whitelistedSiteRepository; } diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/EventServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/EventServiceImpl.java deleted file mode 100644 index 3884ed759..000000000 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/EventServiceImpl.java +++ /dev/null @@ -1,84 +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.openid.connect.service.impl; - -import java.util.Collection; -import java.util.Date; - -import org.mitre.openid.connect.model.Event; -import org.mitre.openid.connect.repository.EventRepository; -import org.mitre.openid.connect.service.EventService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -/** - * Implementation of the EventService - * - * @author Michael Joseph Walsh - * - */ -@Service -@Transactional -public class EventServiceImpl implements EventService { - - @Autowired - private EventRepository eventRepository; - - /** - * Default constructor - */ - public EventServiceImpl() { - - } - - /** - * Constructor for use in test harnesses. - * - * @param repository - */ - public EventServiceImpl(EventRepository eventRepository) { - this.eventRepository = eventRepository; - } - - @Override - public Collection getEventsDuringPeriod(Date start, Date end, - int startChunk, int chunkSize) { - - return eventRepository.getEventsDuringPeriod(start, end, startChunk, chunkSize); - } - - @Override - public Event getById(Long id) { - return eventRepository.getById(id); - } - - @Override - public void remove(Event event) { - eventRepository.remove(event); - } - - @Override - public void removeById(Long id) { - eventRepository.removeById(id); - } - - @Override - public void save(Event event) { - eventRepository.save(event); - } - -} diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenClaimsServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenClaimsServiceImpl.java deleted file mode 100644 index 980d421bf..000000000 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenClaimsServiceImpl.java +++ /dev/null @@ -1,74 +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.openid.connect.service.impl; - -import org.mitre.openid.connect.model.IdTokenClaims; -import org.mitre.openid.connect.repository.IdTokenClaimsRepository; -import org.mitre.openid.connect.service.IdTokenClaimsService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -/** - * Implementation of the IdTokenClaimsService - * - * @author Michael Joseph Walsh - * - */ -@Service -@Transactional -public class IdTokenClaimsServiceImpl implements IdTokenClaimsService { - - @Autowired - private IdTokenClaimsRepository idTokenClaimsRepository; - - /** - * Default constructor - */ - public IdTokenClaimsServiceImpl() { - - } - - /** - * Constructor for use in test harnesses. - * - * @param repository - */ - public IdTokenClaimsServiceImpl(IdTokenClaimsRepository idTokenClaimsRepository) { - this.idTokenClaimsRepository = idTokenClaimsRepository; - } - - @Override - public void save(IdTokenClaims idTokenClaims) { - idTokenClaimsRepository.save(idTokenClaims); - } - - @Override - public IdTokenClaims getById(Long id) { - return idTokenClaimsRepository.getById(id); - } - - @Override - public void remove(IdTokenClaims idTokenClaims) { - idTokenClaimsRepository.remove(idTokenClaims); - } - - @Override - public void removeById(Long id) { - idTokenClaimsRepository.removeById(id); - } - -} diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenServiceImpl.java deleted file mode 100644 index cf61a58b8..000000000 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenServiceImpl.java +++ /dev/null @@ -1,74 +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.openid.connect.service.impl; - -import org.mitre.openid.connect.model.IdToken; -import org.mitre.openid.connect.repository.IdTokenRepository; -import org.mitre.openid.connect.service.IdTokenService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -/** - * Implementation of the IdTokenService - * - * @author Michael Joseph Walsh - * - */ -@Service -@Transactional -public class IdTokenServiceImpl implements IdTokenService { - - @Autowired - private IdTokenRepository idTokenRepository; - - /** - * Default constructor - */ - public IdTokenServiceImpl() { - - } - - /** - * Constructor for use in test harnesses. - * - * @param repository - */ - public IdTokenServiceImpl(IdTokenRepository idTokenRepository) { - this.idTokenRepository = idTokenRepository; - } - - @Override - public void save(IdToken idToken) { - idTokenRepository.save(idToken); - } - - @Override - public IdToken getById(Long id) { - return idTokenRepository.getById(id); - } - - @Override - public void remove(IdToken idToken) { - idTokenRepository.remove(idToken); - } - - @Override - public void removeById(Long id) { - idTokenRepository.removeById(id); - } - -} diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ApprovedSiteApi.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ApprovedSiteAPI.java similarity index 98% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/web/ApprovedSiteApi.java rename to openid-connect-server/src/main/java/org/mitre/openid/connect/web/ApprovedSiteAPI.java index 63456f6b2..e30bb519d 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ApprovedSiteApi.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ApprovedSiteAPI.java @@ -28,7 +28,7 @@ import com.google.gson.JsonParser; @Controller @RequestMapping("/api/approved") @PreAuthorize("hasRole('ROLE_USER')") -public class ApprovedSiteApi { +public class ApprovedSiteAPI { @Autowired private ApprovedSiteService approvedSiteService; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java index abc115f08..193c5a843 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java @@ -18,14 +18,12 @@ package org.mitre.openid.connect.web; import java.security.Principal; import java.util.Map; -import org.mitre.oauth2.service.OAuth2TokenEntityService; import org.mitre.openid.connect.exception.UnknownUserInfoSchemaException; import org.mitre.openid.connect.exception.UserNotFoundException; import org.mitre.openid.connect.model.UserInfo; import org.mitre.openid.connect.service.UserInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.oauth2.common.exceptions.InvalidScopeException; import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.stereotype.Controller; @@ -44,9 +42,6 @@ import com.google.common.collect.ImmutableMap; */ @Controller public class UserInfoEndpoint { - - @Autowired - private OAuth2TokenEntityService tokenService; @Autowired private UserInfoService userInfoService; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/WhitelistApi.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/WhitelistAPI.java similarity index 97% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/web/WhitelistApi.java rename to openid-connect-server/src/main/java/org/mitre/openid/connect/web/WhitelistAPI.java index 5a6ce331d..dad39937e 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/WhitelistApi.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/WhitelistAPI.java @@ -6,7 +6,6 @@ package org.mitre.openid.connect.web; import java.security.Principal; import java.util.Collection; -import org.mitre.oauth2.model.ClientDetailsEntity; import org.mitre.openid.connect.model.WhitelistedSite; import org.mitre.openid.connect.service.WhitelistedSiteService; import org.springframework.beans.factory.annotation.Autowired; @@ -30,7 +29,7 @@ import com.google.gson.JsonParser; @Controller @RequestMapping("/api/whitelist") @PreAuthorize("hasRole('ROLE_ADMIN')") -public class WhitelistApi { +public class WhitelistAPI { @Autowired private WhitelistedSiteService whitelistService;