Skip to content

Commit 70226bd

Browse files
committed
Deploying to gh-pages from @ 793e0ad 🚀
1 parent 435ea7c commit 70226bd

18 files changed

+100
-35
lines changed

_modules/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<head>
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Overview: module code &#8212; PySNC 1.2.0 documentation</title>
7+
<title>Overview: module code &#8212; PySNC 1.2.1 documentation</title>
88
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
99
<link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=12dfc556" />
10-
<script src="../_static/documentation_options.js?v=6efca38a"></script>
10+
<script src="../_static/documentation_options.js?v=ca842793"></script>
1111
<script src="../_static/doctools.js?v=9a2dae69"></script>
1212
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
1313
<link rel="index" title="Index" href="../genindex.html" />

_modules/pysnc/attachment.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<head>
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>pysnc.attachment &#8212; PySNC 1.2.0 documentation</title>
7+
<title>pysnc.attachment &#8212; PySNC 1.2.1 documentation</title>
88
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
99
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=12dfc556" />
10-
<script src="../../_static/documentation_options.js?v=6efca38a"></script>
10+
<script src="../../_static/documentation_options.js?v=ca842793"></script>
1111
<script src="../../_static/doctools.js?v=9a2dae69"></script>
1212
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
1313
<link rel="index" title="Index" href="../../genindex.html" />

_modules/pysnc/client.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<head>
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>pysnc.client &#8212; PySNC 1.2.0 documentation</title>
7+
<title>pysnc.client &#8212; PySNC 1.2.1 documentation</title>
88
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
99
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=12dfc556" />
10-
<script src="../../_static/documentation_options.js?v=6efca38a"></script>
10+
<script src="../../_static/documentation_options.js?v=ca842793"></script>
1111
<script src="../../_static/doctools.js?v=9a2dae69"></script>
1212
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
1313
<link rel="index" title="Index" href="../../genindex.html" />
@@ -63,7 +63,7 @@ <h1>Source code for pysnc.client</h1><div class="highlight"><pre>
6363
<span class="sd"> :param bool verify: Verify the SSL/TLS certificate OR the certificate to use. Useful if you&#39;re using a self-signed HTTPS proxy.</span>
6464
<span class="sd"> :param cert: if String, path to ssl client cert file (.pem). If Tuple, (‘cert’, ‘key’) pair.</span>
6565
<span class="sd"> &quot;&quot;&quot;</span>
66-
<span class="k">def</span><span class="w"> </span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">instance</span><span class="p">,</span> <span class="n">auth</span><span class="p">,</span> <span class="n">proxy</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">verify</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">cert</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">auto_retry</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
66+
<span class="k">def</span><span class="w"> </span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">instance</span><span class="p">,</span> <span class="n">auth</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">proxy</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">verify</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">cert</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">auto_retry</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
6767
<span class="bp">self</span><span class="o">.</span><span class="n">_log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
6868
<span class="bp">self</span><span class="o">.</span><span class="n">__instance</span> <span class="o">=</span> <span class="n">get_instance</span><span class="p">(</span><span class="n">instance</span><span class="p">)</span>
6969

