Example #1
0
    def __init__(self, request):
        Proxy.__init__(self, request)

        self.mapserver_settings = request.registry.settings.get("mapserverproxy", {})
        if "default_ogc_server" in self.mapserver_settings:
            self.default_ogc_server = self.get_ogcserver_byname(
                self.mapserver_settings["default_ogc_server"]
            )

        if "external_ogc_server" in self.mapserver_settings:
            self.external_ogc_server = self.get_ogcserver_byname(
                self.mapserver_settings["external_ogc_server"]
            )

        # params hold the parameters we"re going to send to backend
        self.params = dict(self.request.params)

        # reset possible value of role_id and user_id
        if "role_id" in self.params:  # pragma: no cover
            del self.params["role_id"]
        if "user_id" in self.params:  # pragma: no cover
            del self.params["user_id"]

        self.lower_params = self._get_lower_params(self.params)
        self.ogc_server = self.get_ogcserver_byname(self.params["ogcserver"]) \
            if "ogcserver" in self.params else None
        self.external = bool(self.request.params.get("EXTERNAL"))
Example #2
0
    def __init__(self,
                 request: pyramid.request.Request,
                 has_default_ogc_server: bool = False):
        Proxy.__init__(self, request)

        # params hold the parameters we"re going to send to backend
        self.params = dict(self.request.params)

        # reset possible value of role_id and user_id
        if "role_id" in self.params:
            del self.params["role_id"]
        if "user_id" in self.params:
            del self.params["user_id"]

        self.lower_params = self._get_lower_params(self.params)

        # We need original case for OGCSERVER parameter value
        self.lower_key_params = {k.lower(): v for k, v in self.params.items()}

        if "ogcserver" in request.matchdict:
            self.ogc_server = self._get_ogcserver_byname(
                request.matchdict["ogcserver"])
        elif "ogcserver" in self.lower_key_params:
            self.ogc_server = self._get_ogcserver_byname(
                self.lower_key_params["ogcserver"])
        elif not has_default_ogc_server:
            raise HTTPBadRequest(
                "The querystring argument 'ogcserver' is required")
Example #3
0
    def __init__(self, request):
        Proxy.__init__(self, request)

        self.mapserver_settings = request.registry.settings.get("mapserverproxy", {})
        if "default_ogc_server" in self.mapserver_settings:
            self.default_ogc_server = self.get_ogcserver_byname(
                self.mapserver_settings["default_ogc_server"]
            )

        if "external_ogc_server" in self.mapserver_settings:
            self.external_ogc_server = self.get_ogcserver_byname(
                self.mapserver_settings["external_ogc_server"]
            )

        # params hold the parameters we"re going to send to backend
        self.params = dict(self.request.params)

        # reset possible value of role_id and user_id
        if "role_id" in self.params:  # pragma: no cover
            del self.params["role_id"]
        if "user_id" in self.params:  # pragma: no cover
            del self.params["user_id"]

        self.lower_params = self._get_lower_params(self.params)
        self.ogc_server = self.get_ogcserver_byname(self.params["ogcserver"]) \
            if "ogcserver" in self.params else None
        self.external = bool(self.request.params.get("EXTERNAL"))
Example #4
0
    def __init__(self, request, has_default_ogc_server=False):
        Proxy.__init__(self, request)

        # params hold the parameters we"re going to send to backend
        self.params = dict(self.request.params)

        # reset possible value of role_id and user_id
        if "role_id" in self.params:  # pragma: no cover
            del self.params["role_id"]
        if "user_id" in self.params:  # pragma: no cover
            del self.params["user_id"]

        self.lower_params = self._get_lower_params(self.params)
        if not has_default_ogc_server and "ogcserver" not in self.params:
            raise HTTPBadRequest(
                "The querytring argument 'ogcserver' is required")
        self.ogc_server = self._get_ogcserver_byname(self.params["ogcserver"])
Example #5
0
 def __init__(self, request: pyramid.request.Request):
     Proxy.__init__(self, request)
     self.config = self.request.registry.settings
Example #6
0
 def __init__(self, request):  # pragma: no cover
     Proxy.__init__(self, request)
     self.request = request
     self.settings = request.registry.settings.get("resourceproxy", {})
Example #7
0
 def __init__(self, request: pyramid.request.Request):
     Proxy.__init__(self, request)
     self.request = request
     self.settings = request.registry.settings.get("resourceproxy", {})
Example #8
0
 def __init__(self, request: pyramid.request.Request):
     Proxy.__init__(self, request)