[O] Don't expose all fields

pull/22/head
Azalea 2024-03-06 00:35:44 -05:00
parent 94c1974d2f
commit 2a10471e0b
3 changed files with 12 additions and 3 deletions

View File

@ -76,6 +76,16 @@ class AquaNetUser(
var keychipSessions: MutableList<KeychipSession> = mutableListOf(),
) : Serializable {
val computedName get() = displayName.ifEmpty { username }
val publicFields get() = mapOf(
"username" to username,
"displayName" to displayName,
"country" to country,
"regTime" to regTime,
"profileLocation" to profileLocation,
"profileBio" to profileBio,
"profilePicture" to profilePicture,
)
}
@Repository("AquaNetUserRepository")

View File

@ -2,7 +2,6 @@ package icu.samnyan.aqua.net.games
import ext.API
import ext.RP
import icu.samnyan.aqua.net.db.AquaNetUser
import icu.samnyan.aqua.net.utils.IGenericGamePlaylog
data class TrendOut(val date: String, val rating: Int, val plays: Int)
@ -13,7 +12,7 @@ data class GenericGameSummary(
val name: String,
val iconId: Int,
val aquaUser: AquaNetUser?,
val aquaUser: Map<String, Any?>?,
val serverRank: Long,
val accuracy: Double,

View File

@ -105,7 +105,7 @@ fun genericUserSummary(
return GenericGameSummary(
name = user.userName,
iconId = user.iconId,
aquaUser = card.aquaUser,
aquaUser = card.aquaUser?.publicFields,
serverRank = userDataRepo.getRanking(user.playerRating),
accuracy = plays.acc(),
rating = user.playerRating,