aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/rest/root.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman_pgp/rest/root.py')
-rw-r--r--src/mailman_pgp/rest/root.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/mailman_pgp/rest/root.py b/src/mailman_pgp/rest/root.py
index 52ebfbe..2edad2e 100644
--- a/src/mailman_pgp/rest/root.py
+++ b/src/mailman_pgp/rest/root.py
@@ -15,19 +15,13 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
-"""
-REST root.
+"""REST root."""
-
-/lists/ -> List all known encrypted lists.
-/lists/<list_id>/ ->
-/lists/<list_id>/key -> GET list_public_key
-"""
-
-from mailman.rest.helpers import child
+from mailman.rest.helpers import child, NotFound
from public import public
from mailman_pgp.rest.addresses import AllAddresses, AnAddress
+from mailman_pgp.rest.config import AConfig
from mailman_pgp.rest.lists import AllPGPLists, APGPList
@@ -48,3 +42,17 @@ class RESTRoot:
else:
email = segments.pop(0)
return AnAddress(email), segments
+
+ @child()
+ def config(self, context, segments):
+ if len(segments) == 0:
+ return AConfig(), []
+ elif len(segments) == 1:
+ section = segments.pop(0)
+ return AConfig(section), []
+ elif len(segments) == 2:
+ section = segments.pop(0)
+ attribute = segments.pop(0)
+ return AConfig(section, attribute), []
+ else:
+ return NotFound(), []