diff options
| author | J08nY | 2017-06-04 03:19:32 +0200 |
|---|---|---|
| committer | J08nY | 2017-06-04 03:19:32 +0200 |
| commit | 2c0adaf6bb8cf5d5e5246ab789d2c0018a1520f5 (patch) | |
| tree | 9f81746170edaf32302f95b565cd355ed5f8b95d /src/pgpmailman/rest/root.py | |
| parent | c06af042f8992d8d6abb02a2795b6146c6f32a0e (diff) | |
| download | mailman-pgp-2c0adaf6bb8cf5d5e5246ab789d2c0018a1520f5.tar.gz mailman-pgp-2c0adaf6bb8cf5d5e5246ab789d2c0018a1520f5.tar.zst mailman-pgp-2c0adaf6bb8cf5d5e5246ab789d2c0018a1520f5.zip | |
Diffstat (limited to 'src/pgpmailman/rest/root.py')
| -rw-r--r-- | src/pgpmailman/rest/root.py | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/pgpmailman/rest/root.py b/src/pgpmailman/rest/root.py index a0dd3fa..b937fd3 100644 --- a/src/pgpmailman/rest/root.py +++ b/src/pgpmailman/rest/root.py @@ -1,14 +1,40 @@ +""" +REST root. + + +/lists/ -> List all known encrypted lists. +/lists/<list_id>/ -> +/lists/<list_id>/key -> GET list_public_key +/lists/<list_id>/archive/key -> GET/POST list_archive_public_key + +/users/ -> List all known users of encrypted lists. +/users/<uid>/ -> +/users/<uid>/key -> GET/POST user_public_key + +""" + from mailman.rest.helpers import child +from pgpmailman.rest.lists import AllEncryptedLists, AnEncryptedList +from pgpmailman.rest.users import AUser, AllUsers from public import public @public class RESTRoot: - @child() def lists(self, context, segments): - pass + if len(segments) == 0: + return AllEncryptedLists(), [] + else: + list_name = segments.pop(0) + # WIP Check whether it's an encrypted list we know of here. + return AnEncryptedList(list_name), segments @child() def users(self, context, segments): - pass + if len(segments) == 0: + return AllUsers(), [] + else: + uid = segments.pop(0) + # WIP Check whether it's an encrypted user we know of here. + return AUser(uid), segments |