@@ -96,6 +96,7 @@ <h1>Source code for pysnc.client</h1><div class="highlight"><pre>
9696
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">auth</span><span class="p">,</span> <span class="n">ServiceNowFlow</span><span class="p">):</span>
9797
<span class="bp">self</span><span class="o">.</span><span class="n">__session</span> <span class="o">=</span> <span class="n">auth</span><span class="o">.</span><span class="n">authenticate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">__instance</span><span class="p">,</span> <span class="n">proxies</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">__proxies</span><span class="p">,</span> <span class="n">verify</span><span class="o">=</span><span class="n">verify</span><span class="p">)</span>
9898
<span class="k">elif</span> <span class="n">cert</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
99+
<span class="bp">self</span><span class="o">.</span><span class="n">__session</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">session</span><span class="p">()</span>
99100
<span class="bp">self</span><span class="o">.</span><span class="n">__session</span><span class="o">.</span><span class="n">cert</span> <span class="o">=</span> <span class="n">cert</span>
100101
<span class="k">else</span><span class="p">:</span>
101102
<span class="k">raise</span> <span class="n">AuthenticationException</span><span class="p">(</span><span class="s1">&#39;No valid authentication method provided&#39;</span><span class="p">)</span>

_modules/pysnc/exceptions.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<head>
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>pysnc.exceptions &#8212; PySNC 1.2.0 documentation</title>
7+
<title>pysnc.exceptions &#8212; PySNC 1.2.1 documentation</title>
88
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
99
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=12dfc556" />
10-
<script src="../../_static/documentation_options.js?v=6efca38a"></script>
10+
<script src="../../_static/documentation_options.js?v=ca842793"></script>
1111
<script src="../../_static/doctools.js?v=9a2dae69"></script>
1212
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
1313
<link rel="index" title="Index" href="../../genindex.html" />

_modules/pysnc/record.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<head>
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>pysnc.record &#8212; PySNC 1.2.0 documentation</title>
7+
<title>pysnc.record &#8212; PySNC 1.2.1 documentation</title>
88
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
99
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=12dfc556" />
10-
<script src="../../_static/documentation_options.js?v=6efca38a"></script>
10+
<script src="../../_static/documentation_options.js?v=ca842793"></script>
1111
<script src="../../_static/doctools.js?v=9a2dae69"></script>
1212
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
1313
<link rel="index" title="Index" href="../../genindex.html" />

_sources/user/authentication.rst.txt

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,41 @@ mTLS - Mutual TLS Authentication (Certificate-Based Authentication)
6868

6969
The most ideal form of authentication for machine to machine communication. Follow `KB0993615 <https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0993615>`_ then:
7070

71-
>>> client = ServiceNowClient(instance, cert=('/path/to/client.cert', '/path/to/client.key'))
71+
72+
>>> client = ServiceNowClient(instance, cert=('/path/to/USER_x509.pem', '/path/to/USERPRIVATEKEY.key'))
73+
74+
75+
A quick example, using self-signed certificates:
76+
77+
1. Setup the CA (root) key
78+
79+
.. code-block:: bash
80+
81+
# generate a root private key, if for some reason you don't have one already
82+
openssl genrsa -aes256 -out ca.key 2048
83+
# generate the CA certificate
84+
openssl req -x509 -new -nodes -key ca.key -out cert.pem -sha512 -days 365 -out cacert.pem
85+
86+
2. Upload `cacert.pem` via `/sys_ca_certificate.do`
87+
88+
3. Setup the user key and CSR (we just generate them here for a POC example)
89+
90+
.. code-block:: bash
91+
92+
openssl req -nodes -newkey rsa:2048 -keyout USERPRIVATEKEY.key -out USERCSR.csr
93+
94+
.. important::
95+
96+
Python requests (the underlying http library) does not directly support keys with passwords! See `requests#2519 <https://github.com/psf/requests/issues/2519>`_ for details.
97+
98+
4. Sign the CSR with the root, creating a X.509 for the user
99+
100+
.. code-block:: bash
101+
102+
openssl x509 -req -days 365 -in USERCSR.csr -CA cacert.pem -CAkey ca.key -extfile <(printf "extendedKeyUsage=clientAuth") -out USER_x509.pem
103+
104+
5. Attach `USER_x509.pem` to a new `/sys_user_certificate.do` record
105+
72106

73107
Requests Authentication
74108
-----------------------

_static/documentation_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const DOCUMENTATION_OPTIONS = {
2-
VERSION: '1.2.0',
2+
VERSION: '1.2.1',
33
LANGUAGE: 'en',
44
COLLAPSE_INDEX: false,
55
BUILDER: 'html',

api.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
77

8-
<title>The API &#8212; PySNC 1.2.0 documentation</title>
8+
<title>The API &#8212; PySNC 1.2.1 documentation</title>
99
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
1010
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=12dfc556" />
11-
<script src="_static/documentation_options.js?v=6efca38a"></script>
11+
<script src="_static/documentation_options.js?v=ca842793"></script>
1212
<script src="_static/doctools.js?v=9a2dae69"></script>
1313
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
1414
<link rel="index" title="Index" href="genindex.html" />
@@ -37,7 +37,7 @@
3737
<h2>The ServiceNowClient<a class="headerlink" href="#the-servicenowclient" title="Link to this heading"></a></h2>
3838
<dl class="py class">
3939
<dt class="sig sig-object py" id="pysnc.ServiceNowClient">
40-
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pysnc.</span></span><span class="sig-name descname"><span class="pre">ServiceNowClient</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">instance</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">auth</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">proxy</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verify</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cert</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">auto_retry</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pysnc/client.html#ServiceNowClient"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pysnc.ServiceNowClient" title="Link to this definition"></a></dt>
40+
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pysnc.</span></span><span class="sig-name descname"><span class="pre">ServiceNowClient</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">instance</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">auth</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">proxy</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verify</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cert</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">auto_retry</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pysnc/client.html#ServiceNowClient"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pysnc.ServiceNowClient" title="Link to this definition"></a></dt>
4141
<dd><p>ServiceNow Python Client</p>
4242
<dl class="field-list simple">
4343
<dt class="field-odd">Parameters<span class="colon">:</span></dt>

genindex.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<head>
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Index &#8212; PySNC 1.2.0 documentation</title>
7+
<title>Index &#8212; PySNC 1.2.1 documentation</title>
88
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
99
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=12dfc556" />
10-
<script src="_static/documentation_options.js?v=6efca38a"></script>
10+
<script src="_static/documentation_options.js?v=ca842793"></script>
1111
<script src="_static/doctools.js?v=9a2dae69"></script>
1212
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
1313
<link rel="index" title="Index" href="#" />

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
77

8-
<title>Welcome to PySNC’s documentation! &#8212; PySNC 1.2.0 documentation</title>
8+
<title>Welcome to PySNC’s documentation! &#8212; PySNC 1.2.1 documentation</title>
99
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
1010
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=12dfc556" />
11-
<script src="_static/documentation_options.js?v=6efca38a"></script>
11+
<script src="_static/documentation_options.js?v=ca842793"></script>
1212
<script src="_static/doctools.js?v=9a2dae69"></script>
1313
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
1414
<link rel="index" title="Index" href="genindex.html" />
@@ -33,7 +33,7 @@
3333

3434
<section id="welcome-to-pysnc-s-documentation">
3535
<h1>Welcome to PySNC’s documentation!<a class="headerlink" href="#welcome-to-pysnc-s-documentation" title="Link to this heading"></a></h1>
36-
<p>Release v1.2.0 (<a class="reference internal" href="user/install.html#install"><span class="std std-ref">Installation</span></a>)</p>
36+
<p>Release v1.2.1 (<a class="reference internal" href="user/install.html#install"><span class="std std-ref">Installation</span></a>)</p>
3737
<hr class="docutils" />
3838
<p>PySNC was created to fill the need for a familiar interface to query data from an instance from python. The interface, modeled after <a class="reference external" href="https://developer.servicenow.com/dev.do#!/reference/api/latest/client/c_GlideRecordClientSideAPI">GlideRecord</a>, provides developers who already know ServiceNow record queries an easy, quick, and consistent method to interact with platform data.</p>
3939
<p><strong>Quickstart:</strong></p>

0 commit comments

Comments
 (0)