From 10bc34245e8e1e3ba63fb0720d3bcfb1119db921 Mon Sep 17 00:00:00 2001 From: Simponic Date: Tue, 27 Dec 2022 23:50:22 -0700 Subject: Initial erlang stuff --- lib/chessh/schema/key.ex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/chessh/schema/key.ex') diff --git a/lib/chessh/schema/key.ex b/lib/chessh/schema/key.ex index 765c83b..adf018d 100644 --- a/lib/chessh/schema/key.ex +++ b/lib/chessh/schema/key.ex @@ -16,7 +16,7 @@ defmodule Chessh.Key do |> cast(update_encode_key(attrs, :key), [:key]) |> cast(attrs, [:name]) |> validate_required([:key, :name]) - |> validate_format(:key, ~r/[\-\w\d]+ [^ ]+$/, message: "invalid ssh key") + |> validate_format(:key, ~r/[\-\w\d]+ [^ ]+$/, message: "invalid public ssh key") |> validate_format(:key, ~r/^(?!ssh-dss).+/, message: "DSA keys are not supported") end @@ -41,7 +41,6 @@ defmodule Chessh.Key do end # Remove comment at end of key |> String.replace(~r/ [^ ]+\@[^ ]+$/, "") - # Remove potential spaces / newline |> String.trim() end end -- cgit v1.2.3-70-g09d2