feat: add optional time backend support with chrono and time crates#83
Open
facorazza wants to merge 1 commit into
Open
feat: add optional time backend support with chrono and time crates#83facorazza wants to merge 1 commit into
facorazza wants to merge 1 commit into
Conversation
- Updated Cargo.toml to include optional dependencies for time and chrono. - Enhanced error handling in src/error.rs to support time formatting errors from both time and chrono. - Refactored time-related functions in src/generic/claims/mod.rs to use feature flags for time and chrono. - Updated documentation in src/lib.rs to reflect new time backend options. - Implemented mutually exclusive feature checks for time and chrono in src/lib.rs. - Modified prelude error handling in src/prelude/error.rs to accommodate new time parsing errors. - Refactored PasetoBuilder in src/prelude/paseto_builder.rs to support expiration and not-before claims using both time and chrono. - Updated PasetoParser in src/prelude/paseto_parser.rs to validate expiration and not-before claims with both time and chrono. - Added unit tests in src/prelude/paseto_parser.rs to ensure correct functionality with both time and chrono.
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.
Please provide enough information so that others can review your pull request:
Explain the details for making this change. What existing problem does the pull request solve?
Allows to use chrono instead of time crate in existing projects to avoid implementation conflicts with other crates (e.g. sqlx)
Test plan (required)
Added unit tests specific to chrono
Code formatting
cargo fmt and cargo clippy
Closing issues
closes #82