Skip to content

Commit

Permalink
adds length check for opaque key
Browse files Browse the repository at this point in the history
  • Loading branch information
stgmsa committed Dec 17, 2024
1 parent fd0b0d7 commit a2c7cc6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ has_field 'pac_opaque_key' => (
type => 'Text',
apply => [
{
check => sub { $_[0] =~ /^[0-9a-fA-F]+$/ },
check => sub { $_[0] =~ /^[0-9a-fA-F]{32}$/ },
message => sub {
my ( $value, $field ) = @_;
return $field->name . " must be hexadecimal";
return $field->name . " must be 32-chars hexadecimal. e.g., openssl rand -hex 32";
},
}
]
Expand Down

0 comments on commit a2c7cc6

Please sign in to comment.