Skip to content

Commit 1e1fd7e

Browse files
committed
feat(auth): connect premium sessions to shared launch pipeline and restrict raw logs
1 parent 1bb0ad2 commit 1e1fd7e

6 files changed

Lines changed: 48 additions & 5 deletions

File tree

‎docs/ROADMAP.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ Goal: add official premium authentication without changing the fundamental Minec
292292

293293
## Token lifecycle
294294

295-
- [ ] Before enabling premium sessions, review and redact sensitive strings in Minecraft process stdout/stderr logs; v0.1 currently redirects raw game output to private per-session files.
295+
- [ ] 🚧 IN PROGRESS — premium LaunchPlan now flags credential-bearing sessions and default process starter discards stdout/stderr rather than persisting raw tokens. Game-owned logs and crash reports still require security review.
296296

297297
- [ ] Refresh expired/expiring sessions automatically when possible.
298298
- [ ] Store long-lived secrets/tokens using an appropriate secure OS mechanism.
@@ -303,7 +303,7 @@ Goal: add official premium authentication without changing the fundamental Minec
303303
## Launch integration
304304

305305
- [ ] Convert authenticated account/session to existing launch account/session inputs.
306-
- [ ] Supply valid access token/profile information to Minecraft launch arguments.
306+
- [ ] 🚧 IN PROGRESS — coordinator accepts normalized premium LaunchAuthentication and uses standard metadata placeholder replacement; desktop selection and live verification pending.
307307
- [ ] Avoid a duplicate premium-specific launch pipeline.
308308

309309
## v0.3 UI

‎docs/WORKLOG.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,39 @@ Every code/build/documentation/CI task must add an entry according to `AGENTS.md
88

99
---
1010

11+
## 2026-10-19 — Share launch pipeline with credential-bearing sessions
12+
13+
**Milestone:** v0.3
14+
**Author/Agent:** ChatGPT GPT-6
15+
**Status:** Partial — desktop sign-in and Minecraft live testing remain
16+
17+
### Completed
18+
- Extended the existing MinecraftLaunchCoordinator to accept a normalized premium LaunchAuthentication payload.
19+
- Marked premium LaunchPlan as credential-sensitive while keeping the offline plan unchanged.
20+
- Prevented raw stdout/stderr files for premium child processes in the default ProcessBuilder starter, avoiding accidental token leakage from redirected output.
21+
22+
### Changed files
23+
- launcher-core/src/main/kotlin/pl/syntaxdevteam/syntaxlauncher/core/launch/LaunchPlan.kt
24+
- launcher-core/src/main/kotlin/pl/syntaxdevteam/syntaxlauncher/core/launch/LaunchPlanBuilder.kt
25+
- launcher-core/src/main/kotlin/pl/syntaxdevteam/syntaxlauncher/core/launch/MinecraftLaunchCoordinator.kt
26+
- launcher-core/src/main/kotlin/pl/syntaxdevteam/syntaxlauncher/core/launch/MinecraftProcessManager.kt
27+
- docs/ROADMAP.md and docs/WORKLOG.md
28+
29+
### Verification
30+
- ./gradlew test — NOT RUN locally; GitHub CI pending.
31+
- ./gradlew build — NOT RUN locally; GitHub CI pending.
32+
- Real Minecraft authenticated client — NOT RUN.
33+
34+
### Roadmap updates
35+
- [ ] v0.3 premium process log review is partial; game-owned logs still pending.
36+
- [ ] v0.3 launch wiring prepared; account UI/session management pending.
37+
38+
### Follow-ups / known issues
39+
- Raw game-managed local logs and crash reports can still contain tokens and must never be uploaded without sanitization.
40+
- A correctly approved Microsoft application registration is required.
41+
42+
---
43+
1144
## 2026-10-19 — Xbox/XSTS/Minecraft provider exchanges
1245

1346
**Milestone:** v0.3

‎launcher-core/src/main/kotlin/pl/syntaxdevteam/syntaxlauncher/core/launch/LaunchPlan.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ data class LaunchPlan(
99
val mainClass: String,
1010
val jvmArguments: List<String>,
1111
val gameArguments: List<String>,
12+
/** Avoid persisting raw child stdout/stderr when session credentials are present. */
13+
val sensitiveOutput: Boolean = false,
1214
) {
1315
val command: List<String>
1416
get() = buildList {

‎launcher-core/src/main/kotlin/pl/syntaxdevteam/syntaxlauncher/core/launch/LaunchPlanBuilder.kt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class LaunchPlanBuilder(
8989
mainClass = version.mainClass,
9090
jvmArguments = jvmArguments,
9191
gameArguments = gameArguments,
92+
sensitiveOutput = request.authentication.userType == "msa",
9293
)
9394
}
9495

‎launcher-core/src/main/kotlin/pl/syntaxdevteam/syntaxlauncher/core/launch/MinecraftLaunchCoordinator.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class MinecraftLaunchCoordinator(
5858
account: Account,
5959
options: LaunchOptions,
6060
instanceLayout: MinecraftInstallationLayout = layout,
61+
authentication: LaunchAuthentication = LaunchAuthentication.offline(account),
6162
): LaunchPipelineStatus {
6263
if (!launchMutex.tryLock()) return mutableStatus.value
6364
try {
@@ -104,6 +105,7 @@ class MinecraftLaunchCoordinator(
104105
runtime = runtime,
105106
platform = platform,
106107
options = options,
108+
authentication = authentication,
107109
),
108110
)
109111
stage(LaunchPhase.STARTING_GAME, "Starting Minecraft")

‎launcher-core/src/main/kotlin/pl/syntaxdevteam/syntaxlauncher/core/launch/MinecraftProcessManager.kt‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,20 @@ fun interface MinecraftProcessStarter {
6969
* Owns at most one Minecraft process at a time. Does not depend on Compose.
7070
* OS-level stdout/stderr file redirection is intentional: DETACH works even if
7171
* the launcher JVM exits. These files contain raw game output and are private
72-
* on POSIX systems; a future premium flow must review possible token emission.
72+
* on POSIX systems. For premium sessions, the default process starter discards
73+
* raw stdout/stderr instead of persisting potentially credential-bearing output.
74+
* This does not control game-owned files such as logs/latest.log; those still
75+
* require independent review and should never be uploaded automatically.
7376
*/
7477
class MinecraftProcessManager(
7578
private val logsDirectory: Path,
7679
private val starter: MinecraftProcessStarter = MinecraftProcessStarter { plan, stdout, stderr ->
7780
ProcessBuilder(plan.command)
7881
.directory(plan.workingDirectory.toFile())
79-
.redirectOutput(ProcessBuilder.Redirect.to(stdout.toFile()))
80-
.redirectError(ProcessBuilder.Redirect.to(stderr.toFile()))
82+
.redirectOutput(if (plan.sensitiveOutput) ProcessBuilder.Redirect.DISCARD
83+
else ProcessBuilder.Redirect.to(stdout.toFile()))
84+
.redirectError(if (plan.sensitiveOutput) ProcessBuilder.Redirect.DISCARD
85+
else ProcessBuilder.Redirect.to(stderr.toFile()))
8186
.start()
8287
},
8388
) {

0 commit comments

Comments
 (0)