diff --git a/API/src/main/java/cc/fascinated/common/IPUtils.java b/API/src/main/java/cc/fascinated/common/IPUtils.java new file mode 100644 index 0000000..002f2e7 --- /dev/null +++ b/API/src/main/java/cc/fascinated/common/IPUtils.java @@ -0,0 +1,4 @@ +package cc.fascinated.common;/** + * @author Fascinated (fascinated7) + */public class IPUtils { +} diff --git a/API/src/main/java/cc/fascinated/common/StringUtils.java b/API/src/main/java/cc/fascinated/common/StringUtils.java new file mode 100644 index 0000000..81cf42d --- /dev/null +++ b/API/src/main/java/cc/fascinated/common/StringUtils.java @@ -0,0 +1,4 @@ +package cc.fascinated.common;/** + * @author Fascinated (fascinated7) + */public class StringUtils { +} diff --git a/API/src/main/java/cc/fascinated/config/RedisConfig.java b/API/src/main/java/cc/fascinated/config/RedisConfig.java new file mode 100644 index 0000000..6ee52fa --- /dev/null +++ b/API/src/main/java/cc/fascinated/config/RedisConfig.java @@ -0,0 +1,4 @@ +package cc.fascinated.config;/** + * @author Fascinated (fascinated7) + */public class RedisConfig { +} diff --git a/API/src/main/java/cc/fascinated/controller/AuthenticationController.java b/API/src/main/java/cc/fascinated/controller/AuthenticationController.java new file mode 100644 index 0000000..529ea55 --- /dev/null +++ b/API/src/main/java/cc/fascinated/controller/AuthenticationController.java @@ -0,0 +1,4 @@ +package cc.fascinated.controller;/** + * @author Fascinated (fascinated7) + */public class AuthenticationController { +} diff --git a/API/src/main/java/cc/fascinated/log/TransactionLogger.java b/API/src/main/java/cc/fascinated/log/TransactionLogger.java new file mode 100644 index 0000000..45eb949 --- /dev/null +++ b/API/src/main/java/cc/fascinated/log/TransactionLogger.java @@ -0,0 +1,4 @@ +package cc.fascinated.log;/** + * @author Fascinated (fascinated7) + */public class TransactionLogger { +} diff --git a/API/src/main/java/cc/fascinated/model/auth/AuthToken.java b/API/src/main/java/cc/fascinated/model/auth/AuthToken.java new file mode 100644 index 0000000..350b303 --- /dev/null +++ b/API/src/main/java/cc/fascinated/model/auth/AuthToken.java @@ -0,0 +1,36 @@ +package cc.fascinated.model.auth; + +import cc.fascinated.common.StringUtils; +import cc.fascinated.model.token.steam.SteamAuthenticateUserTicketToken; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author Fascinated (fascinated7) + */ +@AllArgsConstructor +@Getter +public class SteamAuthToken { + /** + * The steam id of the user. + */ + private final String steamId; + + /** + * The auth token of the user. + */ + private final String authToken; + + /** + * Gets the SteamProfile from an auth token. + * + * @param token The auth token. + * @return The SteamProfile. + */ + public static SteamAuthToken getFromAuthToken(SteamAuthenticateUserTicketToken token) { + return new SteamAuthToken( + token.getResponse().getParams().getSteamId(), + StringUtils.randomString(32) + ); + } +} diff --git a/API/src/main/java/cc/fascinated/model/auth/LoginRequest.java b/API/src/main/java/cc/fascinated/model/auth/LoginRequest.java new file mode 100644 index 0000000..c933ecd --- /dev/null +++ b/API/src/main/java/cc/fascinated/model/auth/LoginRequest.java @@ -0,0 +1,4 @@ +package cc.fascinated.model.auth;/** + * @author Fascinated (fascinated7) + */public class LoginRequest { +} diff --git a/API/src/main/java/cc/fascinated/model/token/ScoreSaberAccountToken.java b/API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberAccountToken.java similarity index 100% rename from API/src/main/java/cc/fascinated/model/token/ScoreSaberAccountToken.java rename to API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberAccountToken.java diff --git a/API/src/main/java/cc/fascinated/model/token/ScoreSaberLeaderboardPageToken.java b/API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberLeaderboardPageToken.java similarity index 100% rename from API/src/main/java/cc/fascinated/model/token/ScoreSaberLeaderboardPageToken.java rename to API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberLeaderboardPageToken.java diff --git a/API/src/main/java/cc/fascinated/model/token/ScoreSaberLeaderboardToken.java b/API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberLeaderboardToken.java similarity index 100% rename from API/src/main/java/cc/fascinated/model/token/ScoreSaberLeaderboardToken.java rename to API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberLeaderboardToken.java diff --git a/API/src/main/java/cc/fascinated/model/token/ScoreSaberPageMetadataToken.java b/API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberPageMetadataToken.java similarity index 100% rename from API/src/main/java/cc/fascinated/model/token/ScoreSaberPageMetadataToken.java rename to API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberPageMetadataToken.java diff --git a/API/src/main/java/cc/fascinated/model/token/ScoreSaberPlayerScoreToken.java b/API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberPlayerScoreToken.java similarity index 100% rename from API/src/main/java/cc/fascinated/model/token/ScoreSaberPlayerScoreToken.java rename to API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberPlayerScoreToken.java diff --git a/API/src/main/java/cc/fascinated/model/token/ScoreSaberScoreToken.java b/API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberScoreToken.java similarity index 100% rename from API/src/main/java/cc/fascinated/model/token/ScoreSaberScoreToken.java rename to API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberScoreToken.java diff --git a/API/src/main/java/cc/fascinated/model/token/ScoreSaberScoresPageToken.java b/API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberScoresPageToken.java similarity index 100% rename from API/src/main/java/cc/fascinated/model/token/ScoreSaberScoresPageToken.java rename to API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberScoresPageToken.java diff --git a/API/src/main/java/cc/fascinated/model/token/ScoreSaberWebsocketDataToken.java b/API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberWebsocketDataToken.java similarity index 100% rename from API/src/main/java/cc/fascinated/model/token/ScoreSaberWebsocketDataToken.java rename to API/src/main/java/cc/fascinated/model/token/scoresaber/ScoreSaberWebsocketDataToken.java diff --git a/API/src/main/java/cc/fascinated/model/token/steam/SteamAuthenticateUserTicketToken.java b/API/src/main/java/cc/fascinated/model/token/steam/SteamAuthenticateUserTicketToken.java new file mode 100644 index 0000000..a48817b --- /dev/null +++ b/API/src/main/java/cc/fascinated/model/token/steam/SteamAuthenticateUserTicketToken.java @@ -0,0 +1,55 @@ +package cc.fascinated.model.token.steam.token; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; + +/** + * @author Fascinated (fascinated7) + */ +@Getter +public class SteamAuthenticateUserTicketToken { + /** + * The response from the Steam API. + */ + private Response response; + + @Getter + public static class Response { + /** + * The params of the response. + */ + private Params params; + + @Getter + public static class Params { + /** + * The result of the request. + */ + private String result; + + /** + * The steam id of the user. + */ + @JsonProperty("steamid") + private String steamId; + + /** + * The owner steam id of the user. + */ + @JsonProperty("ownersteamid") + private String ownerSteamId; + + /** + * The vac banned status of the user. + */ + @JsonProperty("vacbanned") + private boolean vacBanned; + + /** + * The publisher banned status of the user. + */ + @JsonProperty("publisherbanned") + private boolean publisherBanned; + } + } +} diff --git a/API/src/main/java/cc/fascinated/repository/CounterRepository.java b/API/src/main/java/cc/fascinated/repository/mongo/CounterRepository.java similarity index 100% rename from API/src/main/java/cc/fascinated/repository/CounterRepository.java rename to API/src/main/java/cc/fascinated/repository/mongo/CounterRepository.java diff --git a/API/src/main/java/cc/fascinated/repository/ScoreRepository.java b/API/src/main/java/cc/fascinated/repository/mongo/ScoreRepository.java similarity index 100% rename from API/src/main/java/cc/fascinated/repository/ScoreRepository.java rename to API/src/main/java/cc/fascinated/repository/mongo/ScoreRepository.java diff --git a/API/src/main/java/cc/fascinated/repository/ScoreSaberLeaderboardRepository.java b/API/src/main/java/cc/fascinated/repository/mongo/ScoreSaberLeaderboardRepository.java similarity index 78% rename from API/src/main/java/cc/fascinated/repository/ScoreSaberLeaderboardRepository.java rename to API/src/main/java/cc/fascinated/repository/mongo/ScoreSaberLeaderboardRepository.java index 22ad72f..bbe20ba 100644 --- a/API/src/main/java/cc/fascinated/repository/ScoreSaberLeaderboardRepository.java +++ b/API/src/main/java/cc/fascinated/repository/mongo/ScoreSaberLeaderboardRepository.java @@ -1,6 +1,6 @@ package cc.fascinated.repository; -import cc.fascinated.model.token.ScoreSaberLeaderboardToken; +import cc.fascinated.model.token.scoresaber.ScoreSaberLeaderboardToken; import org.springframework.data.mongodb.repository.MongoRepository; /** diff --git a/API/src/main/java/cc/fascinated/repository/UserRepository.java b/API/src/main/java/cc/fascinated/repository/mongo/UserRepository.java similarity index 100% rename from API/src/main/java/cc/fascinated/repository/UserRepository.java rename to API/src/main/java/cc/fascinated/repository/mongo/UserRepository.java diff --git a/API/src/main/java/cc/fascinated/repository/redis/AuthTokenRepository.java b/API/src/main/java/cc/fascinated/repository/redis/AuthTokenRepository.java new file mode 100644 index 0000000..868f3f9 --- /dev/null +++ b/API/src/main/java/cc/fascinated/repository/redis/AuthTokenRepository.java @@ -0,0 +1,4 @@ +package cc.fascinated.repository.mongo.redis;/** + * @author Fascinated (fascinated7) + */public class AuthTokenRepository { +} diff --git a/API/src/main/java/cc/fascinated/services/SteamService.java b/API/src/main/java/cc/fascinated/services/SteamService.java new file mode 100644 index 0000000..2dc2dd4 --- /dev/null +++ b/API/src/main/java/cc/fascinated/services/SteamService.java @@ -0,0 +1,4 @@ +package cc.fascinated.services;/** + * @author Fascinated (fascinated7) + */public class SteamService { +}