Extend API for managing various settings

Mads Kiilerich mads at kiilerich.com
Fri Sep 11 13:23:41 UTC 2015


On 09/11/2015 11:59 AM, Robert Rauch wrote:
> Am 09.09.2015 um 23:37 schrieb Mads Kiilerich:
>> On 09/09/2015 11:18 PM, Robert Rauch wrote:
>> There would still need to be a way to pass values when launching the 
>> command line tool. I consider command line parameters an API too ;-) 
>> Options like --user and --password options are fine when it is simple 
>> (except for quoting ambiguities), but for more complex operations we 
>> might want to be able to pass a json file or json on stdin (and 
>> definitely no password on the command line), veeery similar to how 
>> json-rpc works. I don't know if anybody have examples of how similar 
>> applications solve the same problem? 
> I know of Foreman (though it is a Rails application), which provides a
> rake target for manipulating Foremans in-database settings. You can
> have a look at its help output at http://pastebin.com/czQXj5kX
>
> As you can see, there is the possibility of specifying simple
> key/value data types as well complex (nested) hash/array types via JSON.

That could probably be fine.

But also:

Some settings should _really_ be set in same transaction, for example 
LDAP config. But I guess it could be expanded to take multiple key/value 
pairs.

it might also not be a good idea to pass important & possible secret 
values on the command line. Reasons to not do that: Command lines of 
running commands are often "public" on unix systems, and there is also 
the whole issue of escaping and security.

Finally, we might still want to do some validation of the values. A 
generic interface might not be the best for that.

/Mads


More information about the kallithea-general mailing list