Skip to content

Commit

Permalink
Make authorize user agent a default parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
davedoesdev committed Apr 8, 2020
1 parent 12d8cae commit 608c288
Show file tree
Hide file tree
Showing 16 changed files with 965 additions and 950 deletions.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 45c4022a74dc9ae2cb259de81da05a66
config: 8cbf1452cdc9c6a80750398ce0645d7c
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion docs/_build/html/_static/documentation_options.js
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '7.6.0',
VERSION: '7.7.0',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/genindex.html
Expand Up @@ -7,7 +7,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index &#8212; python-dxf 7.6.0 documentation</title>
<title>Index &#8212; python-dxf 7.7.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
Expand All @@ -27,7 +27,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">python-dxf 7.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">python-dxf 7.7.0 documentation</a> &#187;</li>
</ul>
</div>

Expand Down Expand Up @@ -226,7 +226,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">python-dxf 7.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">python-dxf 7.7.0 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
Expand Down
9 changes: 5 additions & 4 deletions docs/_build/html/index.html
Expand Up @@ -6,7 +6,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>dxf module &#8212; python-dxf 7.6.0 documentation</title>
<title>dxf module &#8212; python-dxf 7.7.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
Expand All @@ -26,7 +26,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="#">python-dxf 7.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="#">python-dxf 7.7.0 documentation</a> &#187;</li>
</ul>
</div>

Expand Down Expand Up @@ -418,7 +418,7 @@ <h1>dxf module<a class="headerlink" href="#dxf-module" title="Permalink to this
</table>
<dl class="method">
<dt id="dxf.DXFBase.authenticate">
<code class="descname">authenticate</code><span class="sig-paren">(</span><em>username=None</em>, <em>password=None</em>, <em>actions=None</em>, <em>response=None</em>, <em>authorization=None</em><span class="sig-paren">)</span><a class="headerlink" href="#dxf.DXFBase.authenticate" title="Permalink to this definition"></a></dt>
<code class="descname">authenticate</code><span class="sig-paren">(</span><em>username=None</em>, <em>password=None</em>, <em>actions=None</em>, <em>response=None</em>, <em>authorization=None</em>, <em>user_agent='Docker-Client/19.03.2 (linux)'</em><span class="sig-paren">)</span><a class="headerlink" href="#dxf.DXFBase.authenticate" title="Permalink to this definition"></a></dt>
<dd><p>Authenticate to the registry using a username and password,
an authorization header or otherwise as the anonymous user.</p>
<table class="docutils field-list" frame="void" rules="none">
Expand All @@ -431,6 +431,7 @@ <h1>dxf module<a class="headerlink" href="#dxf-module" title="Permalink to this
<li><strong>actions</strong> (<em>list</em>) – If you know which types of operation you need to make on the registry, specify them here. Valid actions are <code class="docutils literal notranslate"><span class="pre">pull</span></code>, <code class="docutils literal notranslate"><span class="pre">push</span></code> and <code class="docutils literal notranslate"><span class="pre">*</span></code>.</li>
<li><strong>response</strong> (<em>requests.Response</em>) – When the <code class="docutils literal notranslate"><span class="pre">auth</span></code> function you passed to <a class="reference internal" href="#dxf.DXFBase" title="dxf.DXFBase"><code class="xref py py-class docutils literal notranslate"><span class="pre">DXFBase</span></code></a>’s constructor is called, it is passed a HTTP response object. Pass it back to <a class="reference internal" href="#dxf.DXFBase.authenticate" title="dxf.DXFBase.authenticate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">authenticate()</span></code></a> to have it automatically detect which actions are required.</li>
<li><strong>authorization</strong> (<em>str</em>) – <code class="docutils literal notranslate"><span class="pre">Authorization</span></code> header value.</li>
<li><strong>user_agent</strong> (<em>str</em>) – <code class="docutils literal notranslate"><span class="pre">User-Agent</span></code> header value.</li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -720,7 +721,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="#">python-dxf 7.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="#">python-dxf 7.7.0 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/objects.inv
@@ -1,6 +1,6 @@
# Sphinx inventory version 2
# Project: python-dxf
# Version: 7.6
# Version: 7.7
# The remainder of this file is compressed using zlib.
xڥ�Mo�0 ����k���[֮@Pt��͠%��/�rg��O��4�FuN6��})R���1?]'�� SVฑ��Oem���Wb�67�o3�5��)xBl���)g.�?�����ڵ�'�������{�g��i�S�돒a�z�XK��[�7`E���TUR��9�J����~ Y�G*J���ӫ}���%ڨ8D�t.E ��*�{@�a�1�vH���q��c�(��WA��K��S'�!�\�.G�\��p3���"��K<���{���x��!=� ��vPTo!��v�wAEi�o���Z��)���Mj���{)���8z����6w�^���p�9y���S��ډj' ���byٺ��3l�4���h�FQ\�VF��[��:sl�W��p<C'D
��ܮ��C?�_6��L~�&��忊�V�C��=��X ��
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/py-modindex.html
Expand Up @@ -6,7 +6,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Python Module Index &#8212; python-dxf 7.6.0 documentation</title>
<title>Python Module Index &#8212; python-dxf 7.7.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
Expand All @@ -29,7 +29,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="#" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">python-dxf 7.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">python-dxf 7.7.0 documentation</a> &#187;</li>
</ul>
</div>

Expand Down Expand Up @@ -93,7 +93,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="#" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">python-dxf 7.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">python-dxf 7.7.0 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/search.html
Expand Up @@ -6,7 +6,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search &#8212; python-dxf 7.6.0 documentation</title>
<title>Search &#8212; python-dxf 7.7.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />

Expand Down Expand Up @@ -35,7 +35,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">python-dxf 7.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">python-dxf 7.7.0 documentation</a> &#187;</li>
</ul>
</div>

Expand Down Expand Up @@ -86,7 +86,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">python-dxf 7.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">python-dxf 7.7.0 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/conf.py
Expand Up @@ -58,9 +58,9 @@
# built documents.
#
# The short X.Y version.
version = '7.6'
version = '7.7'
# The full version, including alpha/beta/rc tags.
release = '7.6.0'
release = '7.7.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
8 changes: 6 additions & 2 deletions dxf/__init__.py
Expand Up @@ -229,7 +229,8 @@ def make_kwargs():
def authenticate(self,
username=None, password=None,
actions=None, response=None,
authorization=None):
authorization=None,
user_agent='Docker-Client/19.03.2 (linux)'):
# pylint: disable=too-many-arguments,too-many-locals,too-many-branches
"""
Authenticate to the registry using a username and password,
Expand All @@ -250,6 +251,9 @@ def authenticate(self,
:param authorization: ``Authorization`` header value.
:type authorization: str
:param user_agent: ``User-Agent`` header value.
:type user_agent: str
:rtype: str
:returns: Authentication token, if the registry supports bearer tokens. Otherwise ``None``, and HTTP Basic auth is used (if the registry requires authentication).
"""
Expand Down Expand Up @@ -281,7 +285,7 @@ def authenticate(self,
}
else:
headers = {}
headers["User-Agent"] = "Docker-Client/19.03.2 (linux)"
headers["User-Agent"] = user_agent

if 'bearer' in parsed:
info = parsed['bearer']
Expand Down

0 comments on commit 608c288

Please sign in to comment.