aboutsummaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2021-02-10 12:07:00 +0100
committerTom Smeding <tom@tomsmeding.com>2021-02-10 12:07:19 +0100
commit6a69d512e4615e01b5f35e7b68af307969fc6c17 (patch)
treee344c345f1e67f035ec8d7a58aef1c1bb1bc957b /config.h
parent0695060d4d08ffb7612e35185a95a11db648ec33 (diff)
server: Support sendat, protocol version 4
Diffstat (limited to 'config.h')
-rw-r--r--config.h25
1 files changed, 25 insertions, 0 deletions
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 <stdbool.h>
+
+/* 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);