Releases: cev-api/Token-Protector
Releases · cev-api/Token-Protector
Token Protector v1.0.2
v1.0.2
Bootstrap hardening
- MainMixin -
stashAndPassThroughrenamed tostashAndPoisonUserArg. Now returns a fake token as the constructor argument. Any mod hookingUser.<init>HEAD sees the fake, not the real JWT. - UserMixin - uses
TokenStash.realAccessTokenas source of truth forTokenVault.store()and field poisoning.TokenStashsync now requires the caller to actually hold the real token (accessToken.equals(realAccessToken)). Getter whitelist check tightened viaisWhitelistedModAccess.
Authlib rewrite (AuthlibMinecraftClientMixin)
- Removed the HEAD/RETURN swap pattern (
swapToReal/swapToFake) and all spin-race detection counters. - Now uses
@Redirecton everysetRequestProperty("Authorization", ...)call inprepareRequest,get,postInternal. - Injects the real JWT directly into the
Bearerheader value at request time. TheaccessTokenfield stays fake at rest permanently.
New mixins
- YggdrasilAuthenticationServiceMixin -
@ModifyArgoncreateUserApiServiceandcreateFriendsService. Replaces tokens passed to authlib service constructors with fakes. Real auth goes through the header@Redirectpath instead. - ClientHandshakePacketListenerImplMixin -
@RedirectsUser.getProfileId()andUser.getAccessToken()inauthenticateServer. Pulls real values fromTokenVault.getStored()directly, keeping multiplayer join working without public getters returning real data.
Compatibility & 26.2 Support
- New: MinecraftCompat - reflective
getToastManager()for 26.2 (moved onto theguiobject). Used everywhere acrossAlertManagerandTokenProtectorMod. - TokenVault - new
getStored(User)method for direct value retrieval.
OS leak scan improvements
shouldFlagEnvironmentVariable(): suppresses path/version/JVM-flag false positives before flagging.looksLikeJwt(): requires 3 segments with 8+ chars each (no longer false-positives on26.1.2).looksLikeOpenAiKey(): detectssk-prefix.looksLikeCredentialValue(),looksLikePathValue(),looksLikeVersionValue(): new false-positive filters.looksLikeSensitiveKey(): expanded (API_KEY,OPENAI,SECRET,SESSION,JWT,OAUTH).
Build
- MC 26.1.2 to 26.2, deps bumped (loom 1.17.12, fabric 0.152.2, loader 0.19.3, modmenu 20.0.0).
- Output JARs use
artifactLabel(mc1.21.11/mc26.x). cleandeletes all version build dirs.- ConfigScreen:
setScreentosetScreenAndShowfor 26.2 API.