Commit graph

78 commits

Author SHA1 Message Date
jesopo
eb215d61a1 'api-minify' -> 'rest-api-minify' and make it settable from !botset 2018-11-12 18:15:08 +00:00
jesopo
a0e86f79c3 Change API key checking on-request to match what the values should be in the
database (dict of '{"name": , "permissions": }')
2018-11-12 18:06:02 +00:00
jesopo
a943e69cee Change API keys to be hex representations of UUID4s, change their value in the
database to be a dictionary ({"comment": , "permissions": }) and change the
!apikey command to take a `comment` arg (to note what specific keys are intended
for) and vararg `permissions` (a list of endpoints the API key is allowed to
hit)
2018-11-12 17:59:40 +00:00
jesopo
57aa62cc9c API keys should have a value of [] when they're created, not True 2018-11-11 09:03:19 +00:00
jesopo
b8e6bfd5e5 Add a way of appending a comment on an API key, to denote what it's for. 2018-11-11 09:02:48 +00:00
jesopo
b06eff217f typo in modules/rest_api.py; 'resonse' -> 'response' 2018-11-11 08:55:49 +00:00
jesopo
9c7afe7d2b Add missing "," in modules/rest_api.py 2018-11-11 08:54:46 +00:00
jesopo
36ab270971 typo in modules/rest_api.py, 'permimssions' -> 'permissions' 2018-11-11 08:53:37 +00:00
jesopo
8024bc9c80 Add a way to minify REST API responses in modules/rest_api.py 2018-11-11 08:51:50 +00:00
jesopo
07c813cc1f Add basic access controls to modules/rest_api.py 2018-11-10 21:54:08 +00:00
jesopo
08355c026e Log errors caught when trying to execute API endpoints 2018-11-06 17:22:50 +00:00
jesopo
f06c824ae9 Only count a None response from an API event hook to be a 404 2018-11-06 14:09:13 +00:00
jesopo
bbec7f311d Pass headers through REST API callbacks 2018-11-06 13:02:04 +00:00
jesopo
819f4e0680 Pass context-wrapped timers to each module, add ModuleManager.BaseModule.on_load 2018-10-12 18:07:23 +01:00
jesopo
908edeb1e1 Typo in modules/github.py ('command' -> 'commit') and declare event_response
outside of try/except in modules/rest_api.py
2018-10-06 09:24:43 +01:00
jesopo
c3ace4be2e Return 500 when an exception is thrown, never try to .encode None 2018-10-06 09:23:50 +01:00
jesopo
ff00ec1226 Require modules/rest_api.py has tls cert/key 2018-10-05 23:16:34 +01:00
jesopo
b3f8933f3f POST shouldn't use body as 'params' 2018-10-05 23:14:32 +01:00
jesopo
95e7b9ea77 Support POST through modules/rest_api.py 2018-10-05 22:49:06 +01:00
jesopo
187220c25e Remove prints 2018-10-05 09:45:49 +01:00
jesopo
e5f475cdeb Allow API endpoints to not request authentication 2018-10-04 17:59:24 +01:00
jesopo
d7f4050ae8 Strip empty /path/arguments in modulse/rest_api.py 2018-10-04 17:37:03 +01:00
jesopo
f8170d8751 Use URL path for args, not get params 2018-10-04 17:21:40 +01:00
jesopo
7fc0359e3d Make sure bot.lock is released in do_GET 2018-10-04 17:18:24 +01:00
jesopo
a220ff8485 Timeout REST API requests after 10 seconds 2018-10-04 17:10:05 +01:00
jesopo
57b72a94c5 Implement !botset/!botget in modules/set.py 2018-10-04 17:09:52 +01:00
jesopo
a533228112 Implement api keys in modules/rest_api.py 2018-10-04 17:09:35 +01:00
jesopo
82b40cc8b2 Add basics of (by-default disabled) REST API 2018-10-04 16:01:13 +01:00