Skip to content
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

Add option to disable authentication keys #816

Open
wants to merge 1 commit into
base: dev/3.0.0
Choose a base branch
from

Conversation

roccodev
Copy link
Contributor

@roccodev roccodev commented Aug 3, 2022

As mentioned in #804 (which this PR is also a workaround for), Velocity's aim is to support as many setups as possible.

With the 1.19.1 update, it is no longer possible to cancel or edit the order of incoming messages, while still keeping support for signed chat and player reporting.
However, Velocity currently lacks the option to forgo message signing (e.g., to freely cancel and transform everything into a system message) for 1.19.1 clients and servers.

This PR migrates the old force-key-authentication option into a three-variant enum (key-authentication-policy), with the default being the exact same behavior before this change. Additionally, if force-key-authentication was manually turned off, this falls back to the enabled state.

Disabling authentication keys is something the user must do manually via a config change, and it is discouraged in the option's comment.

Comment on lines +22 to +24
# - "disabled": Secure profiles are not checked, all chat messages will appear unsigned to backend
# servers. This option is not recommended as it may break compatibility with 1.19.1
# servers, and it will cause newer clients to show a warning upon login.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this option allow cancelling signed chat messages on 1.19.1+? I tested this branch on a local server, but it still kicks me when sending any message on 1.19.1. This means that I can't convert everything to a system message (through a global chat plugin for example)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What error are you getting? It should work if you set it to disabled.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same error as before where it says canceling chat messages isn't supported on 1.19.1+, and it kicks the player. Maybe this if statement needs to be modified

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When key auth is disabled, player.getIdentifiedKey() is null. I can cancel messages just fine, maybe you need to use DISABLED? (in caps)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works completely fine on my end. When disabled, messages can be blocked. Otherwise, the killswitch gets triggered as the Velocity devs intended.

Copy link
Member

@Xernium Xernium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I agree with the motive of this PR this will need to be implemented differently to work around all kinds of unwanted scenarios introduced with #817
Please understand that I cant pull this outright, but I will take inspiration while I work on this and I will pull parts of this to be in the final version of #817

@roccodev
Copy link
Contributor Author

Sounds good!

@Strahilchu
Copy link

It should be encouraged and the default setting for sure!

@gamingcodedev
Copy link

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants