mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 21:46:52 +01:00
463 lines
134 KiB
HTML
463 lines
134 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.Host/Security/AuthenticationContextFactory.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_34761767c1c3cd212f9d2f80ea0828a8.html">Tgstation.Server.Host</a></li><li class="navelem"><a class="el" href="dir_c5451d9d233744a5b09a29938f0cda9a.html">Security</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle"><div class="title">AuthenticationContextFactory.cs</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="_authentication_context_factory_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;</div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="keyword">using </span><a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">System.Collections.Generic</a>;</div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="keyword">using </span><a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">System.Linq</a>;</div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="keyword">using </span><a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">System.Security.Claims</a>;</div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="keyword">using </span><a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">System.Threading</a>;</div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="keyword">using </span><a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">System.Threading.Tasks</a>;</div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="keyword">using </span><a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">Microsoft.AspNetCore.Authentication</a>;</div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">using </span><a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">Microsoft.AspNetCore.Authentication.OpenIdConnect</a>;</div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="keyword">using </span><a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">Microsoft.EntityFrameworkCore</a>;</div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">using </span><a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">Microsoft.Extensions.Logging</a>;</div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="keyword">using </span><a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">Microsoft.Extensions.Options</a>;</div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="keyword">using </span><a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">Microsoft.IdentityModel.JsonWebTokens</a>;</div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_api.html">Tgstation.Server.Api</a>;</div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html">Tgstation.Server.Api.Rights</a>;</div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_configuration.html">Tgstation.Server.Host.Configuration</a>;</div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_database.html">Tgstation.Server.Host.Database</a>;</div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_extensions.html">Tgstation.Server.Host.Extensions</a>;</div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_models.html">Tgstation.Server.Host.Models</a>;</div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_utils.html">Tgstation.Server.Host.Utils</a>;</div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_security.html">Tgstation.Server.Host.Security</a></div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span>{</div>
|
|
<div class="foldopen" id="foldopen00026" data-start="{" data-end="};">
|
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html"> 26</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_host_1_1_security_1_1_authentication_context_factory.html">AuthenticationContextFactory</a> : <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_token_validator.html">ITokenValidator</a>, <a class="code hl_class" href="class_i_disposable.html">IDisposable</a></div>
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> {</div>
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#aa1e9ff0257acd2d7e79ff7784d0a2338"> 31</a></span> <span class="keyword">public</span> <span class="keyword">const</span> <span class="keywordtype">string</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#aa1e9ff0257acd2d7e79ff7784d0a2338">OpenIDConnectAuthenticationSchemePrefix</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">$</a><span class="stringliteral">"{OpenIdConnectDefaults.AuthenticationScheme}."</span>;</div>
|
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a37a564f1b33b53dc2af9fb751b5a7e9b"> 36</a></span> <span class="keyword">public</span> <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_authentication_context.html">IAuthenticationContext</a> <a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a37a564f1b33b53dc2af9fb751b5a7e9b">CurrentAuthenticationContext</a> => <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ab6f08f16e79b7a7d5d18acea67cc3fed">currentAuthenticationContext</a>;</div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0"> 41</a></span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">readonly</a> <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html">IDatabaseContext</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">databaseContext</a>;</div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
|
|
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a94c0a91ac1bdb6d25c9546a583fb44e3"> 46</a></span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">readonly</a> <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_identity_cache.html">IIdentityCache</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a94c0a91ac1bdb6d25c9546a583fb44e3">identityCache</a>;</div>
|
|
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
|
|
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ad4f0ff4bf15db55892865ec54079e68b"> 51</a></span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">readonly</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">IOptions<SwarmConfiguration></a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ad4f0ff4bf15db55892865ec54079e68b">swarmConfigurationOptions</a>;</div>
|
|
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
|
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a1bbf757c3edef49ff242e77c8ee354c6"> 56</a></span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">readonly</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">IOptionsSnapshot<SecurityConfiguration></a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a1bbf757c3edef49ff242e77c8ee354c6">securityConfigurationOptions</a>;</div>
|
|
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
|
|
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a6785a5176d17d6fa0d54da20d418e21c"> 61</a></span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">readonly</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ILogger<AuthenticationContextFactory></a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a6785a5176d17d6fa0d54da20d418e21c">logger</a>;</div>
|
|
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
|
|
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ab6f08f16e79b7a7d5d18acea67cc3fed"> 66</a></span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">readonly</a> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context.html">AuthenticationContext</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ab6f08f16e79b7a7d5d18acea67cc3fed">currentAuthenticationContext</a>;</div>
|
|
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
|
|
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a9e3b885a643bc5c2431e2e0cd4f6cbad"> 71</a></span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">readonly</a> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_api_1_1_api_headers.html">ApiHeaders</a>? <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a9e3b885a643bc5c2431e2e0cd4f6cbad">apiHeaders</a>;</div>
|
|
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
|
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a85bc3078ee1cf12395ae0d4c9e0238af"> 76</a></span> <span class="keywordtype">int</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a85bc3078ee1cf12395ae0d4c9e0238af">initialized</a>;</div>
|
|
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
|
|
<div class="foldopen" id="foldopen00087" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#aba1135484ebaa606bfad5cd2d9a948d2"> 87</a></span> <span class="keyword">public</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#aba1135484ebaa606bfad5cd2d9a948d2">AuthenticationContextFactory</a>(</div>
|
|
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html">IDatabaseContext</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">databaseContext</a>,</div>
|
|
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_identity_cache.html">IIdentityCache</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a94c0a91ac1bdb6d25c9546a583fb44e3">identityCache</a>,</div>
|
|
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_utils_1_1_i_api_headers_provider.html">IApiHeadersProvider</a> apiHeadersProvider,</div>
|
|
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">IOptions<SwarmConfiguration></a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ad4f0ff4bf15db55892865ec54079e68b">swarmConfigurationOptions</a>,</div>
|
|
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">IOptionsSnapshot<SecurityConfiguration></a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a1bbf757c3edef49ff242e77c8ee354c6">securityConfigurationOptions</a>,</div>
|
|
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ILogger<AuthenticationContextFactory></a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a6785a5176d17d6fa0d54da20d418e21c">logger</a>)</div>
|
|
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> {</div>
|
|
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">this.databaseContext</a> = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">databaseContext</a> ?? <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ArgumentNullException</a>(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">nameof</a>(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">databaseContext</a>));</div>
|
|
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">this.identityCache</a> = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a94c0a91ac1bdb6d25c9546a583fb44e3">identityCache</a> ?? <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ArgumentNullException</a>(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">nameof</a>(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a94c0a91ac1bdb6d25c9546a583fb44e3">identityCache</a>));</div>
|
|
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ArgumentNullException</a>.ThrowIfNull(apiHeadersProvider);</div>
|
|
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
|
|
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a9e3b885a643bc5c2431e2e0cd4f6cbad">apiHeaders</a> = apiHeadersProvider.<a class="code hl_property" href="interface_tgstation_1_1_server_1_1_host_1_1_utils_1_1_i_api_headers_provider.html#a479fc84909e81d756d193308ff2c0c78">ApiHeaders</a>;</div>
|
|
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">this.swarmConfigurationOptions</a> = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ad4f0ff4bf15db55892865ec54079e68b">swarmConfigurationOptions</a> ?? <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ArgumentNullException</a>(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">nameof</a>(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ad4f0ff4bf15db55892865ec54079e68b">swarmConfigurationOptions</a>));</div>
|
|
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">this.securityConfigurationOptions</a> = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a1bbf757c3edef49ff242e77c8ee354c6">securityConfigurationOptions</a> ?? <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ArgumentNullException</a>(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">nameof</a>(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a1bbf757c3edef49ff242e77c8ee354c6">securityConfigurationOptions</a>));</div>
|
|
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> </div>
|
|
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">this.logger</a> = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a6785a5176d17d6fa0d54da20d418e21c">logger</a> ?? <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ArgumentNullException</a>(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">nameof</a>(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a6785a5176d17d6fa0d54da20d418e21c">logger</a>));</div>
|
|
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
|
|
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ab6f08f16e79b7a7d5d18acea67cc3fed">currentAuthenticationContext</a> = <span class="keyword">new</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context.html">AuthenticationContext</a>();</div>
|
|
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> </div>
|
|
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#accc9334a642e563e47c5308df2d5149a"> 109</a></span> <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#accc9334a642e563e47c5308df2d5149a">Dispose</a>() => <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ab6f08f16e79b7a7d5d18acea67cc3fed">currentAuthenticationContext</a>.<a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context.html#a4a5a80952341c5a9e0f3a84e27734f8a">Dispose</a>();</div>
|
|
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> </div>
|
|
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="preprocessor">#pragma warning disable CA1506 </span><span class="comment">// TODO: Decomplexify</span></div>
|
|
<div class="foldopen" id="foldopen00113" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ae7a11f6cc136eafce06872c382a15122"> 113</a></span> <span class="keyword">public</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">async</a> Task <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ae7a11f6cc136eafce06872c382a15122">ValidateTgsToken</a>(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">Microsoft</a>.AspNetCore.Authentication.JwtBearer.TokenValidatedContext <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">CancellationToken</a> cancellationToken)</div>
|
|
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="preprocessor">#pragma warning restore CA1506</span></div>
|
|
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> {</div>
|
|
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ArgumentNullException</a>.ThrowIfNull(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>);</div>
|
|
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> </div>
|
|
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>.SecurityToken <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">is</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">not</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">JsonWebToken</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">jwt</a>)</div>
|
|
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ArgumentException</a>(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">$</a><span class="stringliteral">"Expected {nameof(tokenValidatedContext)} to contain a {nameof(JsonWebToken)}!"</span>, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">nameof</a>(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>));</div>
|
|
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
|
|
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">Interlocked</a>.Exchange(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ref</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a85bc3078ee1cf12395ae0d4c9e0238af">initialized</a>, 1) != 0)</div>
|
|
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">InvalidOperationException</a>(<span class="stringliteral">"Authentication context has already been loaded"</span>);</div>
|
|
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> </div>
|
|
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">principal</a> = <span class="keyword">new</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ClaimsPrincipal</a>(<span class="keyword">new</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ClaimsIdentity</a>(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">jwt</a>.Claims));</div>
|
|
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">userId</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">principal</a>.GetTgsUserId();</div>
|
|
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> </div>
|
|
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">notBefore</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">principal</a>.ParseTime(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">JwtRegisteredClaimNames</a>.Nbf);</div>
|
|
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">expires</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">principal</a>.ParseTime(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">JwtRegisteredClaimNames</a>.Exp);</div>
|
|
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> </div>
|
|
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> user = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">await</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">databaseContext</a></div>
|
|
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> .<a class="code hl_property" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a9b6cb85c0616ae3076d4837f50a34d95">Users</a></div>
|
|
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> .Where(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a>.Id == <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">userId</a>)</div>
|
|
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> .Include(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a>.CreatedBy)</div>
|
|
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> .Include(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a>.PermissionSet)</div>
|
|
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> .Include(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a>.Group)</div>
|
|
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> .ThenInclude(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a>!.<a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_permission_set.html">PermissionSet</a>)</div>
|
|
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> .Include(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a>.OAuthConnections)</div>
|
|
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> .Include(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a>.OidcConnections)</div>
|
|
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> .FirstOrDefaultAsync(cancellationToken);</div>
|
|
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordflow">if</span> (user == <span class="keywordflow">default</span>)</div>
|
|
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> {</div>
|
|
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>.Fail(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">$</a><span class="stringliteral">"Unable to find user with ID {userId}!"</span>);</div>
|
|
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="keywordflow">return</span>;</div>
|
|
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> }</div>
|
|
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
|
|
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_system_identity.html">ISystemIdentity</a>? <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">systemIdentity</a>;</div>
|
|
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">if</span> (user.SystemIdentifier != <span class="keyword">null</span>)</div>
|
|
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">systemIdentity</a> = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a94c0a91ac1bdb6d25c9546a583fb44e3">identityCache</a>.<a class="code hl_function" href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_identity_cache.html#afc655c9c2d6af6086bcda5b6c54e1c41">LoadCachedIdentity</a>(user);</div>
|
|
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordflow">else</span></div>
|
|
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> {</div>
|
|
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="keywordflow">if</span> (user.LastPasswordUpdate.HasValue && user.LastPasswordUpdate >= <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">notBefore</a>)</div>
|
|
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> {</div>
|
|
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>.Fail(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">$</a><span class="stringliteral">"Rejecting token for user {userId} created before last modification: {user.LastPasswordUpdate.Value}"</span>);</div>
|
|
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordflow">return</span>;</div>
|
|
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> }</div>
|
|
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> </div>
|
|
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">systemIdentity</a> = <span class="keyword">null</span>;</div>
|
|
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> }</div>
|
|
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> </div>
|
|
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">userPermissionSet</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">user.PermissionSet</a> ?? user.Group!.PermissionSet;</div>
|
|
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="keywordflow">try</span></div>
|
|
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> {</div>
|
|
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_instance_permission_set.html">InstancePermissionSet</a>? <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">instancePermissionSet</a> = <span class="keyword">null</span>;</div>
|
|
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">instanceId</a> = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a9e3b885a643bc5c2431e2e0cd4f6cbad">apiHeaders</a>?.<a class="code hl_property" href="class_tgstation_1_1_server_1_1_api_1_1_api_headers.html#a65e7d0ba3a39c992691f7721c62c1531">InstanceId</a>;</div>
|
|
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">instanceId</a>.HasValue)</div>
|
|
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> {</div>
|
|
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">instancePermissionSet</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">await</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">databaseContext</a></div>
|
|
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> .<a class="code hl_property" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a054072960919046eaf843990883621f0">InstancePermissionSets</a></div>
|
|
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> .Where(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a>.PermissionSetId == <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">userPermissionSet</a>!.Id && <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a>.InstanceId == <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">instanceId</a> && <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a>.Instance!.SwarmIdentifer == <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ad4f0ff4bf15db55892865ec54079e68b">swarmConfigurationOptions</a>.Value.Identifier)</div>
|
|
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> .Include(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">x</a>.Instance)</div>
|
|
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> .FirstOrDefaultAsync(cancellationToken);</div>
|
|
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> </div>
|
|
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">instancePermissionSet</a> == <span class="keyword">null</span>)</div>
|
|
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a6785a5176d17d6fa0d54da20d418e21c">logger</a>.LogDebug(<span class="stringliteral">"User {userId} does not have permissions on instance {instanceId}!"</span>, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">userId</a>, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">instanceId</a>.Value);</div>
|
|
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> }</div>
|
|
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> </div>
|
|
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ab6f08f16e79b7a7d5d18acea67cc3fed">currentAuthenticationContext</a>.<a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context.html#a50e10a50be204ceb874bcf3e8a0f67d8">Initialize</a>(</div>
|
|
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> user,</div>
|
|
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">expires</a>,</div>
|
|
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">jwt</a>.EncodedSignature, <span class="comment">// signature is enough to uniquely identify the session as it is composite of all the inputs</span></div>
|
|
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">instancePermissionSet</a>,</div>
|
|
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">systemIdentity</a>);</div>
|
|
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> }</div>
|
|
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keywordflow">catch</span></div>
|
|
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> {</div>
|
|
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">systemIdentity</a>?.Dispose();</div>
|
|
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <span class="keywordflow">throw</span>;</div>
|
|
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> }</div>
|
|
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> </div>
|
|
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span><span class="preprocessor">#pragma warning disable CA1506 </span><span class="comment">// TODO: Decomplexify</span></div>
|
|
<div class="foldopen" id="foldopen00193" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#aadc5630dc46ebe24e1c479f1bf8c17f1"> 193</a></span> <span class="keyword">public</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">async</a> Task <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#aadc5630dc46ebe24e1c479f1bf8c17f1">ValidateOidcToken</a>(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">RemoteAuthenticationContext<OpenIdConnectOptions></a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>, <span class="keywordtype">string</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">schemeKey</a>, <span class="keywordtype">string</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupIdClaimName</a>, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">CancellationToken</a> cancellationToken)</div>
|
|
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span><span class="preprocessor">#pragma warning restore CA1506</span></div>
|
|
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> {</div>
|
|
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">ArgumentNullException</a>.ThrowIfNull(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>);</div>
|
|
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> </div>
|
|
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">principal</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>.Principal;</div>
|
|
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">principal</a> == <span class="keyword">null</span>)</div>
|
|
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">InvalidOperationException</a>(<span class="stringliteral">"Expected a valid principal here!"</span>);</div>
|
|
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> </div>
|
|
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">userIdClaim</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">principal</a>.FindFirst(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">JwtRegisteredClaimNames</a>.Sub);</div>
|
|
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">userIdClaim</a> == <span class="keywordflow">default</span>)</div>
|
|
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">InvalidOperationException</a>(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">$</a><span class="stringliteral">"Missing '{JwtRegisteredClaimNames.Sub}' claim!"</span>);</div>
|
|
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> </div>
|
|
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">userId</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">userIdClaim</a>.Value;</div>
|
|
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">scheme</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>.Scheme.Name;</div>
|
|
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">deprefixedScheme</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">scheme</a>.Substring(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#aa1e9ff0257acd2d7e79ff7784d0a2338">OpenIDConnectAuthenticationSchemePrefix</a>.Length);</div>
|
|
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">connection</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">await</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">databaseContext</a></div>
|
|
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> .<a class="code hl_property" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a719800c636e9228e8e216af51a7278aa">OidcConnections</a></div>
|
|
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> .Where(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">oidcConnection</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">oidcConnection</a>.ExternalUserId == <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">userId</a> && <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">oidcConnection</a>.SchemeKey == <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">deprefixedScheme</a>)</div>
|
|
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> .Include(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">oidcConnection</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">oidcConnection</a>.User)</div>
|
|
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> .ThenInclude(user => user!.Group)</div>
|
|
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> .ThenInclude(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">group</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">group</a>!.<a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_permission_set.html">PermissionSet</a>)</div>
|
|
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> .Include(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">oidcConnection</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">oidcConnection</a>.User)</div>
|
|
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> .ThenInclude(user => user!.<a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_permission_set.html">PermissionSet</a>)</div>
|
|
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> .FirstOrDefaultAsync(cancellationToken);</div>
|
|
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> </div>
|
|
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html">User</a> user;</div>
|
|
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="keywordflow">if</span> (!<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a1bbf757c3edef49ff242e77c8ee354c6">securityConfigurationOptions</a>.Value.OidcStrictMode)</div>
|
|
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> {</div>
|
|
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">connection</a> == <span class="keywordflow">default</span>)</div>
|
|
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> {</div>
|
|
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>.Fail(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">$</a><span class="stringliteral">"Unable to find user with OidcConnection for {deprefixedScheme}/{userId}!"</span>);</div>
|
|
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> <span class="keywordflow">return</span>;</div>
|
|
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> }</div>
|
|
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> </div>
|
|
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> user = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">connection</a>.User!;</div>
|
|
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> }</div>
|
|
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> <span class="keywordflow">else</span></div>
|
|
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> {</div>
|
|
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupClaim</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">principal</a>.FindFirst(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupIdClaimName</a>);</div>
|
|
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> <span class="keywordtype">long</span>? <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupId</a>;</div>
|
|
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupClaim</a> == <span class="keywordflow">default</span>)</div>
|
|
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupId</a> = <span class="keyword">null</span>;</div>
|
|
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">Int64</a>.TryParse(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupClaim</a>.Value, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">out</a> <span class="keywordtype">long</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupIdParsed</a>))</div>
|
|
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupId</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupIdParsed</a>;</div>
|
|
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> <span class="keywordflow">else</span></div>
|
|
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> {</div>
|
|
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>.Fail(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">$</a><span class="stringliteral">"User has non-numeric '{groupIdClaimName}' claim!"</span>);</div>
|
|
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> <span class="keywordflow">return</span>;</div>
|
|
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> }</div>
|
|
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> </div>
|
|
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user_group.html">UserGroup</a>? <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">group</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupId.HasValue</a></div>
|
|
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> ? <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">await</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">databaseContext</a></div>
|
|
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> .<a class="code hl_property" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a85ac1c61242f1de41d483259f94e9542">Groups</a></div>
|
|
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> .Where(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">group</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">group</a>.Id == <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupId</a>.Value)</div>
|
|
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> .Include(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">group</a> => <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">group</a>.PermissionSet)</div>
|
|
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> .FirstOrDefaultAsync(cancellationToken)</div>
|
|
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> : <span class="keyword">null</span>;</div>
|
|
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> </div>
|
|
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">missingClaimError</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">$</a><span class="stringliteral">"User missing '{groupIdClaimName}' claim!"</span>;</div>
|
|
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">connection</a> == <span class="keywordflow">default</span>)</div>
|
|
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> {</div>
|
|
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">username</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">principal</a>.Identity?.Name;</div>
|
|
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">username</a> == <span class="keyword">null</span>)</div>
|
|
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> {</div>
|
|
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>.Fail(<span class="stringliteral">"Failed to retrieve user's name from retrieved claims!"</span>);</div>
|
|
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> <span class="keywordflow">return</span>;</div>
|
|
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> }</div>
|
|
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> </div>
|
|
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">username</a>.Contains(<span class="charliteral">':'</span>, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">StringComparison</a>.Ordinal))</div>
|
|
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> {</div>
|
|
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>.Fail(<span class="stringliteral">"Cannot create users with the ':' in their name!"</span>);</div>
|
|
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> <span class="keywordflow">return</span>;</div>
|
|
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> }</div>
|
|
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> </div>
|
|
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">group</a> == <span class="keyword">null</span>)</div>
|
|
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> {</div>
|
|
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>.Fail(</div>
|
|
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupId</a>.HasValue</div>
|
|
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> ? <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">$</a><span class="stringliteral">"'{groupIdClaimName}' does not point to a valid group!"</span></div>
|
|
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> : <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">missingClaimError</a>);</div>
|
|
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> <span class="keywordflow">return</span>;</div>
|
|
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> }</div>
|
|
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> </div>
|
|
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a6785a5176d17d6fa0d54da20d418e21c">logger</a>.LogInformation(<span class="stringliteral">"Registering new user '{name}' via OIDC scheme '{scheme}'"</span>, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">username</a>, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">schemeKey</a>);</div>
|
|
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> </div>
|
|
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tgsUser</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">await</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">databaseContext</a></div>
|
|
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> .<a class="code hl_property" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a9b6cb85c0616ae3076d4837f50a34d95">Users</a></div>
|
|
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> .GetTgsUser(</div>
|
|
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">dbUser</a> => <span class="keyword">new</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html">User</a></div>
|
|
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> {</div>
|
|
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> Id = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">dbUser</a>.Id!.Value,</div>
|
|
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> },</div>
|
|
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> cancellationToken);</div>
|
|
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> </div>
|
|
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> user = <span class="keyword">new</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html">User</a></div>
|
|
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> {</div>
|
|
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> CreatedAt = DateTimeOffset.UtcNow,</div>
|
|
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> CanonicalName = <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html">User</a>.<a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html#a4b139051d0d6db501e37590fa1eabf16">CanonicalizeName</a>(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">username</a>),</div>
|
|
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> Name = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">username</a>,</div>
|
|
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> CreatedById = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tgsUser</a>.Id,</div>
|
|
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_host.html#a71712cdd4f38be5482e1d08905c0c308a00d23a76e43b46dae9ec7aa9dcbebb32">Enabled</a> = <span class="keyword">true</span>,</div>
|
|
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> GroupId = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">group</a>.Id,</div>
|
|
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> OidcConnections = <span class="keyword">new</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">List<OidcConnection></a></div>
|
|
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> {</div>
|
|
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> <span class="keyword">new</span>()</div>
|
|
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> {</div>
|
|
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> SchemeKey = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">schemeKey</a>,</div>
|
|
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> ExternalUserId = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">userId</a>,</div>
|
|
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> },</div>
|
|
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> },</div>
|
|
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> PasswordHash = <span class="stringliteral">"_"</span>, <span class="comment">// This can't be hashed</span></div>
|
|
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> };</div>
|
|
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> </div>
|
|
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">databaseContext</a>.<a class="code hl_property" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a9b6cb85c0616ae3076d4837f50a34d95">Users</a>.<a class="code hl_function" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_collection.html#abd9cab598d35f6af8c789a1f01bba081">Add</a>(user);</div>
|
|
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> }</div>
|
|
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> <span class="keywordflow">else</span></div>
|
|
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> {</div>
|
|
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> user = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">connection</a>.User!;</div>
|
|
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> </div>
|
|
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> <span class="comment">// group update</span></div>
|
|
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">group</a> == <span class="keyword">null</span>)</div>
|
|
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> {</div>
|
|
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a6785a5176d17d6fa0d54da20d418e21c">logger</a>.LogDebug(<span class="stringliteral">"User {id} attempted to login via OIDC scheme '{scheme}' but had no group ID claim ('{groupClaimName}') and will be disabled"</span>, user.<a class="code hl_property" href="class_tgstation_1_1_server_1_1_api_1_1_models_1_1_entity_id.html#ae31e478e1d338b37a14565df6fd58570">Id</a>, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">schemeKey</a>, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupIdClaimName</a>);</div>
|
|
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">user.PermissionSet</a> = <span class="keyword">new</span> <a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_permission_set.html">PermissionSet</a></div>
|
|
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span> {</div>
|
|
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> <a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#affda1440f9c5e2dfcca65138d2f89a21">AdministrationRights</a> = <a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#affda1440f9c5e2dfcca65138d2f89a21">AdministrationRights</a>.None,</div>
|
|
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> <a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#af199a84ed6fe6ca557db9de91070ad79">InstanceManagerRights</a> = <a class="code hl_enumeration" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#af199a84ed6fe6ca557db9de91070ad79">InstanceManagerRights</a>.None,</div>
|
|
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> };</div>
|
|
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">user.GroupId</a> = <span class="keyword">null</span>;</div>
|
|
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">user.Enabled</a> = <span class="keyword">false</span>;</div>
|
|
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> </div>
|
|
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">tokenValidatedContext</a>.Fail(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">missingClaimError</a>);</div>
|
|
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> <span class="keywordflow">return</span>;</div>
|
|
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span> }</div>
|
|
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> </div>
|
|
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a6785a5176d17d6fa0d54da20d418e21c">logger</a>.LogDebug(<span class="stringliteral">"User {id} mapped to group {groupId} via OIDC login on scheme '{scheme}'"</span>, user.<a class="code hl_property" href="class_tgstation_1_1_server_1_1_api_1_1_models_1_1_entity_id.html#ae31e478e1d338b37a14565df6fd58570">Id</a>, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">groupId</a>, <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">schemeKey</a>);</div>
|
|
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">user.Group</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">group</a>;</div>
|
|
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span> <span class="keywordflow">if</span> (user.<a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html#ac20227cd30620c32573fa3ac4fbc4815">PermissionSet</a> != <span class="keyword">null</span>)</div>
|
|
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">databaseContext</a>.<a class="code hl_property" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a116a10cec25af41859e1fcb65f236551">PermissionSets</a>.<a class="code hl_function" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_collection.html#ad270ec18822a7a90d8fca9a75c23851a">Remove</a>(user.<a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html#ac20227cd30620c32573fa3ac4fbc4815">PermissionSet</a>);</div>
|
|
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"> 333</span> </div>
|
|
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">user.Enabled</a> = <span class="keyword">true</span>;</div>
|
|
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> }</div>
|
|
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span> </div>
|
|
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">await</a> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">databaseContext</a>.<a class="code hl_function" href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a74e123c6393ad813f997c882a22b228e">Save</a>(cancellationToken);</div>
|
|
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> }</div>
|
|
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> </div>
|
|
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">var</a> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">expires</a> = <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">principal</a>.ParseTime(<a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">JwtRegisteredClaimNames</a>.Exp);</div>
|
|
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span> </div>
|
|
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span> <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ab6f08f16e79b7a7d5d18acea67cc3fed">currentAuthenticationContext</a>.<a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context.html#a50e10a50be204ceb874bcf3e8a0f67d8">Initialize</a>(</div>
|
|
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> user,</div>
|
|
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">expires</a>,</div>
|
|
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span> <a class="code hl_enumvalue" href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">Guid</a>.NewGuid().ToString(),</div>
|
|
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</span> <span class="keyword">null</span>,</div>
|
|
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno"> 347</span> <span class="keyword">null</span>);</div>
|
|
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno"> 348</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno"> 349</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno"> 350</span>}</div>
|
|
<div class="ttc" id="aclass_i_disposable_html"><div class="ttname"><a href="class_i_disposable.html">IDisposable</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_api_1_1_api_headers_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_api_1_1_api_headers.html">Tgstation.Server.Api.ApiHeaders</a></div><div class="ttdoc">Represents the header that must be present for every server request.</div><div class="ttdef"><b>Definition</b> <a href="_api_headers_8cs_source.html#l00024">ApiHeaders.cs:25</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_api_1_1_api_headers_html_a65e7d0ba3a39c992691f7721c62c1531"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_api_1_1_api_headers.html#a65e7d0ba3a39c992691f7721c62c1531">Tgstation.Server.Api.ApiHeaders.InstanceId</a></div><div class="ttdeci">long? InstanceId</div><div class="ttdoc">The instance EntityId.Id being accessed.</div><div class="ttdef"><b>Definition</b> <a href="_api_headers_8cs_source.html#l00084">ApiHeaders.cs:84</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_api_1_1_models_1_1_entity_id_html_ae31e478e1d338b37a14565df6fd58570"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_api_1_1_models_1_1_entity_id.html#ae31e478e1d338b37a14565df6fd58570">Tgstation.Server.Api.Models.EntityId.Id</a></div><div class="ttdeci">virtual ? long Id</div><div class="ttdoc">The ID of the entity.</div><div class="ttdef"><b>Definition</b> <a href="_entity_id_8cs_source.html#l00014">EntityId.cs:14</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_models_1_1_instance_permission_set_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_instance_permission_set.html">Tgstation.Server.Host.Models.InstancePermissionSet</a></div><div class="ttdef"><b>Definition</b> <a href="_tgstation_8_server_8_host_2_models_2_instance_permission_set_8cs_source.html#l00008">InstancePermissionSet.cs:9</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_models_1_1_permission_set_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_permission_set.html">Tgstation.Server.Host.Models.PermissionSet</a></div><div class="ttdef"><b>Definition</b> <a href="_tgstation_8_server_8_host_2_models_2_permission_set_8cs_source.html#l00008">PermissionSet.cs:9</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_models_1_1_user_group_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user_group.html">Tgstation.Server.Host.Models.UserGroup</a></div><div class="ttdoc">Represents a group of Users.</div><div class="ttdef"><b>Definition</b> <a href="_tgstation_8_server_8_host_2_models_2_user_group_8cs_source.html#l00015">UserGroup.cs:16</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_models_1_1_user_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html">Tgstation.Server.Host.Models.User</a></div><div class="ttdef"><b>Definition</b> <a href="_models_2_user_8cs_source.html#l00013">User.cs:17</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_models_1_1_user_html_a4b139051d0d6db501e37590fa1eabf16"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html#a4b139051d0d6db501e37590fa1eabf16">Tgstation.Server.Host.Models.User.CanonicalizeName</a></div><div class="ttdeci">static string CanonicalizeName(string name)</div><div class="ttdoc">Change a UserName.Name into a CanonicalName.</div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_models_1_1_user_html_ac20227cd30620c32573fa3ac4fbc4815"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html#ac20227cd30620c32573fa3ac4fbc4815">Tgstation.Server.Host.Models.User.PermissionSet</a></div><div class="ttdeci">PermissionSet? PermissionSet</div><div class="ttdoc">The PermissionSet the User has, if any.</div><div class="ttdef"><b>Definition</b> <a href="_models_2_user_8cs_source.html#l00051">User.cs:51</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html">Tgstation.Server.Host.Security.AuthenticationContextFactory</a></div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00026">AuthenticationContextFactory.cs:27</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_a1bbf757c3edef49ff242e77c8ee354c6"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a1bbf757c3edef49ff242e77c8ee354c6">Tgstation.Server.Host.Security.AuthenticationContextFactory.securityConfigurationOptions</a></div><div class="ttdeci">readonly IOptionsSnapshot< SecurityConfiguration > securityConfigurationOptions</div><div class="ttdoc">The IOptionsSnapshot<TOptions> of SecurityConfiguration for the AuthenticationContextFactory.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00056">AuthenticationContextFactory.cs:56</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_a37a564f1b33b53dc2af9fb751b5a7e9b"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a37a564f1b33b53dc2af9fb751b5a7e9b">Tgstation.Server.Host.Security.AuthenticationContextFactory.CurrentAuthenticationContext</a></div><div class="ttdeci">IAuthenticationContext CurrentAuthenticationContext</div><div class="ttdoc">The IAuthenticationContext the AuthenticationContextFactory created.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00036">AuthenticationContextFactory.cs:36</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_a4f3486b694a62f17ead5bfe84d20d8e0"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a4f3486b694a62f17ead5bfe84d20d8e0">Tgstation.Server.Host.Security.AuthenticationContextFactory.databaseContext</a></div><div class="ttdeci">readonly IDatabaseContext databaseContext</div><div class="ttdoc">The IDatabaseContext for the AuthenticationContextFactory.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00041">AuthenticationContextFactory.cs:41</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_a6785a5176d17d6fa0d54da20d418e21c"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a6785a5176d17d6fa0d54da20d418e21c">Tgstation.Server.Host.Security.AuthenticationContextFactory.logger</a></div><div class="ttdeci">readonly ILogger< AuthenticationContextFactory > logger</div><div class="ttdoc">The ILogger for the AuthenticationContextFactory.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00061">AuthenticationContextFactory.cs:61</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_a85bc3078ee1cf12395ae0d4c9e0238af"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a85bc3078ee1cf12395ae0d4c9e0238af">Tgstation.Server.Host.Security.AuthenticationContextFactory.initialized</a></div><div class="ttdeci">int initialized</div><div class="ttdoc">1 if currentAuthenticationContext was initialized, 0 otherwise.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00076">AuthenticationContextFactory.cs:76</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_a94c0a91ac1bdb6d25c9546a583fb44e3"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a94c0a91ac1bdb6d25c9546a583fb44e3">Tgstation.Server.Host.Security.AuthenticationContextFactory.identityCache</a></div><div class="ttdeci">readonly IIdentityCache identityCache</div><div class="ttdoc">The IIdentityCache for the AuthenticationContextFactory.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00046">AuthenticationContextFactory.cs:46</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_a9e3b885a643bc5c2431e2e0cd4f6cbad"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#a9e3b885a643bc5c2431e2e0cd4f6cbad">Tgstation.Server.Host.Security.AuthenticationContextFactory.apiHeaders</a></div><div class="ttdeci">readonly? ApiHeaders apiHeaders</div><div class="ttdoc">The ApiHeaders for the AuthenticationContextFactory.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00071">AuthenticationContextFactory.cs:71</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_aa1e9ff0257acd2d7e79ff7784d0a2338"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#aa1e9ff0257acd2d7e79ff7784d0a2338">Tgstation.Server.Host.Security.AuthenticationContextFactory.OpenIDConnectAuthenticationSchemePrefix</a></div><div class="ttdeci">const string OpenIDConnectAuthenticationSchemePrefix</div><div class="ttdoc">Internal scheme prefix for OIDC schemes.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00031">AuthenticationContextFactory.cs:31</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_aadc5630dc46ebe24e1c479f1bf8c17f1"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#aadc5630dc46ebe24e1c479f1bf8c17f1">Tgstation.Server.Host.Security.AuthenticationContextFactory.ValidateOidcToken</a></div><div class="ttdeci">async Task ValidateOidcToken(RemoteAuthenticationContext< OpenIdConnectOptions > tokenValidatedContext, string schemeKey, string groupIdClaimName, CancellationToken cancellationToken)</div><div class="ttdoc">Handles OIDC tokenValidatedContext s.A Task representing the running operation.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00193">AuthenticationContextFactory.cs:193</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_ab6f08f16e79b7a7d5d18acea67cc3fed"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ab6f08f16e79b7a7d5d18acea67cc3fed">Tgstation.Server.Host.Security.AuthenticationContextFactory.currentAuthenticationContext</a></div><div class="ttdeci">readonly AuthenticationContext currentAuthenticationContext</div><div class="ttdoc">Backing field for CurrentAuthenticationContext.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00066">AuthenticationContextFactory.cs:66</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_aba1135484ebaa606bfad5cd2d9a948d2"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#aba1135484ebaa606bfad5cd2d9a948d2">Tgstation.Server.Host.Security.AuthenticationContextFactory.AuthenticationContextFactory</a></div><div class="ttdeci">AuthenticationContextFactory(IDatabaseContext databaseContext, IIdentityCache identityCache, IApiHeadersProvider apiHeadersProvider, IOptions< SwarmConfiguration > swarmConfigurationOptions, IOptionsSnapshot< SecurityConfiguration > securityConfigurationOptions, ILogger< AuthenticationContextFactory > logger)</div><div class="ttdoc">Initializes a new instance of the AuthenticationContextFactory class.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00087">AuthenticationContextFactory.cs:87</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_accc9334a642e563e47c5308df2d5149a"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#accc9334a642e563e47c5308df2d5149a">Tgstation.Server.Host.Security.AuthenticationContextFactory.Dispose</a></div><div class="ttdeci">void Dispose()</div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_ad4f0ff4bf15db55892865ec54079e68b"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ad4f0ff4bf15db55892865ec54079e68b">Tgstation.Server.Host.Security.AuthenticationContextFactory.swarmConfigurationOptions</a></div><div class="ttdeci">readonly IOptions< SwarmConfiguration > swarmConfigurationOptions</div><div class="ttdoc">The IOptions<TOptions> of SwarmConfiguration for the AuthenticationContextFactory.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00051">AuthenticationContextFactory.cs:51</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory_html_ae7a11f6cc136eafce06872c382a15122"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_factory.html#ae7a11f6cc136eafce06872c382a15122">Tgstation.Server.Host.Security.AuthenticationContextFactory.ValidateTgsToken</a></div><div class="ttdeci">async Task ValidateTgsToken(Microsoft.AspNetCore.Authentication.JwtBearer.TokenValidatedContext tokenValidatedContext, CancellationToken cancellationToken)</div><div class="ttdoc">Handles TGS tokenValidatedContext s.A Task representing the running operation.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_factory_8cs_source.html#l00113">AuthenticationContextFactory.cs:113</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context.html">Tgstation.Server.Host.Security.AuthenticationContext</a></div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_8cs_source.html#l00010">AuthenticationContext.cs:11</a></div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_html_a4a5a80952341c5a9e0f3a84e27734f8a"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context.html#a4a5a80952341c5a9e0f3a84e27734f8a">Tgstation.Server.Host.Security.AuthenticationContext.Dispose</a></div><div class="ttdeci">void Dispose()</div></div>
|
|
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context_html_a50e10a50be204ceb874bcf3e8a0f67d8"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_authentication_context.html#a50e10a50be204ceb874bcf3e8a0f67d8">Tgstation.Server.Host.Security.AuthenticationContext.Initialize</a></div><div class="ttdeci">void Initialize(User user, DateTimeOffset sessionExpiry, string sessionId, InstancePermissionSet? instanceUser, ISystemIdentity? systemIdentity)</div><div class="ttdoc">Initializes the AuthenticationContext.</div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_8cs_source.html#l00078">AuthenticationContext.cs:78</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_collection_html_abd9cab598d35f6af8c789a1f01bba081"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_collection.html#abd9cab598d35f6af8c789a1f01bba081">Tgstation.Server.Host.Database.IDatabaseCollection.Add</a></div><div class="ttdeci">void Add(TModel model)</div><div class="ttdoc">Add a given model to the the working set.</div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_collection_html_ad270ec18822a7a90d8fca9a75c23851a"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_collection.html#ad270ec18822a7a90d8fca9a75c23851a">Tgstation.Server.Host.Database.IDatabaseCollection.Remove</a></div><div class="ttdeci">void Remove(TModel model)</div><div class="ttdoc">Remove a given model from the the working set.</div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html">Tgstation.Server.Host.Database.IDatabaseContext</a></div><div class="ttdoc">Represents the database.</div><div class="ttdef"><b>Definition</b> <a href="_i_database_context_8cs_source.html#l00016">IDatabaseContext.cs:17</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context_html_a054072960919046eaf843990883621f0"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a054072960919046eaf843990883621f0">Tgstation.Server.Host.Database.IDatabaseContext.InstancePermissionSets</a></div><div class="ttdeci">IDatabaseCollection< InstancePermissionSet > InstancePermissionSets</div><div class="ttdoc">The InstancePermissionSets in the IDatabaseContext.</div><div class="ttdef"><b>Definition</b> <a href="_i_database_context_8cs_source.html#l00031">IDatabaseContext.cs:31</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context_html_a116a10cec25af41859e1fcb65f236551"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a116a10cec25af41859e1fcb65f236551">Tgstation.Server.Host.Database.IDatabaseContext.PermissionSets</a></div><div class="ttdeci">IDatabaseCollection< PermissionSet > PermissionSets</div><div class="ttdoc">The DbSet<TEntity> for PermissionSets.</div><div class="ttdef"><b>Definition</b> <a href="_i_database_context_8cs_source.html#l00106">IDatabaseContext.cs:106</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context_html_a719800c636e9228e8e216af51a7278aa"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a719800c636e9228e8e216af51a7278aa">Tgstation.Server.Host.Database.IDatabaseContext.OidcConnections</a></div><div class="ttdeci">IDatabaseCollection< OidcConnection > OidcConnections</div><div class="ttdoc">The DbSet<TEntity> for OidcConnections.</div><div class="ttdef"><b>Definition</b> <a href="_i_database_context_8cs_source.html#l00096">IDatabaseContext.cs:96</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context_html_a74e123c6393ad813f997c882a22b228e"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a74e123c6393ad813f997c882a22b228e">Tgstation.Server.Host.Database.IDatabaseContext.Save</a></div><div class="ttdeci">Task Save(CancellationToken cancellationToken)</div><div class="ttdoc">Saves changes made to the IDatabaseContext.</div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context_html_a85ac1c61242f1de41d483259f94e9542"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a85ac1c61242f1de41d483259f94e9542">Tgstation.Server.Host.Database.IDatabaseContext.Groups</a></div><div class="ttdeci">IDatabaseCollection< UserGroup > Groups</div><div class="ttdoc">The DbSet<TEntity> for UserGroups.</div><div class="ttdef"><b>Definition</b> <a href="_i_database_context_8cs_source.html#l00101">IDatabaseContext.cs:101</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context_html_a9b6cb85c0616ae3076d4837f50a34d95"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_database_1_1_i_database_context.html#a9b6cb85c0616ae3076d4837f50a34d95">Tgstation.Server.Host.Database.IDatabaseContext.Users</a></div><div class="ttdeci">IDatabaseCollection< User > Users</div><div class="ttdoc">The Users in the IDatabaseContext.</div><div class="ttdef"><b>Definition</b> <a href="_i_database_context_8cs_source.html#l00021">IDatabaseContext.cs:21</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_authentication_context_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_authentication_context.html">Tgstation.Server.Host.Security.IAuthenticationContext</a></div><div class="ttdoc">For creating and accessing authentication contexts.</div><div class="ttdef"><b>Definition</b> <a href="_i_authentication_context_8cs_source.html#l00011">IAuthenticationContext.cs:12</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_identity_cache_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_identity_cache.html">Tgstation.Server.Host.Security.IIdentityCache</a></div><div class="ttdoc">For caching ISystemIdentitys.</div><div class="ttdef"><b>Definition</b> <a href="_i_identity_cache_8cs_source.html#l00011">IIdentityCache.cs:12</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_identity_cache_html_afc655c9c2d6af6086bcda5b6c54e1c41"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_identity_cache.html#afc655c9c2d6af6086bcda5b6c54e1c41">Tgstation.Server.Host.Security.IIdentityCache.LoadCachedIdentity</a></div><div class="ttdeci">ISystemIdentity LoadCachedIdentity(User user)</div><div class="ttdoc">Attempt to load a cached ISystemIdentity.</div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_system_identity_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_system_identity.html">Tgstation.Server.Host.Security.ISystemIdentity</a></div><div class="ttdoc">Represents a user on the current global::System.Runtime.InteropServices.OSPlatform.</div><div class="ttdef"><b>Definition</b> <a href="_i_system_identity_8cs_source.html#l00010">ISystemIdentity.cs:11</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_token_validator_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_token_validator.html">Tgstation.Server.Host.Security.ITokenValidator</a></div><div class="ttdoc">Handles validating authentication tokens.</div><div class="ttdef"><b>Definition</b> <a href="_i_token_validator_8cs_source.html#l00012">ITokenValidator.cs:13</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_utils_1_1_i_api_headers_provider_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_utils_1_1_i_api_headers_provider.html">Tgstation.Server.Host.Utils.IApiHeadersProvider</a></div><div class="ttdoc">Provides ApiHeaders.</div><div class="ttdef"><b>Definition</b> <a href="_i_api_headers_provider_8cs_source.html#l00008">IApiHeadersProvider.cs:9</a></div></div>
|
|
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_utils_1_1_i_api_headers_provider_html_a479fc84909e81d756d193308ff2c0c78"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_utils_1_1_i_api_headers_provider.html#a479fc84909e81d756d193308ff2c0c78">Tgstation.Server.Host.Utils.IApiHeadersProvider.ApiHeaders</a></div><div class="ttdeci">ApiHeaders? ApiHeaders</div><div class="ttdoc">The created Api.ApiHeaders, if any.</div><div class="ttdef"><b>Definition</b> <a href="_i_api_headers_provider_8cs_source.html#l00013">IApiHeadersProvider.cs:13</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_api_1_1_rights_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html">Tgstation.Server.Api.Rights</a></div><div class="ttdef"><b>Definition</b> <a href="_administration_rights_8cs_source.html#l00003">AdministrationRights.cs:4</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_api_1_1_rights_html_a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#a691a59767073bc7dff0f17b809d07b0ca4ee29ca12c7d126654bd0e5275de6135">Tgstation.Server.Api.Rights.ConfigurationRights.List</a></div><div class="ttdeci">@ List</div><div class="ttdoc">User may list files if the Models.Instance allows it.</div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_api_1_1_rights_html_af199a84ed6fe6ca557db9de91070ad79"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#af199a84ed6fe6ca557db9de91070ad79">Tgstation.Server.Api.Rights.InstanceManagerRights</a></div><div class="ttdeci">InstanceManagerRights</div><div class="ttdoc">Rights for managing Models.Instances.</div><div class="ttdef"><b>Definition</b> <a href="_instance_manager_rights_8cs_source.html#l00009">InstanceManagerRights.cs:10</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_api_1_1_rights_html_affda1440f9c5e2dfcca65138d2f89a21"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_api_1_1_rights.html#affda1440f9c5e2dfcca65138d2f89a21">Tgstation.Server.Api.Rights.AdministrationRights</a></div><div class="ttdeci">AdministrationRights</div><div class="ttdoc">Administration rights for the server.</div><div class="ttdef"><b>Definition</b> <a href="_administration_rights_8cs_source.html#l00009">AdministrationRights.cs:10</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_api_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_api.html">Tgstation.Server.Api</a></div><div class="ttdef"><b>Definition</b> <a href="_api_headers_8cs_source.html#l00019">ApiHeaders.cs:20</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_configuration_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_configuration.html">Tgstation.Server.Host.Configuration</a></div><div class="ttdef"><b>Definition</b> <a href="_control_panel_configuration_8cs_source.html#l00003">ControlPanelConfiguration.cs:4</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_database_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_database.html">Tgstation.Server.Host.Database</a></div><div class="ttdef"><b>Definition</b> <a href="_database_collection_8cs_source.html#l00009">DatabaseCollection.cs:10</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_extensions_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_extensions.html">Tgstation.Server.Host.Extensions</a></div><div class="ttdef"><b>Definition</b> <a href="_application_builder_extensions_8cs_source.html#l00021">ApplicationBuilderExtensions.cs:22</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_models_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_models.html">Tgstation.Server.Host.Models</a></div><div class="ttdef"><b>Definition</b> <a href="_models_2_chat_bot_8cs_source.html#l00008">ChatBot.cs:9</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_security_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_security.html">Tgstation.Server.Host.Security</a></div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_8cs_source.html#l00007">AuthenticationContext.cs:8</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_utils_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_utils.html">Tgstation.Server.Host.Utils</a></div><div class="ttdef"><b>Definition</b> <a href="_graph_q_l_git_lab_client_8cs_source.html#l00006">GraphQLGitLabClient.cs:7</a></div></div>
|
|
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_html_a71712cdd4f38be5482e1d08905c0c308a00d23a76e43b46dae9ec7aa9dcbebb32"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host.html#a71712cdd4f38be5482e1d08905c0c308a00d23a76e43b46dae9ec7aa9dcbebb32">Tgstation.Server.Host.OAuthGatewayStatus.Enabled</a></div><div class="ttdeci">@ Enabled</div><div class="ttdoc">The OAuth Gateway is enabled.</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>
|