feat(premium): allow changing the default auth servers#3082
Open
colbster937 wants to merge 4 commits into
Open
feat(premium): allow changing the default auth servers#3082colbster937 wants to merge 4 commits into
colbster937 wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds configurability to AuthMe’s premium verification by moving premium settings under a dedicated settings.premium.* section and introducing configurable endpoints for profile and session verification, enabling use of alternative authentication backends (e.g., drasl).
Changes:
- Migrate
settings.enablePremiumto the newsettings.premium.enabledkey. - Add
settings.premium.accountServerandsettings.premium.sessionServerconfiguration properties. - Update
MojangApiServiceto read premium verification endpoints from settings instead of hardcoded Mojang URLs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| authme-core/src/main/java/fr/xephi/authme/settings/SettingsMigrationService.java | Adds migration from legacy premium toggle key to the new settings.premium.enabled path. |
| authme-core/src/main/java/fr/xephi/authme/settings/properties/PremiumSettings.java | Moves premium enabled setting and introduces configurable account/session server properties. |
| authme-core/src/main/java/fr/xephi/authme/service/MojangApiService.java | Uses configured URLs for profile lookup and session verification instead of constants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+28
to
+30
| @Comment("Session server used for premium verification.") | ||
| public static final Property<String> SESSION_SERVER = | ||
| newProperty("settings.premium.sessionServer", "https://sessionserver.mojang.com"); |
Comment on lines
+76
to
+78
| String url = settings.getProperty(PremiumSettings.SESSION_SERVER) | ||
| + "?username=" + URLEncoder.encode(username, "UTF-8") | ||
| + "&serverId=" + URLEncoder.encode(serverHash, "UTF-8"); |
|
|
||
| private final ConsoleLogger logger = ConsoleLoggerFactory.get(MojangApiService.class); | ||
|
|
||
| private Settings settings; |
Comment on lines
46
to
48
| try { | ||
| HttpURLConnection conn = openGet(PROFILE_URL + username); | ||
| HttpURLConnection conn = openGet(settings.getProperty(PremiumSettings.ACCOUNT_SERVER) + username); | ||
| int code = conn.getResponseCode(); |
Comment on lines
+167
to
+173
| private static boolean migratePremiumSetting(PropertyReader reader, ConfigurationData configData) { | ||
| return moveProperty( | ||
| newProperty("settings.enablePremium", false), | ||
| PremiumSettings.ENABLE_PREMIUM, | ||
| reader, | ||
| configData | ||
| ); |
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.
this would allow you to use a custom authentication server (such as https://github.com/unmojang/drasl) to authenticate premium players.