-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding tracking of logins for use in telemetry reporting
- Loading branch information
Showing
8 changed files
with
163 additions
and
3 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
.../src/main/java/edu/internet2/tier/shibboleth/admin/ui/security/model/UserLoginRecord.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.security.model; | ||
|
|
||
| import lombok.Data; | ||
|
|
||
| import javax.persistence.Entity; | ||
| import javax.persistence.GeneratedValue; | ||
| import javax.persistence.Id; | ||
| import javax.persistence.Table; | ||
| import javax.persistence.UniqueConstraint; | ||
| import java.util.Date; | ||
|
|
||
| @Data | ||
| @Entity | ||
| @Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "username", "login" }) }) | ||
| public class UserLoginRecord { | ||
| @Id | ||
| @GeneratedValue | ||
| private Long id; | ||
|
|
||
| private String username; | ||
|
|
||
| private String login; | ||
|
|
||
| private Date loginDate; | ||
|
|
||
| public UserLoginRecord() { | ||
| } | ||
|
|
||
| public UserLoginRecord(String username, Date loginDate, String formattedDate) { | ||
| this.username = username; | ||
| this.login = formattedDate; | ||
| this.loginDate = loginDate; | ||
| } | ||
| } |
10 changes: 10 additions & 0 deletions
10
...edu/internet2/tier/shibboleth/admin/ui/security/repository/UserLoginRecordRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.security.repository; | ||
|
|
||
| import edu.internet2.tier.shibboleth.admin.ui.security.model.UserLoginRecord; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| public interface UserLoginRecordRepository extends JpaRepository<UserLoginRecord, Long> { | ||
| Optional<UserLoginRecord> findByUsernameAndLogin(String username, String formattedDate); | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters