IMPL BASIC AUTH INTO MOD AND BACKEND
Some checks failed
Deploy API / docker (17, 3.8.5) (push) Has been cancelled

This commit is contained in:
Lee 2024-08-07 05:19:24 +01:00
parent 05e1c7170d
commit 1ec8248c6f
22 changed files with 124 additions and 1 deletions

@ -0,0 +1,4 @@
package cc.fascinated.common;/**
* @author Fascinated (fascinated7)
*/public class IPUtils {
}

@ -0,0 +1,4 @@
package cc.fascinated.common;/**
* @author Fascinated (fascinated7)
*/public class StringUtils {
}

@ -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 {
}

@ -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 {
}

@ -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; package cc.fascinated.repository;
import cc.fascinated.model.token.ScoreSaberLeaderboardToken; import cc.fascinated.model.token.scoresaber.ScoreSaberLeaderboardToken;
import org.springframework.data.mongodb.repository.MongoRepository; 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 {
}