fix(premium): send authoritative premium list to proxy when disabled or empty - #3130
Open
strobil wants to merge 2 commits into
Open
fix(premium): send authoritative premium list to proxy when disabled or empty#3130strobil wants to merge 2 commits into
strobil wants to merge 2 commits into
Conversation
…or empty The proxy.started handler queried stored premium usernames without checking settings.enablePremium and skipped the send entirely when the list was empty, so the proxy kept a stale premium_names.cache and went on verifying enrolled players after the feature was disabled on the backend. Gate the DB query on enablePremium and always send the list: an empty list is authoritative and makes the proxy replace and persist an empty cache. Both proxies already handle a zero-name chunked list. Fixes AuthMe#3127
…ium is disabled ProxyLoginRequestValidator.validate() had no enablePremium gate, unlike canBypassWithPremium: a proxy-verified claim for a player whose row still carries a premiumUuid was accepted while the feature was disabled. Reject it and answer with premium.unset so the proxy drops the stale entry and persists its cache. State now converges per player on first contact, without waiting for a proxy restart to trigger the full premium.list resync. Refs AuthMe#3127
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3127.
Two things were wrong in how the premium list reaches the proxy.
BungeeReceiver'sproxy.startedhandler queried stored premium names without looking atsettings.enablePremium, and didn't send anything at all when the list was empty. So a proxy restart re-populated the cache from stalepremiumUUIDrows even with the feature disabled, andpremium_names.cachecould never be cleared. The first commit gates the query onenablePremiumand always sends the list — an empty one is authoritative, and both proxy bridges already handle a zero-name chunk by replacing and persisting their cache, so nothing had to change on that side.That alone still depends on a proxy restart (the resync only fires on
proxy.started) and on a player connection to carry the message. The second commit makes the state converge per player instead:ProxyLoginRequestValidator.validate()had noenablePremiumcheck at all, unlikecanBypassWithPremium, so a proxy-verified claim for a player whose row still had apremiumUuidwas accepted while the feature was off. It now rejects the claim and answers with the existingpremium.unset; sincevalidate()sits on both the join-time path andperformLogin, one gate covers both.Stored
premiumUUIDvalues stay in the database on purpose — ignored while disabled, back when re-enabled — as described in the issue.Three new tests, full authme-core suite is green.