Skip to content

Commit

Permalink
Revert "Warn when fetching outdated registry record (#49)"
Browse files Browse the repository at this point in the history
This reverts commit 59046f1.
  • Loading branch information
ericmj committed Dec 29, 2018
1 parent 59046f1 commit 7d6d9d6
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/hex_registry.erl
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ decode_names(Payload, Repository) ->
case hex_pb_names:decode_msg(Payload, 'Names') of
#{repository := Repository, packages := Packages} ->
{ok, Packages};
% gpb (proto2) decodes missing required fields as $undef
% this will likely change when we update to proto3 and use optional fields
#{repository := '$undef', packages := Packages} ->
warn_outdated_registry(),
{ok, Packages};
_ ->
{error, unverified}
end.
Expand All @@ -52,11 +47,6 @@ decode_versions(Payload, Repository) ->
case hex_pb_versions:decode_msg(Payload, 'Versions') of
#{repository := Repository, packages := Packages} ->
{ok, Packages};
% gpb (proto2) decodes missing required fields as $undef
% this will likely change when we update to proto3 and use optional fields
#{repository := '$undef', packages := Packages} ->
warn_outdated_registry(),
{ok, Packages};
_ ->
{error, unverified}
end.
Expand All @@ -72,11 +62,6 @@ decode_package(Payload, Repository, Package) ->
case hex_pb_package:decode_msg(Payload, 'Package') of
#{repository := Repository, name := Package, releases := Releases} ->
{ok, Releases};
% gpb (proto2) decodes missing required fields as $undef
% this will likely change when we update to proto3 and use optional fields
#{repository := '$undef', name := '$undef', releases := Releases} ->
warn_outdated_registry(),
{ok, Releases};
_ ->
{error, unverified}
end.
Expand Down Expand Up @@ -132,10 +117,3 @@ key(Binary) when is_binary(Binary) ->
[Entry | _] -> {ok, public_key:pem_entry_decode(Entry)};
_ -> {error, bad_key}
end.

warn_outdated_registry() ->
io:format(
"Fetched deprecatated registry record version, for security reasons this " ++
"registry version will not work on future Hex updates. The repository " ++
"you are using should update to ensure future compatability with Hex clients."
).

0 comments on commit 7d6d9d6

Please sign in to comment.