tgstation-server
6.16.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
src
Tgstation.Server.Host
GraphQL
Types
OAuth
OAuthProviderInfos.cs
Go to the documentation of this file.
1
using
System;
2
3
using
Tgstation.Server.Api.Models
;
4
using
Tgstation.Server.Host.Security.OAuth
;
5
6
namespace
Tgstation.Server.Host.GraphQL.Types.OAuth
7
{
11
public
sealed
class
OAuthProviderInfos
12
{
16
public
BasicOAuthProviderInfo
?
Discord
{
get
; }
17
21
public
RedirectOAuthProviderInfo
?
GitHub
{
get
; }
22
27
public
OAuthProviderInfos
(
IOAuthProviders
oAuthProviders)
28
{
29
ArgumentNullException.ThrowIfNull(oAuthProviders);
30
31
var dic = oAuthProviders.
ProviderInfos
();
32
33
TProviderInfo? TryBuild<TProviderInfo>(
OAuthProvider
oAuthProvider, Func<OAuthProviderInfo, TProviderInfo> contructor)
34
where TProviderInfo :
BasicOAuthProviderInfo
35
{
36
if
(dic.TryGetValue(oAuthProvider, out var providerInfo))
37
{
38
return
contructor(providerInfo);
39
}
40
41
return
null
;
42
}
43
44
Discord
= TryBuild(
OAuthProvider
.Discord, info =>
new
BasicOAuthProviderInfo
(info));
45
GitHub
= TryBuild(
OAuthProvider
.GitHub, info =>
new
RedirectOAuthProviderInfo
(info));
46
}
47
}
48
}
Tgstation.Server.Host.GraphQL.Types.OAuth.BasicOAuthProviderInfo
Basic OAuth provider info.
Definition
BasicOAuthProviderInfo.cs:11
Tgstation.Server.Host.GraphQL.Types.OAuth.OAuthProviderInfos
Description of configured OAuth services.
Definition
OAuthProviderInfos.cs:12
Tgstation.Server.Host.GraphQL.Types.OAuth.OAuthProviderInfos.OAuthProviderInfos
OAuthProviderInfos(IOAuthProviders oAuthProviders)
Initializes a new instance of the OAuthProviderInfos class.
Definition
OAuthProviderInfos.cs:27
Tgstation.Server.Host.GraphQL.Types.OAuth.OAuthProviderInfos.Discord
BasicOAuthProviderInfo? Discord
https://discord.com.
Definition
OAuthProviderInfos.cs:16
Tgstation.Server.Host.GraphQL.Types.OAuth.OAuthProviderInfos.GitHub
RedirectOAuthProviderInfo? GitHub
https://github.com.
Definition
OAuthProviderInfos.cs:21
Tgstation.Server.Host.GraphQL.Types.OAuth.RedirectOAuthProviderInfo
OAuth provider info with a RedirectUri.
Definition
RedirectOAuthProviderInfo.cs:11
Tgstation.Server.Host.Security.OAuth.IOAuthProviders
Contains IOAuthValidators.
Definition
IOAuthProviders.cs:11
Tgstation.Server.Host.Security.OAuth.IOAuthProviders.ProviderInfos
Dictionary< OAuthProvider, OAuthProviderInfo > ProviderInfos()
Gets a Dictionary<TKey, TValue> of the provider client IDs.
Tgstation.Server.Api.Models
Definition
ChatChannel.cs:6
Tgstation.Server.Api.Models.OAuthProvider
OAuthProvider
List of OAuth2.0 providers supported by TGS that do not support OIDC.
Definition
OAuthProvider.cs:13
Tgstation.Server.Host.GraphQL.Types.OAuth
Definition
BasicOAuthProviderInfo.cs:6
Tgstation.Server.Host.Security.OAuth
Definition
DiscordOAuthValidator.cs:10
Generated by
1.9.8