Коммит, для того что бы если что роллбекать

This commit is contained in:
Sashegdev
2026-04-22 12:23:51 +00:00
parent 6bf6c1634a
commit adde40d921
2 changed files with 32 additions and 7 deletions
+6 -6
View File
@@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>me.sashegdev</groupId> <groupId>me.sashegdev</groupId>
<artifactId>ZernMCLauncher</artifactId> <artifactId>ZernMCLauncher</artifactId>
<version>1.0.7</version> <version>1.0.8</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
@@ -76,7 +76,7 @@
<Implementation-Version>${project.version}</Implementation-Version> <Implementation-Version>${project.version}</Implementation-Version>
<Implementation-Title>ZernMC Launcher</Implementation-Title> <Implementation-Title>ZernMC Launcher</Implementation-Title>
<Implementation-Vendor>SashegDev</Implementation-Vendor> <Implementation-Vendor>SashegDev</Implementation-Vendor>
<Implementation-Description>Полностью самописный Minecraft-лаунчер. Написанный SashegDev(в основном)</Implementation-Description> <Implementation-Description>Samopisnui Minecraft-launcher. by SashegDev</Implementation-Description>
<Implementation-URL>https://github.com/SashegDev/launcher</Implementation-URL> <Implementation-URL>https://github.com/SashegDev/launcher</Implementation-URL>
</manifestEntries> </manifestEntries>
</transformer> </transformer>
@@ -99,8 +99,8 @@
<goal>launch4j</goal> <goal>launch4j</goal>
</goals> </goals>
<configuration> <configuration>
<outfile>../server/builds/ZernMCLauncher.exe</outfile> <outfile>../server/builds/ZernMCLauncher-${project.version}.exe</outfile>
<jar>../server/builds/ZernMCLauncher.jar</jar> <jar>../server/builds/ZernMCLauncher-${project.version}.jar</jar>
<headerType>console</headerType> <headerType>console</headerType>
<dontWrapJar>false</dontWrapJar> <dontWrapJar>false</dontWrapJar>
<jre> <jre>
@@ -110,13 +110,13 @@
<versionInfo> <versionInfo>
<fileVersion>${project.version}.0</fileVersion> <fileVersion>${project.version}.0</fileVersion>
<txtFileVersion>${project.version}</txtFileVersion> <txtFileVersion>${project.version}</txtFileVersion>
<fileDescription>ZernMC Launcher — самописный Minecraft лаунчер</fileDescription> <fileDescription>ZernMC Launcher — just a Minecraft launcher</fileDescription>
<productVersion>${project.version}.0</productVersion> <productVersion>${project.version}.0</productVersion>
<txtProductVersion>${project.version}</txtProductVersion> <txtProductVersion>${project.version}</txtProductVersion>
<productName>ZernMC Launcher</productName> <productName>ZernMC Launcher</productName>
<companyName>ZernMC(SashegDev)</companyName> <companyName>ZernMC(SashegDev)</companyName>
<internalName>ZernMCLauncher</internalName> <internalName>ZernMCLauncher</internalName>
<originalFilename>ZernMCLauncher.exe</originalFilename> <originalFilename>ZernMCLauncher-${project.version}.exe</originalFilename>
</versionInfo> </versionInfo>
</configuration> </configuration>
</execution> </execution>
+26 -1
View File
@@ -424,4 +424,29 @@ async def get_my_passes(credentials: HTTPAuthorizationCredentials = Depends(bear
"has_active": any(p["is_active"] for p in passes) "has_active": any(p["is_active"] for p in passes)
} }
finally: finally:
conn.close() conn.close()
@router.post("/validate")
async def validate_token(request: Request, credentials: HTTPAuthorizationCredentials = Depends(bearer)):
"""Validate token endpoint for Minecraft server"""
if not credentials:
raise HTTPException(401, "Требуется авторизация")
payload = verify_jwt(credentials.credentials)
if not payload or payload.get("type") != "access":
raise HTTPException(401, "Недействительный токен")
try:
body = await request.json()
username = body.get("username")
uuid = body.get("uuid")
# Verify that token belongs to this user
if payload.get("username") != username or payload.get("uuid") != uuid:
raise HTTPException(403, "Token does not match user")
return {"valid": True, "username": username, "uuid": uuid}
except Exception as e:
logger.error(f"Token validation error: {e}")
raise HTTPException(400, "Invalid request")