Repository navigation
Add .NET 10 NativeAOT support and remove session caching - #6
Merged
Merged
Conversation
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.
Add a net10.0 target with source-generated JSON metadata and remove automatic session persistence from MojangAuth. Authentication now returns a session for the caller to manage; it no longer reads or writes mojang_auth.json. The netstandard2.0 target remains available.
Changes
API changes
JsonHttpContent now requires metadata: new JsonHttpContent(value, typeInfo), with optional encoding and media-type overloads. serialize(value, typeInfo) also requires metadata. This intentionally breaks metadata-free callers. JSON response/error/array handler factories also require JsonTypeInfo on both target frameworks.
The cache-manager constructor and parameterless TryAutoLogin(), Refresh(), Validate(), and Invalidate() are removed. Callers must pass their Session or tokens to the remaining overloads. TryAutoLogin(Session) remains available to validate and, when necessary, refresh a caller-provided session. The obsolete Xbox adapter also no longer persists sessions. GetDefaultErrorHandler() explicitly returns Task<T?>. JSON object/array handlers throw JsonException for null results/elements instead of returning null through non-nullable contracts.
Validation