From e2eaceae4ea524779a8c476a4575230e27e326c0 Mon Sep 17 00:00:00 2001 From: Nickolas Fotopoulos Date: Sat, 19 Aug 2023 22:07:13 -0700 Subject: [PATCH] Correct front page example and clean up SSL text. The fourth argument to NetworkInsightClient() is verify_cert, not timeout. In the example, pass timeout as a kwarg instead of positional. --- README.rst | 2 +- doc/source/api.rst | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 80fea8d..76d5139 100644 --- a/README.rst +++ b/README.rst @@ -48,7 +48,7 @@ to a client class. For example: timeout = 5 netinsight_client = diagnostics.NetworkInsightClient( - api_key, api_secret, opnsense_url, timeout) + api_key, api_secret, opnsense_url, timeout=timeout) print(netinsight_client.get_interfaces()) diff --git a/doc/source/api.rst b/doc/source/api.rst index 3aa459e..72317ef 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -2,7 +2,7 @@ API Reference ============= This document attempts to document the API provided by the pyopnsense library. -It is a combination of autogenerated api documentation and usage explanations. +It is a combination of autogenerated API documentation and usage explanations. Instantiating Clients --------------------- @@ -21,18 +21,18 @@ SSL Certificate Verification '''''''''''''''''''''''''''' By default the SSL certificate verification is disabled. This is to enable a -working client out of the box. (since by default OPNsense is it's own CA, so -it likely won't be in your system's CA bundle) The tradeoff here is obviously +working client out of the box, since by default OPNsense is its own CA, so +it likely won't be in your system's CA bundle. The tradeoff here is obviously security. It's **strongly** recommended that you enable SSL verification once you start using the client for anything beyond basic testing. To do this the -``verify`` kwarg is used. This value gets passed directly to `requests`_ verify -kwarg on the HTTP methods. You can set this to either ``True`` which will -enable it and use your default system installed CA bundles, or the path to a CA -certificate or bundle directory. More details can be found in the requests -documentation here: -http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification +``verify_cert`` kwarg is used. This value gets passed directly to `requests`_ +``verify`` kwarg on the HTTP methods. You can set this to either ``True`` which +will enable it and use your default system installed CA bundles, or the path to +a CA certificate or bundle directory. More details can be found in the `requests +documentation`_. .. _requests: http://docs.python-requests.org/en/master/ +.. _requests documentation: http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification Client Classes ==============