-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #488 from royllo/461-user-asset-data-management
461 user asset data management
- Loading branch information
Showing
76 changed files
with
1,611 additions
and
71 deletions.
There are no files selected for viewing
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
54 changes: 54 additions & 0 deletions
54
...re/autoconfigure/src/main/java/org/royllo/explorer/core/domain/user/UserLnurlAuthKey.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,54 @@ | ||
package org.royllo.explorer.core.domain.user; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.Table; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
import static jakarta.persistence.FetchType.EAGER; | ||
import static jakarta.persistence.GenerationType.IDENTITY; | ||
import static lombok.AccessLevel.PACKAGE; | ||
|
||
/** | ||
* Public key generated by the user's Lightning wallet. | ||
* This key is unique to each user and service combination, ensuring that the user's identity is consistent with each service but not across different services. | ||
*/ | ||
@Getter | ||
@Setter | ||
@ToString | ||
@RequiredArgsConstructor | ||
@AllArgsConstructor(access = PACKAGE) | ||
@Builder | ||
@Entity | ||
@Table(name = "APPLICATION_USER_LNURL_AUTH_LINKING_KEY") | ||
public class UserLnurlAuthKey { | ||
|
||
/** Unique identifier. */ | ||
@Id | ||
@Column(name = "ID") | ||
@GeneratedValue(strategy = IDENTITY) | ||
private Long id; | ||
|
||
/** User. */ | ||
@ManyToOne(fetch = EAGER) | ||
@JoinColumn(name = "FK_USER_OWNER", nullable = false) | ||
private User owner; | ||
|
||
/** Linking key. */ | ||
@Column(name = "LINKING_KEY", nullable = false) | ||
private String linkingKey; | ||
|
||
/** K1: Randomly generated token that served as a challenge. */ | ||
@Column(name = "K1", nullable = false) | ||
private String k1; | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
...plorer-core/autoconfigure/src/main/java/org/royllo/explorer/core/domain/util/K1Value.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,35 @@ | ||
package org.royllo.explorer.core.domain.util; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
import org.royllo.explorer.core.util.base.BaseDomain; | ||
|
||
import static lombok.AccessLevel.PACKAGE; | ||
|
||
/** | ||
* K1 Value created by the system. | ||
*/ | ||
@Getter | ||
@Setter | ||
@ToString | ||
@RequiredArgsConstructor | ||
@AllArgsConstructor(access = PACKAGE) | ||
@Builder | ||
@Entity | ||
@Table(name = "UTIL_K1_CACHE") | ||
public class K1Value extends BaseDomain { | ||
|
||
/** K1 (Unique identifier). */ | ||
@Id | ||
@Column(name = "K1") | ||
private String k1; | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...r-core/autoconfigure/src/main/java/org/royllo/explorer/core/domain/util/package-info.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,4 @@ | ||
/** | ||
* Utility domain objects. | ||
*/ | ||
package org.royllo.explorer.core.domain.util; |
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
31 changes: 31 additions & 0 deletions
31
...re/src/main/java/org/royllo/explorer/core/repository/user/UserLnurlAuthKeyRepository.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,31 @@ | ||
package org.royllo.explorer.core.repository.user; | ||
|
||
import org.royllo.explorer.core.domain.user.UserLnurlAuthKey; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.Optional; | ||
|
||
/** | ||
* {@link UserLnurlAuthKey} repository. | ||
*/ | ||
@Repository | ||
public interface UserLnurlAuthKeyRepository extends JpaRepository<UserLnurlAuthKey, Long> { | ||
|
||
/** | ||
* Find a user lnurl-auth by the linking key. | ||
* | ||
* @param linkingKey linking key | ||
* @return user lnurl-auth key | ||
*/ | ||
Optional<UserLnurlAuthKey> findByLinkingKey(String linkingKey); | ||
|
||
/** | ||
* Find a user lnurl-auth by the k1. | ||
* | ||
* @param k1 k1 | ||
* @return user lnurl-auth key | ||
*/ | ||
Optional<UserLnurlAuthKey> findByK1(String k1); | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...toconfigure/src/main/java/org/royllo/explorer/core/repository/util/K1ValueRepository.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,24 @@ | ||
package org.royllo.explorer.core.repository.util; | ||
|
||
import org.royllo.explorer.core.domain.util.K1Value; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.time.ZonedDateTime; | ||
import java.util.List; | ||
|
||
/** | ||
* {@link K1Value} repository. | ||
*/ | ||
@Repository | ||
public interface K1ValueRepository extends JpaRepository<K1Value, String> { | ||
|
||
/** | ||
* Find all K1 values created before a given date. | ||
* | ||
* @param createdOn the date | ||
* @return the list of K1 values | ||
*/ | ||
List<K1Value> findByCreatedOnBefore(ZonedDateTime createdOn); | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...re/autoconfigure/src/main/java/org/royllo/explorer/core/repository/util/package-info.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,4 @@ | ||
/** | ||
* util repository package. | ||
*/ | ||
package org.royllo.explorer.core.repository.util; |
Oops, something went wrong.