summaryrefslogtreecommitdiff
path: root/lib/chessh/schema/key.ex
diff options
context:
space:
mode:
authorSimponic <loganhunt@simponic.xyz>2022-12-27 23:50:22 -0700
committerSimponic <loganhunt@simponic.xyz>2022-12-27 23:50:22 -0700
commit10bc34245e8e1e3ba63fb0720d3bcfb1119db921 (patch)
tree0158f37dcda36f36327e45c4ce7543e77c26c8a0 /lib/chessh/schema/key.ex
parentf7c2ccbe26dc808e4a7eae9a378e6c382220961a (diff)
downloadchessh-10bc34245e8e1e3ba63fb0720d3bcfb1119db921.tar.gz
chessh-10bc34245e8e1e3ba63fb0720d3bcfb1119db921.zip
Initial erlang stuff
Diffstat (limited to 'lib/chessh/schema/key.ex')
-rw-r--r--lib/chessh/schema/key.ex3
1 files changed, 1 insertions, 2 deletions
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