From 6a69d512e4615e01b5f35e7b68af307969fc6c17 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 10 Feb 2021 12:07:00 +0100 Subject: server: Support sendat, protocol version 4 --- config.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 config.h (limited to 'config.h') diff --git a/config.h b/config.h new file mode 100644 index 0000000..d1f31a8 --- /dev/null +++ b/config.h @@ -0,0 +1,25 @@ +#pragma once + +#include + +/* Config file format + * + * Each line is a command that modifies some part of the configuration. A line + * starting with a '#' is a comment and is ignored. The available commands are + * as follows: + * - 'apikey': the line contains three space-separated fields: 'apikey', the + * key itself, and a permission bit vector (string of 0/1 characters). The + * permission bit vector has the following elements: + * 1. Whether 'sendat' is allowed. + */ + + +// Writes to stderr and exits on failure. +void config_init(const char *filename); + +// Permissions for a particular API key +struct apikey_perm { + bool sendat; +}; + +struct apikey_perm config_check_apikey(const char *apikey); -- cgit v1.2.3-70-g09d2