Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update of open source docs #214

Merged
merged 2 commits into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.idea/
_build/
build/
.vscode/
*.swp
*.swo
.DS_Store
_repos/
_rsts/
rsts_tmp/
.doctrees/
Binary file added _images/flyte_cli_flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/flyte_ui_flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion _modules/abc.html
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ <h1>Source code for abc</h1><div class="highlight"><pre>

<div role="contentinfo">
<p>
&copy; Copyright 2019, Flyte Authors
&copy; Copyright 2020, Flyte Authors

</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion _modules/flytekit/clients/friendly.html
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ <h1>Source code for flytekit.clients.friendly</h1><div class="highlight"><pre>

<div role="contentinfo">
<p>
&copy; Copyright 2019, Flyte Authors
&copy; Copyright 2020, Flyte Authors

</p>
</div>
Expand Down
6 changes: 5 additions & 1 deletion _modules/flytekit/clients/helpers.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@

<h1>Source code for flytekit.clients.helpers</h1><div class="highlight"><pre>
<span></span>
<span class="kn">from</span> <span class="nn">flytekit.clis.auth</span> <span class="k">import</span> <span class="n">credentials</span> <span class="k">as</span> <span class="n">_credentials_access</span>



<div class="viewcode-block" id="iterate_node_executions"><a class="viewcode-back" href="../../../flytekit/flytekit.clients.html#flytekit.clients.helpers.iterate_node_executions">[docs]</a><span class="k">def</span> <span class="nf">iterate_node_executions</span><span class="p">(</span>
<span class="n">client</span><span class="p">,</span>
Expand Down Expand Up @@ -229,6 +232,7 @@ <h1>Source code for flytekit.clients.helpers</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="ow">not</span> <span class="n">next_token</span><span class="p">:</span>
<span class="k">break</span>
<span class="n">token</span> <span class="o">=</span> <span class="n">next_token</span></div>

</pre></div>

</div>
Expand All @@ -241,7 +245,7 @@ <h1>Source code for flytekit.clients.helpers</h1><div class="highlight"><pre>

<div role="contentinfo">
<p>
&copy; Copyright 2019, Flyte Authors
&copy; Copyright 2020, Flyte Authors

</p>
</div>
Expand Down
146 changes: 117 additions & 29 deletions _modules/flytekit/clients/raw.html

Large diffs are not rendered by default.

476 changes: 476 additions & 0 deletions _modules/flytekit/clis/auth/auth.html

Large diffs are not rendered by default.

258 changes: 258 additions & 0 deletions _modules/flytekit/clis/auth/credentials.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@


<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>flytekit.clis.auth.credentials &mdash; Flyte 0.0.1 documentation</title>








<script type="text/javascript" src="../../../../_static/js/modernizr.min.js"></script>


<script type="text/javascript" id="documentation_options" data-url_root="../../../../" src="../../../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../../_static/language_data.js"></script>

<script type="text/javascript" src="../../../../_static/js/theme.js"></script>




<link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../search.html" />
</head>

<body class="wy-body-for-nav">


<div class="wy-grid-for-nav">

<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >



<a href="../../../../index.html" class="icon icon-home"> Flyte



</a>







<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>


</div>

<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">






<p class="caption"><span class="caption-text">Flyte Documentation</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../introduction/index.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../user/index.html">User docs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../administrator/index.html">Administrator Docs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../contributor/index.html">Contributor Docs</a></li>
</ul>
<p class="caption"><span class="caption-text">Generated Documentation from Source</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../flyteidl/index.html">Flyte Language and API specification</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../flytekit/index.html">Flytekit</a></li>
</ul>



</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">


<nav class="wy-nav-top" aria-label="top navigation">

<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../../index.html">Flyte</a>

</nav>


<div class="wy-nav-content">

<div class="rst-content">

















<div role="navigation" aria-label="breadcrumbs navigation">

<ul class="wy-breadcrumbs">

<li><a href="../../../../index.html">Docs</a> &raquo;</li>

<li><a href="../../../index.html">Module code</a> &raquo;</li>

<li>flytekit.clis.auth.credentials</li>


<li class="wy-breadcrumbs-aside">

</li>

</ul>


<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>Source code for flytekit.clis.auth.credentials</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">absolute_import</span>

<span class="kn">import</span> <span class="nn">logging</span> <span class="k">as</span> <span class="nn">_logging</span>

<span class="kn">from</span> <span class="nn">flytekit.clis.auth.auth</span> <span class="k">import</span> <span class="n">AuthorizationClient</span> <span class="k">as</span> <span class="n">_AuthorizationClient</span>
<span class="kn">from</span> <span class="nn">flytekit.clis.auth.discovery</span> <span class="k">import</span> <span class="n">DiscoveryClient</span> <span class="k">as</span> <span class="n">_DiscoveryClient</span>

<span class="kn">from</span> <span class="nn">flytekit.configuration.creds</span> <span class="k">import</span> <span class="p">(</span>
<span class="n">REDIRECT_URI</span> <span class="k">as</span> <span class="n">_REDIRECT_URI</span><span class="p">,</span>
<span class="n">CLIENT_ID</span> <span class="k">as</span> <span class="n">_CLIENT_ID</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">flytekit.configuration.platform</span> <span class="k">import</span> <span class="n">URL</span> <span class="k">as</span> <span class="n">_URL</span><span class="p">,</span> <span class="n">INSECURE</span> <span class="k">as</span> <span class="n">_INSECURE</span><span class="p">,</span> <span class="n">HTTP_URL</span> <span class="k">as</span> <span class="n">_HTTP_URL</span>

<span class="k">try</span><span class="p">:</span> <span class="c1"># Python 3</span>
<span class="kn">import</span> <span class="nn">urllib.parse</span> <span class="k">as</span> <span class="nn">_urlparse</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span> <span class="c1"># Python 2</span>
<span class="kn">import</span> <span class="nn">urlparse</span> <span class="k">as</span> <span class="nn">_urlparse</span>

<span class="c1"># Default, well known-URI string used for fetching JSON metadata. See https://tools.ietf.org/html/rfc8414#section-3.</span>
<span class="n">discovery_endpoint_path</span> <span class="o">=</span> <span class="s2">&quot;./.well-known/oauth-authorization-server&quot;</span>


<span class="k">def</span> <span class="nf">_get_discovery_endpoint</span><span class="p">(</span><span class="n">http_config_val</span><span class="p">,</span> <span class="n">platform_url_val</span><span class="p">,</span> <span class="n">insecure_val</span><span class="p">):</span>

<span class="k">if</span> <span class="n">http_config_val</span><span class="p">:</span>
<span class="n">scheme</span><span class="p">,</span> <span class="n">netloc</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">_urlparse</span><span class="o">.</span><span class="n">urlparse</span><span class="p">(</span><span class="n">http_config_val</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">scheme</span><span class="p">:</span>
<span class="n">scheme</span> <span class="o">=</span> <span class="s1">&#39;http&#39;</span> <span class="k">if</span> <span class="n">insecure_val</span> <span class="k">else</span> <span class="s1">&#39;https&#39;</span>
<span class="k">else</span><span class="p">:</span> <span class="c1"># Use the main _URL config object effectively</span>
<span class="n">scheme</span> <span class="o">=</span> <span class="s1">&#39;http&#39;</span> <span class="k">if</span> <span class="n">insecure_val</span> <span class="k">else</span> <span class="s1">&#39;https&#39;</span>
<span class="n">netloc</span> <span class="o">=</span> <span class="n">platform_url_val</span>
<span class="n">path</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>

<span class="n">computed_endpoint</span> <span class="o">=</span> <span class="n">_urlparse</span><span class="o">.</span><span class="n">urlunparse</span><span class="p">((</span><span class="n">scheme</span><span class="p">,</span> <span class="n">netloc</span><span class="p">,</span> <span class="n">path</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">))</span>
<span class="c1"># The urljoin function needs a trailing slash in order to append things correctly. Also, having an extra slash</span>
<span class="c1"># at the end is okay, it just gets stripped out.</span>
<span class="n">computed_endpoint</span> <span class="o">=</span> <span class="n">_urlparse</span><span class="o">.</span><span class="n">urljoin</span><span class="p">(</span><span class="n">computed_endpoint</span> <span class="o">+</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="n">discovery_endpoint_path</span><span class="p">)</span>
<span class="n">_logging</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">&#39;Using </span><span class="si">{}</span><span class="s1"> as discovery endpoint&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">computed_endpoint</span><span class="p">))</span>
<span class="k">return</span> <span class="n">computed_endpoint</span>


<span class="c1"># Lazy initialized authorization client singleton</span>
<span class="n">_authorization_client</span> <span class="o">=</span> <span class="kc">None</span>


<div class="viewcode-block" id="get_client"><a class="viewcode-back" href="../../../../flytekit/flytekit.clis.auth.html#flytekit.clis.auth.credentials.get_client">[docs]</a><span class="k">def</span> <span class="nf">get_client</span><span class="p">():</span>
<span class="k">global</span> <span class="n">_authorization_client</span>
<span class="k">if</span> <span class="n">_authorization_client</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">_authorization_client</span><span class="o">.</span><span class="n">expired</span><span class="p">:</span>
<span class="k">return</span> <span class="n">_authorization_client</span>
<span class="n">authorization_endpoints</span> <span class="o">=</span> <span class="n">get_authorization_endpoints</span><span class="p">()</span>

<span class="n">_authorization_client</span> <span class="o">=</span>\
<span class="n">_AuthorizationClient</span><span class="p">(</span><span class="n">redirect_uri</span><span class="o">=</span><span class="n">_REDIRECT_URI</span><span class="o">.</span><span class="n">get</span><span class="p">(),</span> <span class="n">client_id</span><span class="o">=</span><span class="n">_CLIENT_ID</span><span class="o">.</span><span class="n">get</span><span class="p">(),</span>
<span class="n">auth_endpoint</span><span class="o">=</span><span class="n">authorization_endpoints</span><span class="o">.</span><span class="n">auth_endpoint</span><span class="p">,</span>
<span class="n">token_endpoint</span><span class="o">=</span><span class="n">authorization_endpoints</span><span class="o">.</span><span class="n">token_endpoint</span><span class="p">)</span>
<span class="k">return</span> <span class="n">_authorization_client</span></div>


<div class="viewcode-block" id="get_authorization_endpoints"><a class="viewcode-back" href="../../../../flytekit/flytekit.clis.auth.html#flytekit.clis.auth.credentials.get_authorization_endpoints">[docs]</a><span class="k">def</span> <span class="nf">get_authorization_endpoints</span><span class="p">():</span>
<span class="n">discovery_endpoint</span> <span class="o">=</span> <span class="n">_get_discovery_endpoint</span><span class="p">(</span><span class="n">_HTTP_URL</span><span class="o">.</span><span class="n">get</span><span class="p">(),</span> <span class="n">_URL</span><span class="o">.</span><span class="n">get</span><span class="p">(),</span> <span class="n">_INSECURE</span><span class="o">.</span><span class="n">get</span><span class="p">())</span>
<span class="n">discovery_client</span> <span class="o">=</span> <span class="n">_DiscoveryClient</span><span class="p">(</span><span class="n">discovery_url</span><span class="o">=</span><span class="n">discovery_endpoint</span><span class="p">)</span>
<span class="k">return</span> <span class="n">discovery_client</span><span class="o">.</span><span class="n">get_authorization_endpoints</span><span class="p">()</span></div>
</pre></div>

</div>

</div>
<footer>


<hr/>

<div role="contentinfo">
<p>
&copy; Copyright 2020, Flyte Authors

</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.

</footer>

</div>
</div>

</section>

</div>



<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>






</body>
</html>
Loading