1.0.0-alpha3.05
Pre-release
Pre-release
·
284 commits
to master
since this release
This patch introduces a lot of breaking changes, major improvements, and fixes in the areas of:
- Middlewares
- User, Roles, Permissions Command Authentication
- Commands
🍶 Changes
- Introduced support for shared fields which can be used to store data in commands that are shared towards middleware and afterwares, especially handy for middleware or afterware that requires data in the command itself such as cooldown middleware and so forth. You can view examples of this in action with the new command authentication middleware and also the examples.
- Pre-built authentication functionality has been removed in favor of the new new command authentication middleware which allows users to create their own authentication middleware to override the default behavior.
- Uncaught exceptions that are thrown during middleware or afterwares execution is now printed to console.
- Added
NexusInterceptorRepository
to replacestatic
method addition of middleware and afterwares. - Added unit tests for command generation to ensure that all the commands are generated properly after a new change.
📦 Migrating to alpha-3.0.5
The breaking change of alpha-3.0.5
lies in the removal of the half-baked, built-in authentication methods which are improved upon and made non-mandatory like the ratelimiters. If you are using these authentication methods then all you have to do is make the fields shared using the @Share
annotation then add the middleware: NexusCommonInterceptors.NEXUS_AUTH_<TYPE>_MIDDLEWARE
with <TYPE>
being what authentication method you were using. An example would be:
Before
private final List<Long> requiredUsers = List.of(...);
After
@Share private final List<Long> requiredUsers = List.of(...)
private final List<String> middleware = List.of(NexusCommonInterceptors.NEXUS_AUTH_PERMISSIONS_MIDDLEWARE, ...);