diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/config/WebSecurityConfig.java b/bookstore/src/main/java/com/fjordtek/bookstore/config/WebSecurityConfig.java index 0990611..fc51f01 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/config/WebSecurityConfig.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/config/WebSecurityConfig.java @@ -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. + *
+ * The class uses a custom UserDetailService interface class implementation + * to determine proper user authorities. + *
+ * 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
diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryCustom.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryCustom.java
index d88cae7..fa5f736 100644
--- a/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryCustom.java
+++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryCustom.java
@@ -1,9 +1,13 @@
+//Pekka Helenius
+ * Main purpose is to properly handle erroneous client requests.
+ *
+ * @author Pekka Helenius
+ */
+
@Component
public class BookStoreAccessDeniedHandler implements AccessDeniedHandler {
diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/service/session/UserDetailServiceImpl.java b/bookstore/src/main/java/com/fjordtek/bookstore/service/session/UserDetailServiceImpl.java
index 8513c3b..7213455 100644
--- a/bookstore/src/main/java/com/fjordtek/bookstore/service/session/UserDetailServiceImpl.java
+++ b/bookstore/src/main/java/com/fjordtek/bookstore/service/session/UserDetailServiceImpl.java
@@ -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 {