-
Notifications
You must be signed in to change notification settings - Fork 57
Implement checking for the Patchwork user agent #1090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Qodana for .NET1108 new problems were found
View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2024.3.4
with:
upload-result: trueDetected 72 dependenciesThird-party software listThis page lists the third-party software dependencies used in ProjectLighthouse Contact Qodana teamContact us at qodana-support@jetbrains.com
|
jvyden
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some important security-focused concerns & considerations here
ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs
Outdated
Show resolved
Hide resolved
ProjectLighthouse.Servers.GameServer/Helpers/PatchworkHelper.cs
Outdated
Show resolved
Hide resolved
ProjectLighthouse.Servers.GameServer/Controllers/Login/LoginController.cs
Show resolved
Hide resolved
1ab8425 to
0c8ff50
Compare
Zaprit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
ProjectLighthouse.Servers.GameServer/Helpers/PatchworkHelper.cs
Outdated
Show resolved
Hide resolved
ProjectLighthouse/Configuration/ConfigurationCategories/AuthenticationConfiguration.cs
Outdated
Show resolved
Hide resolved
ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs
Outdated
Show resolved
Hide resolved
Slendy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just change requiredMajor and requiredMinor to be private
ProjectLighthouse.Servers.GameServer/Helpers/PatchworkHelper.cs
Outdated
Show resolved
Hide resolved
ProjectLighthouse.Servers.GameServer/Helpers/PatchworkHelper.cs
Outdated
Show resolved
Hide resolved
Zaprit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my only concern is the configuration version, 30 doesn't seem right given that it was at 27
* Implement refresh autodiscover * Make record fields required * Implement checking for the Patchwork user agent (#1090) * Implement checking for the Patchwork user agent, move logout into standalone method * Quick fixes (awesome name) * 403 user at login instead of logging out at /announce * Move configuration and revert logout changes * Rework parsing to check against GameVersion enum and game token GameVersion * Fix logic error oopsie * Fix Zaprit suggestions * Simplify patchwork game version test * Test patchwork user agent with regex instead * Fix Qodana warnings * Fix remaining Qodana warnings * Implement refresh autodiscover * Make record fields required * Update ProjectLighthouse.Servers.Website/Controllers/AutoDiscoverController.cs Co-authored-by: Josh <josh@slendy.pw> --------- Co-authored-by: FeTetra <166051662+FeTetra@users.noreply.github.com> Co-authored-by: Josh <josh@slendy.pw>
This PR adds a check for the user agent which is provided by Zaprit's PRX plugin: "patchwork". The plugin has client-side security features, and the point of this PR is to allow Lighthouse instances to enforce the usage of the plugin if they want people to connect. The user agent provides the both a major and minor version. To which I have also added the ability to require a minimum major and minor version alongside the plugin itself. This is created according to the format of the user agent which Zaprit provided me:
"PatchworkLBP1 {PATCHWORK_VERSION_MAJOR}.{PATCHWORK_VERSION_MINOR}".i havent tested it yet :p