mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 21:46:52 +01:00
133 lines
14 KiB
HTML
133 lines
14 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.9.8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>tgstation-server: src/Tgstation.Server.Client.GraphQL/AuthorizationMessageHandler.cs Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">tgstation-server<span id="projectnumber"> 6.19.3</span>
|
|
</div>
|
|
<div id="projectbrief">The /tg/station 13 server suite</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.8 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function() { init_codefold(0); });
|
|
/* @license-end */
|
|
</script>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_a1feee0f70494a5f77c9e6ae0b428090.html">Tgstation.Server.Client.GraphQL</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle"><div class="title">AuthorizationMessageHandler.cs</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="_authorization_message_handler_8cs.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="keyword">using </span>System.Net.Http;</div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="keyword">using </span>System.Net.Http.Headers;</div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="keyword">using </span>System.Threading;</div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="keyword">using </span>System.Threading.Tasks;</div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span> </div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_client_1_1_graph_q_l.html">Tgstation.Server.Client.GraphQL</a></div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span>{</div>
|
|
<div class="foldopen" id="foldopen00011" data-start="{" data-end="};">
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html"> 11</a></span> <span class="keyword">sealed</span> <span class="keyword">class </span><a class="code hl_class" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html">AuthorizationMessageHandler</a> : <a class="code hl_class" href="class_delegating_handler.html">DelegatingHandler</a></div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> {</div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#a82e3adc8c9ce62e4b096b5681447bdd4"> 16</a></span> <span class="keyword">public</span> <span class="keyword">static</span> AsyncLocal<AuthenticationHeaderValue?> <a class="code hl_property" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#a82e3adc8c9ce62e4b096b5681447bdd4">Header</a> { <span class="keyword">get</span>; } = <span class="keyword">new</span> AsyncLocal<AuthenticationHeaderValue?>();</div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#acf8151f7ca7a6f43180ae2e7d992db7b"> 21</a></span> readonly AuthenticationHeaderValue? <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#acf8151f7ca7a6f43180ae2e7d992db7b">headerOverride</a>;</div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
|
<div class="foldopen" id="foldopen00027" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#a9d721b4c99d408868a14b06ee6668379"> 27</a></span> <span class="keyword">public</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#a9d721b4c99d408868a14b06ee6668379">AuthorizationMessageHandler</a>(AuthenticationHeaderValue? <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#acf8151f7ca7a6f43180ae2e7d992db7b">headerOverride</a>)</div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> {</div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> this.headerOverride = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#acf8151f7ca7a6f43180ae2e7d992db7b">headerOverride</a>;</div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> </div>
|
|
<div class="foldopen" id="foldopen00033" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#a693214b2663a1d5189d1fcddff019700"> 33</a></span> <span class="keyword">protected</span> <span class="keyword">override</span> Task<HttpResponseMessage> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#a693214b2663a1d5189d1fcddff019700">SendAsync</a>(HttpRequestMessage request, CancellationToken cancellationToken)</div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> {</div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> var currentAuthHeader = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#acf8151f7ca7a6f43180ae2e7d992db7b">headerOverride</a> ?? <a class="code hl_property" href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#a82e3adc8c9ce62e4b096b5681447bdd4">Header</a>.Value;</div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">if</span> (currentAuthHeader != <span class="keyword">null</span>)</div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> request.Headers.Authorization = currentAuthHeader;</div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordflow">return</span> base.SendAsync(request, cancellationToken);</div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span>}</div>
|
|
<div class="ttc" id="aclass_delegating_handler_html"><div class="ttname"><a href="class_delegating_handler.html">DelegatingHandler</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html">Tgstation.Server.Client.GraphQL.AuthorizationMessageHandler</a></div><div class="ttdoc">DelegatingHandler that applies the AuthenticationHeaderValue.</div><div class="ttdef"><b>Definition</b> <a href="_authorization_message_handler_8cs_source.html#l00011">AuthorizationMessageHandler.cs:12</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler_html_a693214b2663a1d5189d1fcddff019700"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#a693214b2663a1d5189d1fcddff019700">Tgstation.Server.Client.GraphQL.AuthorizationMessageHandler.SendAsync</a></div><div class="ttdeci">override Task< HttpResponseMessage > SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)</div><div class="ttdef"><b>Definition</b> <a href="_authorization_message_handler_8cs_source.html#l00033">AuthorizationMessageHandler.cs:33</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler_html_a82e3adc8c9ce62e4b096b5681447bdd4"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#a82e3adc8c9ce62e4b096b5681447bdd4">Tgstation.Server.Client.GraphQL.AuthorizationMessageHandler.Header</a></div><div class="ttdeci">static AsyncLocal< AuthenticationHeaderValue?> Header</div><div class="ttdoc">The AsyncLocal<T> AuthenticationHeaderValue to be applied.</div><div class="ttdef"><b>Definition</b> <a href="_authorization_message_handler_8cs_source.html#l00016">AuthorizationMessageHandler.cs:16</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler_html_a9d721b4c99d408868a14b06ee6668379"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#a9d721b4c99d408868a14b06ee6668379">Tgstation.Server.Client.GraphQL.AuthorizationMessageHandler.AuthorizationMessageHandler</a></div><div class="ttdeci">AuthorizationMessageHandler(AuthenticationHeaderValue? headerOverride)</div><div class="ttdoc">Initializes a new instance of the AuthorizationMessageHandler class.</div><div class="ttdef"><b>Definition</b> <a href="_authorization_message_handler_8cs_source.html#l00027">AuthorizationMessageHandler.cs:27</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler_html_acf8151f7ca7a6f43180ae2e7d992db7b"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_client_1_1_graph_q_l_1_1_authorization_message_handler.html#acf8151f7ca7a6f43180ae2e7d992db7b">Tgstation.Server.Client.GraphQL.AuthorizationMessageHandler.headerOverride</a></div><div class="ttdeci">readonly? AuthenticationHeaderValue headerOverride</div><div class="ttdoc">class override for Header.</div><div class="ttdef"><b>Definition</b> <a href="_authorization_message_handler_8cs_source.html#l00021">AuthorizationMessageHandler.cs:21</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_client_1_1_graph_q_l_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_client_1_1_graph_q_l.html">Tgstation.Server.Client.GraphQL</a></div><div class="ttdef"><b>Definition</b> <a href="_authenticated_graph_q_l_server_client_8cs_source.html#l00011">AuthenticatedGraphQLServerClient.cs:12</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
|
|
</small></address>
|
|
</body>
|
|
</html>
|