From 5095819894863ffc258cbd9a9a13a54dd8a54332 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Sat, 13 Jan 2018 10:57:19 +0000
Subject: [PATCH] Describe sharding-related attributes in config

---
 README.md           | 5 ++++-
 dovecot/keyproxy.go | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 48b090ed..27201a0e 100644
--- a/README.md
+++ b/README.md
@@ -103,8 +103,11 @@ default from */etc/keystore/dovecot.yml*:
 * `ldap`: LDAP backend configuration, see above
 * `keystore`: configures the connection to the keystore service
   * `url`: URL for the keystore service
+  * `sharded`: if true, requests to the keystore service will be
+    partitioned according to the user's *shard* attribute
   * `tls_config`: client TLS configuration
     * `cert`: path to the client certificate
     * `key`: path to the private key
     * `ca`: path to the CA used to validate the server
-
+* `shard`: shard identifier for the local host. Must be set if
+  keystore.sharded is true.
diff --git a/dovecot/keyproxy.go b/dovecot/keyproxy.go
index 9be2a103..bd896401 100644
--- a/dovecot/keyproxy.go
+++ b/dovecot/keyproxy.go
@@ -28,6 +28,9 @@ type Database interface {
 }
 
 func (c *Config) check() error {
+	if c.Keystore == nil {
+		return errors.New("missing keystore config")
+	}
 	if c.LDAPConfig == nil {
 		return errors.New("missing backend config")
 	}
-- 
GitLab