Browse Source

Add missing descriptions

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.3-alpha
Pekka Helenius 4 years ago
parent
commit
81da9d96d8
5 changed files with 39 additions and 9 deletions
  1. +13
    -5
      bookstore/src/main/java/com/fjordtek/bookstore/config/WebSecurityConfig.java
  2. +4
    -0
      bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryCustom.java
  3. +4
    -0
      bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryImpl.java
  4. +12
    -0
      bookstore/src/main/java/com/fjordtek/bookstore/service/session/BookStoreAccessDeniedHandler.java
  5. +6
    -4
      bookstore/src/main/java/com/fjordtek/bookstore/service/session/UserDetailServiceImpl.java

+ 13
- 5
bookstore/src/main/java/com/fjordtek/bookstore/config/WebSecurityConfig.java View File

@ -16,11 +16,19 @@ import com.fjordtek.bookstore.service.session.BookStoreAccessDeniedHandler;
import com.fjordtek.bookstore.service.session.UserDetailServiceImpl;
/**
*
* @see https://docs.spring.io/spring-security/site/docs/current/reference/html5/#multiple-httpsecurity
*
* @author Pekka Helenius
*/
*
* This class and its subclasses extend Spring Framework security
* WebSecurityConfigurerAdapter configuration for HTTP end points and sessions.
* <p>
* The class uses a custom UserDetailService interface class implementation
* to determine proper user authorities.
* <p>
* This class has multiple sub-configurations for different end points.
*
* @see https://docs.spring.io/spring-security/site/docs/current/reference/html5/#multiple-httpsecurity
*
* @author Pekka Helenius
*/
@Configuration
@EnableWebSecurity


+ 4
- 0
bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryCustom.java View File

@ -1,9 +1,13 @@
//Pekka Helenius <fincer89@hotmail.com>, Fjordtek 2020
package com.fjordtek.bookstore.model.book;
import java.util.List;
/**
*
* This interface defines additional methods for BookRepository.
*
* @author Pekka Helenius
*/


+ 4
- 0
bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryImpl.java View File

@ -1,3 +1,5 @@
//Pekka Helenius <fincer89@hotmail.com>, Fjordtek 2020
package com.fjordtek.bookstore.model.book;
import java.util.List;
@ -10,6 +12,8 @@ import javax.persistence.TypedQuery;
import org.springframework.transaction.annotation.Transactional;
/**
*
* This class implements methods defined in BookRepositoryCustom interface.
*
* @author Pekka Helenius
*/


+ 12
- 0
bookstore/src/main/java/com/fjordtek/bookstore/service/session/BookStoreAccessDeniedHandler.java View File

@ -1,3 +1,5 @@
//Pekka Helenius <fincer89@hotmail.com>, Fjordtek 2020
package com.fjordtek.bookstore.service.session;
import java.io.IOException;
@ -14,6 +16,16 @@ import org.springframework.stereotype.Component;
import com.fjordtek.bookstore.service.HttpServerLogger;
/**
*
* This class implements Spring Framework security AccessDeniedHandler
* interface with specific method overrides.
* <p>
* Main purpose is to properly handle erroneous client requests.
*
* @author Pekka Helenius
*/
@Component
public class BookStoreAccessDeniedHandler implements AccessDeniedHandler {


+ 6
- 4
bookstore/src/main/java/com/fjordtek/bookstore/service/session/UserDetailServiceImpl.java View File

@ -19,10 +19,12 @@ import com.fjordtek.bookstore.model.auth.UserRole;
import com.fjordtek.bookstore.model.auth.UserRoleRepository;
/**
*
*
* @author Pekka Helenius
*/
*
* This class implements Spring Framework security UserDetailsService interface,
* adding custom methods to define proper user authorities.
*
* @author Pekka Helenius
*/
@Service
public class UserDetailServiceImpl implements UserDetailsService {


Loading…
Cancel
Save