mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 12:06:56 +08:00
enhance(router): change MAX_ID_LENGTH to 64 (#792)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
// ID generation
|
||||
pub(crate) const ID_LENGTH: usize = 20;
|
||||
pub(crate) const MAX_ID_LENGTH: usize = 24;
|
||||
pub(crate) const MAX_ID_LENGTH: usize = 64;
|
||||
#[rustfmt::skip]
|
||||
pub(crate) const ALPHABETS: [char; 62] = [
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||
|
||||
@ -126,7 +126,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn validate_id_length_constraint() {
|
||||
let payment_id = "abcdefghijlkmnopqrstuvwzyzabcdefghijknlmnop".to_string(); //length = 43
|
||||
let payment_id =
|
||||
"abcdefghijlkmnopqrstuvwzyzabcdefghijknlmnopsjkdnfjsknfkjsdnfspoig".to_string(); //length = 65
|
||||
|
||||
let result = validate_id(payment_id, "payment_id");
|
||||
assert!(result.is_err());
|
||||
@ -134,7 +135,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn validate_id_proper_response() {
|
||||
let payment_id = "abcdefghijlkmnopqrst".to_string();
|
||||
let payment_id = "abcdefghijlkmnopqrstjhbjhjhkhbhgcxdfxvmhb".to_string();
|
||||
|
||||
let result = validate_id(payment_id.clone(), "payment_id");
|
||||
assert!(result.is_ok());
|
||||
|
||||
Reference in New Issue
Block a user