Ejemplo n.º 1
0
    def test_url_scrubbing(self):
        url = "http://foo.com/?password=password&foo=bar&secret=secret"

        scrubbed_url = urlparse.urlparse(rollbar._scrub_request_url(url))
        qs_params = urlparse.parse_qs(scrubbed_url.query)

        self.assertDictEqual(qs_params, {"password": ["--------"], "foo": ["bar"], "secret": ["------"]})
Ejemplo n.º 2
0
    def test_utf8_url_val_scrubbing(self):
        url = "http://foo.com/?password=password&foo=bar&secret=%s" % SNOWMAN

        scrubbed_url = urlparse.urlparse(rollbar._scrub_request_url(url))
        qs_params = urlparse.parse_qs(scrubbed_url.query)

        self.assertDictEqual(
            qs_params, {"password": ["--------"], "foo": ["bar"], "secret": ["".join(["-"] * len(SNOWMAN))]}
        )
Ejemplo n.º 3
0
    def test_url_scrubbing(self):
        url = 'http://foo.com/?password=password&foo=bar&secret=secret'

        scrubbed_url = urlparse.urlparse(rollbar._scrub_request_url(url))
        qs_params = urlparse.parse_qs(scrubbed_url.query)

        self.assertDictEqual(qs_params, {
            'password': ['--------'],
            'foo': ['bar'],
            'secret': ['------']
        })
    def test_utf8_url_key_scrubbing(self):
        url = 'http://foo.com/?password=password&foo=bar&%s=secret' % urllibquote(SNOWMAN)

        rollbar.SETTINGS['scrub_fields'].append(SNOWMAN)
        scrubbed_url = rollbar._scrub_request_url(url)

        qs_params = urlparse.parse_qs(urlparse.urlparse(scrubbed_url).query)

        self.assertEqual(['------'], qs_params[SNOWMAN])
        self.assertEqual(['--------'], qs_params['password'])
        self.assertEqual(['bar'], qs_params['foo'])
    def test_utf8_url_val_scrubbing(self):
        url = 'http://foo.com/?password=password&foo=bar&secret=%s' % SNOWMAN

        scrubbed_url = urlparse.urlparse(rollbar._scrub_request_url(url))
        qs_params = urlparse.parse_qs(scrubbed_url.query)

        self.assertDictEqual(qs_params, {
            'password': ['--------'],
            'foo': ['bar'],
            'secret': [''.join(['-'] * len(SNOWMAN))]
        })
    def test_url_scrubbing(self):
        url = 'http://foo.com/?password=password&foo=bar&secret=secret'

        scrubbed_url = urlparse.urlparse(rollbar._scrub_request_url(url))
        qs_params = urlparse.parse_qs(scrubbed_url.query)

        self.assertDictEqual(qs_params, {
            'password': ['--------'],
            'foo': ['bar'],
            'secret': ['------']
        })
Ejemplo n.º 7
0
    def test_utf8_url_key_scrubbing(self):
        url = "http://foo.com/?password=password&foo=bar&%s=secret" % urllibquote(SNOWMAN)

        rollbar.SETTINGS["scrub_fields"].append(SNOWMAN)
        scrubbed_url = rollbar._scrub_request_url(url)

        qs_params = urlparse.parse_qs(urlparse.urlparse(scrubbed_url).query)

        self.assertEqual(["------"], qs_params[SNOWMAN])
        self.assertEqual(["--------"], qs_params["password"])
        self.assertEqual(["bar"], qs_params["foo"])