mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-11-06 11:46:30 +08:00
Keys from the user input still needs normalization
This commit is contained in:
parent
bd86dff865
commit
232b3ac5b3
1 changed files with 11 additions and 0 deletions
|
|
@ -38,6 +38,17 @@ defmodule Livebook.FileSystem.Git do
|
|||
message: "must be a valid repo URL"
|
||||
)
|
||||
|> validate_required([:repo_url, :branch, :key, :hub_id])
|
||||
|> update_change(:key, fn key ->
|
||||
if key =~ "\n" do
|
||||
key
|
||||
else
|
||||
String.replace(
|
||||
key,
|
||||
~r/ (?!(?:OPENSSH |RSA |EC |DSA |PRIVATE )?(?:PRIVATE )?KEY-----)/,
|
||||
"\n"
|
||||
)
|
||||
end
|
||||
end)
|
||||
|> put_id()
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue