summary refs log tree commit diff
path: root/synapse/config/registration.py
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <daniel@matrix.org>2015-08-18 14:22:02 +0100
committerDaniel Wagner-Hall <daniel@matrix.org>2015-08-18 14:22:02 +0100
commit2d3462714e48dca46dd54b17ca29188a17261e28 (patch)
tree8de2fa7cb4529fc1eb4ae6360bbdb2368632f5ad /synapse/config/registration.py
parentMerge password checking implementations (diff)
downloadsynapse-2d3462714e48dca46dd54b17ca29188a17261e28.tar.xz
Issue macaroons as opaque auth tokens
This just replaces random bytes with macaroons. The macaroons are not
inspected by the client or server.

In particular, they claim to have an expiry time, but nothing verifies
that they have not expired.

Follow-up commits will actually enforce the expiration, and allow for
token refresh.

See https://bit.ly/matrix-auth for more information
Diffstat (limited to 'synapse/config/registration.py')
-rw-r--r--synapse/config/registration.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/config/registration.py b/synapse/config/registration.py
index 67e780864e..62de4b399f 100644
--- a/synapse/config/registration.py
+++ b/synapse/config/registration.py
@@ -32,9 +32,11 @@ class RegistrationConfig(Config):
             )
 
         self.registration_shared_secret = config.get("registration_shared_secret")
+        self.macaroon_secret_key = config.get("macaroon_secret_key")
 
     def default_config(self, config_dir, server_name):
         registration_shared_secret = random_string_with_symbols(50)
+        macaroon_secret_key = random_string_with_symbols(50)
         return """\
         ## Registration ##
 
@@ -44,6 +46,8 @@ class RegistrationConfig(Config):
         # If set, allows registration by anyone who also has the shared
         # secret, even if registration is otherwise disabled.
         registration_shared_secret: "%(registration_shared_secret)s"
+
+        macaroon_secret_key: "%(macaroon_secret_key)s"
         """ % locals()
 
     def add_arguments(self, parser):