Skip to content

Commit

Permalink
interface: allow hyphens in interface_name
Browse files Browse the repository at this point in the history
interface name can contain hyphens everywhere but at the beginning

Fix astarte-platform#7

Signed-off-by: Mattia Mazzucato <mattia.mazzucato@ispirata.com>
  • Loading branch information
matt-mazzucato committed Jan 15, 2020
1 parent 2fe8832 commit 0e3c436
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/astarte_core/interface.ex
Expand Up @@ -94,7 +94,7 @@ defmodule Astarte.Core.Interface do
end

def interface_name_regex do
~r/^[a-zA-Z]+(\.[a-zA-Z0-9]+)*$/
~r/^[a-zA-Z]{2,}[a-zA-Z0-9]*(\.[a-zA-Z0-9]+[-a-zA-Z0-9]*)*[a-zA-Z]+[a-zA-Z0-9]*$/
end

defp handle_legacy_ownership(changeset) do
Expand Down

0 comments on commit 0e3c436

Please sign in to comment.