From 2c524f288e7d7f1fab56fc522a21cf3dc0535c90 Mon Sep 17 00:00:00 2001 From: Ben Demaree Date: Fri, 9 Dec 2016 14:18:34 -0600 Subject: [PATCH] Document AppEngineInsecureAdapter --- docs/adapters.rst | 19 +++++++++++++++++++ requests_toolbelt/adapters/appengine.py | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/docs/adapters.rst b/docs/adapters.rst index 1db363b..1999571 100644 --- a/docs/adapters.rst +++ b/docs/adapters.rst @@ -53,6 +53,25 @@ ways to take advantage of this support at the moment: appengine.monkeypatch() +If you should need to disable certification validation when monkeypatching (to +force third-party libraries that use requests to not validate certificates, if +they do not provide API surface to do so, for example), you can disable it: + + .. code-block:: python + + from requests_toolbelt.adapters import appengine + appengine.monkeypatch(validate_certificate=False) + + .. warning:: + + If ``validate_certificate`` is ``False``, the monkeypatched adapter + will *not* validate certificates. This effectively sets the + ``validate_certificate`` argument to urlfetch.Fetch() to ``False``. You + should avoid using this wherever possible. Details can be found in the + `documentation for urlfetch.Fetch()`__. + + __ https://cloud.google.com/appengine/docs/python/refdocs/google.appengine.api.urlfetch + .. autoclass:: requests_toolbelt.adapters.appengine.AppEngineAdapter FingerprintAdapter diff --git a/requests_toolbelt/adapters/appengine.py b/requests_toolbelt/adapters/appengine.py index 1235784..270a47a 100644 --- a/requests_toolbelt/adapters/appengine.py +++ b/requests_toolbelt/adapters/appengine.py @@ -29,6 +29,25 @@ >>> appengine.monkeypatch() which will ensure all requests.Session objects use AppEngineAdapter properly. + +If you should need to disable certification validation when monkeypatching (to +force third-party libraries that use requests to not validate certificates, if +they do not provide API surface to do so, for example), you can disable it: + + .. code-block:: python + + >>> from requests_toolbelt.adapters import appengine + >>> appengine.monkeypatch(validate_certificate=False) + + .. warning:: + + If ``validate_certificate`` is ``False``, the monkeypatched adapter + will *not* validate certificates. This effectively sets the + ``validate_certificate`` argument to urlfetch.Fetch() to ``False``. You + should avoid using this wherever possible. Details can be found in the + `documentation for urlfetch.Fetch()`__. + + __ https://cloud.google.com/appengine/docs/python/refdocs/google.appengine.api.urlfetch """ import requests from requests import adapters