diff options
author | Rob Crittenden <rcritten@redhat.com> | 2015-03-02 14:47:22 -0500 |
---|---|---|
committer | Patrick Uiterwijk <puiterwijk@redhat.com> | 2015-03-03 03:44:38 +0100 |
commit | 13b359d8e4682fb239cf02293aef3a1b235a2cf6 (patch) | |
tree | 674172eaf2e029fe78b8126fd7be338b5d0cc8c0 /ipsilon/providers | |
parent | 459e2cf97db2678cd559d6660837afe40b8bea7f (diff) | |
download | ipsilon-13b359d8e4682fb239cf02293aef3a1b235a2cf6.tar.gz ipsilon-13b359d8e4682fb239cf02293aef3a1b235a2cf6.tar.xz ipsilon-13b359d8e4682fb239cf02293aef3a1b235a2cf6.zip |
Require admin when accessing REST pages
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'ipsilon/providers')
-rw-r--r-- | ipsilon/providers/common.py | 5 | ||||
-rw-r--r-- | ipsilon/providers/saml2/rest.py | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/ipsilon/providers/common.py b/ipsilon/providers/common.py index dff302d..169fddc 100644 --- a/ipsilon/providers/common.py +++ b/ipsilon/providers/common.py @@ -19,6 +19,7 @@ from ipsilon.util.log import Log from ipsilon.util.plugin import PluginInstaller, PluginLoader from ipsilon.util.plugin import PluginObject, PluginConfig from ipsilon.util.page import Page +from ipsilon.util.page import admin_protect from ipsilon.rest.common import RestPage import cherrypy @@ -163,15 +164,19 @@ class RestProviderBase(RestPage): self.plugin_name = config.name self.cfg = config + @admin_protect def GET(self, *args, **kwargs): raise cherrypy.HTTPError(501) + @admin_protect def POST(self, *args, **kwargs): raise cherrypy.HTTPError(501) + @admin_protect def DELETE(self, *args, **kwargs): raise cherrypy.HTTPError(501) + @admin_protect def PUT(self, *args, **kwargs): raise cherrypy.HTTPError(501) diff --git a/ipsilon/providers/saml2/rest.py b/ipsilon/providers/saml2/rest.py index 6ad8ae6..730b374 100644 --- a/ipsilon/providers/saml2/rest.py +++ b/ipsilon/providers/saml2/rest.py @@ -6,6 +6,7 @@ from ipsilon.providers.common import FACILITY from ipsilon.rest.common import rest_error, jsonout from ipsilon.providers.saml2.provider import ServiceProviderCreator from ipsilon.providers.saml2.provider import InvalidProviderId +from ipsilon.util.page import admin_protect from lasso import ServerAddProviderFailedError @@ -77,10 +78,12 @@ class SPS(RestProviderBase): return dict(result=results) @jsonout + @admin_protect def GET(self, *args, **kwargs): return self._get_sp(*args, **kwargs) @jsonout + @admin_protect def POST(self, *args, **kwargs): cherrypy.response.status = 201 |