Commit 31358848 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Add restricted access documentation

parent 284c23d3
......@@ -157,7 +157,8 @@ def network_download(net, filename):
abort(404)
if entry.restricted:
token = request.headers.get("WWW-Authenticate", "")
token = token.replace("Authorization: Bearer", "").strip()
token = token.replace("Authorization:", "").strip()
token = token.replace("Bearer", "").strip()
if token not in access_tokens:
abort(401)
if filename.split(".")[0] == entry.name:
......@@ -310,6 +311,10 @@ def api_entires(net):
def about_page():
return render_template('about.html')
@app.route("/restricted")
def restricted_page():
return render_template('restricted.html')
@app.route("/git")
def git_page():
return redirect("//git.skewed.de/count0/netzschleuder/")
......
......@@ -65,7 +65,8 @@ active
<span style="color:red">Restricted access.</span>
Upstream does not permit data redistribution, hence the
network files cannot be downloaded without
authorization.
authorization. See <a href="/restricted">here</a> how to
gain access.
{% else %}
{{entry.upstream_license[0]}}, <a href="{{entry.upstream_license[1]}}">{{entry.upstream_license[1]}}</a>
{% endif %}
......
{% extends "base.html" %}
{% block about_active %}
active
{% endblock %}
{% block content %}
<div class="column-group">
<div class="xlarge-50 large-50 small-100 bottom-space" style="padding-right:.5em">
<h1 style="margin-bottom: .5em">Restricted datasets</h1>
<p>Some datasets included in the repository cannot be downloaded
without authorization, because open distribution is unfortunately
not permitted by the upstream source. In this case, the download will
fail with an <code>401 Unauthorized</code> error.</p>
<p>It is possible to be granted access to these files with an
authorization token. This token needs to be passed as
the <code>WWW-Authenticate</code> HTTP request header with a value
<blockquote>
<code>
WWW-Authenticate: &lt;TOKEN&gt;
</code>
</blockquote>
where <code>&lt;TOKEN&gt;</code> needs to be replaced by the actual
token string.</p>
<p>This can be done via <a href="https://curl.se">curl</a> as
follows:
<blockquote>
<code>
curl --header "WWW-Authenticate: &lt;TOKEN&gt;" https://networks.skewed.de/net/add_health/files/comm26.gt.zst > comm26.gt.zst
</code>
</blockquote>
</p>
<p> If you are
using <a href="//graph-tool.skewed.de/static/doc/collection.html#graph_tool.collection.ns">graph-tool</a>
to access the repository, then the token just needs to be stored in
a file named
<blockquote>
<code>.gt_token</code>
</blockquote>
in your home directory.</p>
<p> If you believe you should be granted authorization, please
contact <a href="//skewed.de/tiago">Tiago P. Peixoto</a> to request
a token.
</p>
</div>
</div>
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment