Refactor API and schema paths, fix key usage and profile data

Renamed 'mojangapi' directories to 'api' for both routes and schemas to standardize API structure. Updated serverService to use the correct public key (profilePropertyKeys) for server metadata. Fixed sessionsService to return full skin and cape data arrays instead of just the first element.
This commit is contained in:
Gilles Lazures 2025-12-30 13:41:19 +01:00
parent 36a9a0b193
commit da8ab9d488
13 changed files with 7 additions and 7 deletions

View File

@ -164,4 +164,4 @@ app.use((err, req, res, next) => {
app.listen(process.env.WEB_PORT || 3000, () => { app.listen(process.env.WEB_PORT || 3000, () => {
logger.log(`Server listening at port : ${process.env.WEB_PORT.bold || 3000}`, ["WEB", "yellow"]) logger.log(`Server listening at port : ${process.env.WEB_PORT.bold || 3000}`, ["WEB", "yellow"])
}) })

View File

@ -4,14 +4,14 @@ const package = require("../package.json")
function getServerMetadata(hostname) { function getServerMetadata(hostname) {
const keys = certs.getKeys() const keys = certs.getKeys()
const publicKeyPEM = keys.playerCertificateKeys.public const publicKeyPEM = keys.profilePropertyKeys.public
const serverMeta = { const serverMeta = {
meta: { meta: {
serverName: process.env.SERVER_NAME || "Yggdrasil Server", serverName: process.env.SERVER_NAME || "Yggdrasil Server",
implementationName: package.name, implementationName: package.name,
implementationVersion: package.version, implementationVersion: package.version,
"feature.legacy_skin_api": utils.isTrueFromDotEnv("SUPPORT_LEGACY_SKIN_API"), "feature.legacy_skin_api": utils.isTrueFromDotEnv("SUPPORT_LEGACY_SKIN_API"),
"feature.no_mojang_namespace": utils.isTrueFromDotEnv("SUPPORT_MOJANG_FALLBACK"), "feature.no_mojang_namespace": utils.isTrueFromDotEnv("SUPPORT_MOJANG_FALLBACK"),
"feature.enable_mojang_anti_features": utils.isTrueFromDotEnv("SUPPORT_MOJANG_TELEMETRY_BLOCKER"), "feature.enable_mojang_anti_features": utils.isTrueFromDotEnv("SUPPORT_MOJANG_TELEMETRY_BLOCKER"),
@ -36,4 +36,4 @@ function getServerMetadata(hostname) {
module.exports = { module.exports = {
getServerMetadata getServerMetadata
} }

View File

@ -64,8 +64,8 @@ async function getProfile({ uuid, unsigned = false }) {
sessionRepository.getProfileActionsList(dbUser.uuid).catch(() => ({ data: [] })) sessionRepository.getProfileActionsList(dbUser.uuid).catch(() => ({ data: [] }))
]) ])
const activeSkin = skinResult.data[0] const activeSkin = skinResult.data
const activeCape = capeResult.data[0] const activeCape = capeResult.data
const profileActions = actionsResult.data || [] const profileActions = actionsResult.data || []
const isSkinBanned = profileActions.includes("USING_BANNED_SKIN") const isSkinBanned = profileActions.includes("USING_BANNED_SKIN")
@ -203,4 +203,4 @@ module.exports = {
getBlockedServers, getBlockedServers,
registerLegacySession, registerLegacySession,
validateLegacySession, validateLegacySession,
} }