Skip to content

Commit

Permalink
update ssh_key regex
Browse files Browse the repository at this point in the history
  • Loading branch information
xerbalind committed Jun 19, 2024
1 parent 840a49a commit cad46a3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/models/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,16 @@ fn validate_ssh_key_list(
) -> std::result::Result<(), ValidationError> {
lazy_static! {
static ref SSH_KEY_REGEX: Regex = Regex::new(
r"ssh-(rsa|dsa|ecdsa|ed25519) [a-zA-Z0-9+/]{1,750}={0,3}( [^ ]+)?"
r"(?x)^
(
ssh-(rsa|dss|ecdsa|ed25519)|
ecdsa-sha2-nistp(256|384|521)|
sk-(
[email protected]|
[email protected]
)
)
\s[a-zA-Z0-9+/]{1,750}={0,3}( \S+)?"
)
.unwrap();
}
Expand Down

0 comments on commit cad46a3

Please sign in to comment.