IMPL BASIC AUTH INTO MOD AND BACKEND
Some checks failed
Deploy API / docker (17, 3.8.5) (push) Has been cancelled
Some checks failed
Deploy API / docker (17, 3.8.5) (push) Has been cancelled
This commit is contained in:
parent
05e1c7170d
commit
1ec8248c6f
4
API/src/main/java/cc/fascinated/common/IPUtils.java
Normal file
4
API/src/main/java/cc/fascinated/common/IPUtils.java
Normal file
@ -0,0 +1,4 @@
|
||||
package cc.fascinated.common;/**
|
||||
* @author Fascinated (fascinated7)
|
||||
*/public class IPUtils {
|
||||
}
|
4
API/src/main/java/cc/fascinated/common/StringUtils.java
Normal file
4
API/src/main/java/cc/fascinated/common/StringUtils.java
Normal file
@ -0,0 +1,4 @@
|
||||
package cc.fascinated.common;/**
|
||||
* @author Fascinated (fascinated7)
|
||||
*/public class StringUtils {
|
||||
}
|
4
API/src/main/java/cc/fascinated/config/RedisConfig.java
Normal file
4
API/src/main/java/cc/fascinated/config/RedisConfig.java
Normal file
@ -0,0 +1,4 @@
|
||||
package cc.fascinated.config;/**
|
||||
* @author Fascinated (fascinated7)
|
||||
*/public class RedisConfig {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package cc.fascinated.controller;/**
|
||||
* @author Fascinated (fascinated7)
|
||||
*/public class AuthenticationController {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package cc.fascinated.log;/**
|
||||
* @author Fascinated (fascinated7)
|
||||
*/public class TransactionLogger {
|
||||
}
|
36
API/src/main/java/cc/fascinated/model/auth/AuthToken.java
Normal file
36
API/src/main/java/cc/fascinated/model/auth/AuthToken.java
Normal file
@ -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)
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package cc.fascinated.model.auth;/**
|
||||
* @author Fascinated (fascinated7)
|
||||
*/public class LoginRequest {
|
||||
}
|
55
API/src/main/java/cc/fascinated/model/token/steam/SteamAuthenticateUserTicketToken.java
Normal file
55
API/src/main/java/cc/fascinated/model/token/steam/SteamAuthenticateUserTicketToken.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
@ -0,0 +1,4 @@
|
||||
package cc.fascinated.repository.mongo.redis;/**
|
||||
* @author Fascinated (fascinated7)
|
||||
*/public class AuthTokenRepository {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package cc.fascinated.services;/**
|
||||
* @author Fascinated (fascinated7)
|
||||
*/public class SteamService {
|
||||
}
|
Reference in New Issue
Block a user