feat: add command blocker#83
Closed
purpurcof wants to merge 1 commit into
Closed
Conversation
Owner
|
Hi, and first of all, thank you for your pull request. I would not merge this pull request in its current form, as command blocking is not a core responsibility of an identity plugin. It feels like a separate concern that should be handled through a dedicated mechanism. My suggestion would be to implement this as an add-on plugin within this repository. Alternatively, you could maintain it as a separate resource, which we can then reference or add to the documentation. |
Owner
|
Was implemented as a separate addon plugin here: |
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.
Description:
This Pull Request introduces a foundational mechanism to restrict command usage for players who have not yet completed the authentication process. A collector has been implemented to filter allowed commands and cache them to improve performance.
Key changes:
DefaultCommandDefinitionCollector: Implements command collection logic (viaCommandService). This component extracts the aliases of commands that have theallowedDuringAuthflag set to true, and automatically permits the use of the"main"system command.cachedAliases) has been implemented. AninvalidateCache()method was also added to reset the cache (e.g., during a plugin reload).CommandConfigurationmodule using Guice (asEagerSingleton).DefaultCommandDefinitionCollectorTest) using JUnit 5 and Mockito to verify the correct filtering of aliases and the overall functionality of the collector.Tested environment: