forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge torrust#988: Overhaul tracker keys: option to disable auth key …
…expiration d7dfc3b feat: [torrust#978] add semantic validation for configuration (Jose Celano) e8e935c feat: [torrust#978] add a config option to disable cheking keys' expiration (Jose Celano) Pull request description: When the tracker is running in private mode you can disable checking keys' expiration in the configuration with: ```toml [core] private = false [core.private_mode] check_keys_expiration = false ``` All keys will be valid as long as they exist in the database. ACKs for top commit: josecelano: ACK d7dfc3b Tree-SHA512: 0605a43f2c9962efece92327261c2cc7448a35e8961260b14164162408288d87e7055ba1764778ba94d1849f575fe7110328d95830f8a5fa8ea062d186a52066
- Loading branch information
Showing
7 changed files
with
122 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//! Trait to validate semantic errors. | ||
//! | ||
//! Errors could involve more than one configuration option. Some configuration | ||
//! combinations can be incompatible. | ||
use thiserror::Error; | ||
|
||
/// Errors that can occur validating the configuration. | ||
#[derive(Error, Debug)] | ||
pub enum SemanticValidationError { | ||
#[error("Private mode section in configuration can only be included when the tracker is running in private mode.")] | ||
UselessPrivateModeSection, | ||
} | ||
|
||
pub trait Validator { | ||
/// # Errors | ||
/// | ||
/// Will return an error if the configuration is invalid. | ||
fn validate(&self) -> Result<(), SemanticValidationError>; | ||
} |
This file contains 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
This file contains 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
This file contains 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