Links
Tags
Creators
Details
2.1-1.21.x-NeoForge
Compatibility
Changes
CWhitelist Changelog
v2.1 - 2026-01-17
๐ง New Features
API Token Authentication System
- Complete Token Authentication Support: Added secure token authentication mechanism for API servers
- Dual Authentication Methods:
- Header Authentication: Authenticate via
Authorization: Bearer <token>header (Recommended) - Query Parameter Authentication: Authenticate via
?token=<token>query parameter
- Header Authentication: Authenticate via
- Permission Validation: Automatically verify token read/write/delete/management permissions
- Token Expiration Detection: Real-time token validity checks with automatic handling of expired tokens
Enhanced Permission Management
- Granular Permission Control:
can_read: Read permission for synchronizing whitelistcan_write: Write permission for adding entries and logging eventscan_delete: Delete permission for removing entriescan_manage: Management permission for system administration
- Smart Permission Verification: Automatically validates required permissions based on operation type
- Clear Permission Feedback: Detailed permission error messages
Token Status Management
- Token Verification Command: Added
/cwhitelist api verifycommand to validate token effectiveness - Status Information Display: Detailed token information shown in
/cwhitelist api status - Automatic Verification: Tokens are automatically verified on server startup
โ๏ธ Configuration Updates
New Configuration Options
[api]
# Basic Authentication Configuration
token = "your-api-token-here" # API authentication token
useHeaderAuth = true # Authentication method (true:header/false:query parameter)
# Optional Configuration
serverId = "" # Server identifier (optional)
sendServerId = false # Whether to include server ID in requests
includeExpired = false # Whether to include expired entries
Configuration Change Notes
- Backward Compatible: Existing configurations require no changes, new options have reasonable defaults
- Security Recommendation: Strongly recommend using Header authentication for better security
๐ฎ Command Extensions
New API Management Commands
| Command | Description | Permission |
|---|---|---|
/cwhitelist api verify |
Verify API token validity | OP (2) |
/cwhitelist api status |
Display detailed API and token status | OP (2) |
Enhanced Commands
/cwhitelist api health: Added network error handling and timeout control/cwhitelist api sync: Enhanced permission validation, only tokens with read permission allowed- All API-related operations: Now require valid token authentication
๐ Security Improvements
Authentication Security
- Secure Token Storage: Tokens stored only in configuration files, not hardcoded
- Secure Communication: Two authentication methods to meet different security needs
- Permission Isolation: Operation scope limited based on token permissions
Error Handling
- Authentication Failure Handling: Automatic fallback to local mode ensuring service availability
- Clear Error Messages: Detailed permission and authentication failure notifications
- Logging: Records all authentication attempts and permission checks
๐ Performance Optimizations
Smart Caching
- Token Verification Cache: Reduces duplicate token validation requests
- Permission Caching: Caches token permission information for faster verification
- Intelligent Refresh: Automatically re-validates tokens upon expiration
Network Optimization
- Connection Reuse: HTTP client connection reuse reduces connection establishment overhead
- Timeout Control: Configurable timeout settings prevent long blocks
- Queue Management: Optimized request queues to avoid concurrency issues
๐ Change Summary
Core Changes
- API Client Refactor: Rewrote
ApiClientclass to support token authentication - Token Information Model: Added
TokenInfoclass to manage token data and permissions - Authentication Header Management: Simplified to single token configuration, replacing complex header lists
Configuration Simplification
- Removed:
API_AUTH_HEADERSconfiguration option - Added:
API_TOKENsingle token configuration - Optimized: More intuitive authentication method selection
User Experience
- Status Display: More detailed token and permission information
- Error Notifications: More user-friendly permission denial messages
- Operation Feedback: Real-time authentication status feedback
๐ Known Issues
- None - This version is a feature enhancement release with no bug fixes
Update Recommendation: Strongly recommended for all server administrators requiring API integration, providing a more secure and flexible authentication mechanism.
Technical Support: For upgrade issues, please refer to documentation or seek assistance through GitHub Issues.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:A2fb1XGO:WFrNvgXH"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:A2fb1XGO:WFrNvgXH"
}

