We should validate clearing as well.

This commit is contained in:
Simon MacMullen 2012-04-05 12:32:15 +01:00
parent e4d98cf086
commit 3c92c6e72e
1 changed files with 16 additions and 1 deletions

View File

@ -19,7 +19,7 @@
-include_lib("rabbit_common/include/rabbit.hrl").
-export([validate/3, notify/3, notify_clear/2]).
-export([validate/3, validate_clear/2, notify/3, notify_clear/2]).
-export([register/0]).
-rabbit_boot_step({?MODULE,
@ -51,6 +51,21 @@ validate(<<"federation">>, <<"local_username">>, Term) ->
validate(_AppName, Key, _Term) ->
{error, "key not recognised: ~p", [Key]}.
validate_clear(<<"federation_upstream_set">>, _Key) ->
ok;
validate_clear(<<"federation_connection">>, _Key) ->
ok;
validate_clear(<<"federation">>, <<"local_nodename">>) ->
ok;
validate_clear(<<"federation">>, <<"local_username">>) ->
ok;
validate_clear(_AppName, Key) ->
{error, "key not recognised: ~p", [Key]}.
notify(<<"federation_upstream_set">>, Key, _Term) ->
rabbit_federation_link_sup_sup:adjust({upstream_set, Key});