Add whitelist support for settable config variables

check_keys_in... ?

Sent from my iPad

> On Dec 18, 2014, at 8:07 PM, Andrew J. Stone <notifications@github.com> wrote:
> 
> In src/clique_config.erl:
> 
> > @@ -110,6 +113,32 @@ set(ArgsAndFlags) ->
> >              []
> >      end.
> >  
> > +%% @doc Whitelist settable cuttlefish variables. By default all variables are not settable.
> > +-spec whitelist([string()]) -> ok | {error, {invalid_config_keys, [string()]}}.
> > +whitelist(Keys) ->
> > +    case get_valid_mappings(Keys) of
> > +        {error, _}=E ->
> > +            E;
> > +        {_, _} ->
> > +            _ = [ets:insert(?whitelist_table, {Key}) || Key <- Keys],
> > +            ok
> > +    end.
> > +
> > +-spec keys_in_whitelist([string()]) -> true | {error, {config_not_settable, [string()]}}.
> I'm not sure adding all to the name makes it not seem like that. We could call it are_keys_in_whitelist, but then the case statement is weird. I'll think about it. I may change this altogether to make the second issue go away. While the erlang standard lib does stuff like this all the time, it makes me feel icky. Probably going to change the name and return ok or {error, _}
> 
> —
> Reply to this email directly or view it on GitHub.
>