Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions _site/guides/concepts/debugging.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ <h1 id="debugging">Debugging</h1>
<ul>
<li><a href="#graphiti-request">graphiti:request</a></li>
<li><a href="#graphiti-benchmark">graphiti:benchmark</a></li>
<li><a href="#Authorization-headers">Authorization headers</a></li>
</ul>
</li>
<li>3 <a href="#tips">Tips</a></li>
Expand Down Expand Up @@ -301,6 +302,20 @@ <h4>

<p>Which will return the average response time.</p>

<a class="anchor" id="Authorization-headers" />
<a class="header" href="#Authorization-headers">
<h4>
2.3 Authorization headers
</h4>
</a>

<p>If you have an Authorization scheme implemented (for example <a href="https://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Token.html">authenticate_or_request_with_http_token</a> in rails) you can supply the <code class="highlighter-rouge">Authorization</code> http header value with the <code class="highlighter-rouge">AUTHORIZATION_HEADER</code> environment variable:</p>

<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="gp">$ </span><span class="nb">export </span><span class="nv">AUTHORIZATION_HEADER</span><span class="o">=</span><span class="s2">"Token --PRIVATE_API_KEY--"</span>
<span class="gp">$ </span>bin/rake graphiti:request[/employees,true]</code></pre></figure>

<p>This also will work for <code class="highlighter-rouge">Basic</code> (<a href="https://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Basic.html$$">request_http_basic_authentication</a>) and <code class="highlighter-rouge">Bearer</code> values</p>

<a class="anchor" id="tips" />
<a class="header" href="#tips">
<h2>
Expand Down
12 changes: 12 additions & 0 deletions guides/concepts/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Debugging
* 2 [Rake Tasks](#rake-tasks)
* [graphiti:request](#graphiti-request)
* [graphiti:benchmark](#graphiti-benchmark)
* [Authorization headers](#Authorization-headers)
* 3 [Tips](#tips)

</div>
Expand Down Expand Up @@ -202,6 +203,17 @@ $ bin/rake graphiti:benchmark[/employees,100]

Which will return the average response time.

{% include h.html tag="h4" text="2.3 Authorization headers" a="Authorization-headers" %}

If you have an Authorization scheme implemented (for example [authenticate_or_request_with_http_token](https://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Token.html) in rails) you can supply the `Authorization` http header value with the `AUTHORIZATION_HEADER` environment variable:

{% highlight bash %}
$ export AUTHORIZATION_HEADER="Token --PRIVATE_API_KEY--"
$ bin/rake graphiti:request[/employees,true]
{% endhighlight %}

This also will work for `Basic` ([request_http_basic_authentication](https://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Basic.html$$)) and `Bearer` values

{% include h.html tag="h2" text="3 Tips" a="tips" %}

When debugging an application, try to isolate the individual Resource
Expand Down