aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2018-11-11 09:02:48 +0000
committerGravatar jesopo2018-11-11 09:02:48 +0000
commitb8e6bfd5e56718466ba89f1b0c02ffc1331fe99a (patch)
tree4ac14fecff85eea6c4be778c6c02dd5af0607245 /modules
parenttypo in modules/rest_api.py; 'resonse' -> 'response' (diff)
signature
Add a way of appending a comment on an API key, to denote what it's for.
Diffstat (limited to 'modules')
-rw-r--r--modules/rest_api.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/rest_api.py b/modules/rest_api.py
index 3a08cf70..02a4e124 100644
--- a/modules/rest_api.py
+++ b/modules/rest_api.py
@@ -108,9 +108,13 @@ class Module(ModuleManager.BaseModule):
def api_key(self, event):
"""
:help: Generate a new API key
+ :usage: [comment]
:permission: api-key
:prefix: APIKey
"""
api_key = str(uuid.uuid4())
+ if event["args_split"]:
+ api_key = "%s-%s" % (event["args_split"][0], api_key)
+
self.bot.set_setting("api-key-%s" % api_key, True)
event["stdout"].write(api_key)