Skip to content

Commit

Permalink
Document AppEngineInsecureAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Demaree committed Dec 9, 2016
1 parent 0798a14 commit 2c524f2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/adapters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions requests_toolbelt/adapters/appengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2c524f2

Please sign in to comment.