113 lines
4.6 KiB
Plaintext
113 lines
4.6 KiB
Plaintext
@startuml
|
|
|
|
package authenticationAPI <<Frame>> {
|
|
package authenticationDataAccessLayer <<Frame>> {
|
|
' interface AuthenticationDao {
|
|
' String login(String username)
|
|
' int logout(String username)
|
|
' }
|
|
|
|
' class AuthenticationDataAccessService <<@Respository>> {
|
|
' <<create>> AuthenticationDataAccessService(JpaTemplate jpaTemplate)
|
|
' String login(String username)
|
|
' int logout(String username)
|
|
' }
|
|
|
|
interface UserDetailsManager {
|
|
void createUser(UserDetails userDetails)
|
|
void changePassword(String oldPassword, String newPassword)
|
|
void deleteUser(String username)
|
|
void updateUser(UserDetails user)
|
|
boolean userExists(String username)
|
|
}
|
|
note left
|
|
Aus org.springframework.security.provisioning
|
|
- liefert Methoden zum Erstellen neuer User
|
|
und zum Aktualisieren bestehender.
|
|
end note
|
|
|
|
class JdbcUserDetailsManager <<@Repository>> {
|
|
<<create>> JdbcUserDetailsManager(DataSource dataSource)
|
|
void createUser(UserDetails user)
|
|
void changePassword(String oldPassword, String newPassword)
|
|
void deleteUser(String username)
|
|
void updateUser(UserDetails user)
|
|
boolean userExists(String username)
|
|
}
|
|
note right
|
|
User Management Service aus dem Paket
|
|
org.springframework.security.provisioning
|
|
der CRUD Operationen für User bereitstellt.
|
|
Hier sind nur die relevanten Methoden modelliert.
|
|
end note
|
|
}
|
|
|
|
package authenticationService <<Frame>> {
|
|
class AuthenticationService <<@Service>> {
|
|
--
|
|
<<create>> AuthenticationService(UserDetailsManager userDetailsManager)
|
|
List<String> verifyLogin(String username)
|
|
int logout(String username)
|
|
int forgotPassword(ForgotPasswordRequest forgotPasswordRequest)
|
|
.. via JdbcUserDetailsManager ..
|
|
int resetPassword(String username, RequestWithPassword requestWithPassword)
|
|
int registerUser(UserDetails user)
|
|
int changePassword(String username, ChangePasswordRequest changePasswordRequest)
|
|
int deleteUser(String username, RequestWithPassword requestWithPassword)
|
|
}
|
|
|
|
class JavaMailSenderImpl {}
|
|
note left
|
|
Aus org.springframework.mail.javamail.
|
|
Implementierung des JavaMailSender Interfaces,
|
|
welches das MailSender Interface durch Unterstützung
|
|
von MIME Nachrichten erweitert.
|
|
Das MailSender Interface definiert dabei eine
|
|
Strategie zum Versenden einfacher Mails.
|
|
Unterstützt sowohl JavaMail MimeMessages und
|
|
Spring SimpleMailMessages.
|
|
end note
|
|
}
|
|
|
|
package authenticationController <<Frame>> {
|
|
class AuthenticationController <<@Controller>> {
|
|
<<create>> AuthenticationController(AuthenticationService authenticationService)
|
|
ResponseEntity<List<String>> verifyLogin(String username)
|
|
ResponseEntity<Integer> logout(String username)
|
|
ResponseEntity<Integer> forgotPassword(ForgotPasswordRequest forgotPasswordRequest)
|
|
ResponseEntity<Integer> resetPassword(String username, RequestWithPassword requestWithPassword)
|
|
ResponseEntity<Integer> registerUser(UserDetails user)
|
|
ResponseEntity<Integer> changePassword(String username, ChangePasswordRequest changePasswordRequest)
|
|
ResponseEntity<Integer> deleteUser(String username, RequestWithPassword requestWithPassword)
|
|
}
|
|
|
|
class ChangePasswordRequest {
|
|
<<create>> ChangePasswordRequest(String oldPassword, String newPassword)
|
|
String getOldPassword()
|
|
String getNewPassword()
|
|
}
|
|
|
|
class ForgotPasswordRequest {
|
|
<<create>> ForgotPasswordRequest(String email)
|
|
String getEmail()
|
|
}
|
|
|
|
class RequestWithPassword {
|
|
<<create>> ResetPasswordRequest(String password)
|
|
String getPassword()
|
|
}
|
|
}
|
|
}
|
|
|
|
' User <.. AuthenticationDataAccessService: DB
|
|
' User <.. JdbcUserDetailsManager: DB
|
|
UserDetailsManager <.. AuthenticationService: <<use>>
|
|
' AuthenticationDao <.. AuthenticationService: <<use>>
|
|
AuthenticationService --o AuthenticationController
|
|
' AuthenticationDao <|. AuthenticationDataAccessService: <<realize>>
|
|
UserDetailsManager <|. JdbcUserDetailsManager: <<realize>>
|
|
JavaMailSenderImpl <. AuthenticationService: <<use>>
|
|
|
|
@enduml
|
|
|