tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
GatewayInformation.cs
Go to the documentation of this file.
1using System;
3
4using HotChocolate;
5
7
18
20{
24 public sealed class GatewayInformation
25 {
33 [Service] IOptionsSnapshot<GeneralConfiguration> generalConfigurationOptions)
34 {
35 ArgumentNullException.ThrowIfNull(generalConfigurationOptions);
36 return generalConfigurationOptions.Value.MinimumPasswordLength;
37 }
38
45 public uint InstanceLimit(
46 [Service] IOptionsSnapshot<GeneralConfiguration> generalConfigurationOptions)
47 {
48 ArgumentNullException.ThrowIfNull(generalConfigurationOptions);
49 return generalConfigurationOptions.Value.InstanceLimit;
50 }
51
59 public uint UserLimit(
60 [Service] IOptionsSnapshot<GeneralConfiguration> generalConfigurationOptions)
61 {
62 ArgumentNullException.ThrowIfNull(generalConfigurationOptions);
63 return generalConfigurationOptions.Value.UserLimit;
64 }
65
73 public uint UserGroupLimit(
74 [Service] IOptionsSnapshot<GeneralConfiguration> generalConfigurationOptions)
75 {
76 ArgumentNullException.ThrowIfNull(generalConfigurationOptions);
77 return generalConfigurationOptions.Value.UserGroupLimit;
78 }
79
87 [Service] IOptionsSnapshot<GeneralConfiguration> generalConfigurationOptions)
88 {
89 ArgumentNullException.ThrowIfNull(generalConfigurationOptions);
90 return generalConfigurationOptions.Value.ValidInstancePaths;
91 }
92
99 public bool WindowsHost(
100 [Service] IPlatformIdentifier platformIdentifier)
101 {
102 ArgumentNullException.ThrowIfNull(platformIdentifier);
103 return platformIdentifier.IsWindows;
104 }
105
111
119 [Service] IAssemblyInformationProvider assemblyInformationProvider)
120 {
121 ArgumentNullException.ThrowIfNull(assemblyInformationProvider);
122 return assemblyInformationProvider.Version;
123 }
124
129
135
141
147
154 [Service] IOAuthProviders oAuthProviders)
155 {
156 ArgumentNullException.ThrowIfNull(oAuthProviders);
157 return new OAuthProviderInfos(oAuthProviders);
158 }
159 }
160}
Represents the header that must be present for every server request.
Definition ApiHeaders.cs:25
static readonly Version Version
Get the version of the Api the caller is using.
Definition ApiHeaders.cs:69
Constants used for communication with the DMAPI.
static readonly Version InteropVersion
The DMAPI InteropVersion being used.
Represents information about a SwarmNode retrieved via a Interfaces.IGateway.
Version DMApiVersion
Gets the DMAPI interop global::System.Version the SwarmNode uses.
Version Version([Service] IAssemblyInformationProvider assemblyInformationProvider)
Gets the global::System.Version of tgstation-server the SwarmNode is running.
IReadOnlyCollection< string >? ValidInstancePaths([Service] IOptionsSnapshot< GeneralConfiguration > generalConfigurationOptions)
Gets the locations Instances may be created or attached from if there are restrictions.
Version ApiVersion
Gets the REST API global::System.Version of the SwarmNode.
Version GraphQLApiVersion
Gets the GraphQL API global::System.Version of the SwarmNode.
uint MinimumPasswordLength([Service] IOptionsSnapshot< GeneralConfiguration > generalConfigurationOptions)
Gets the minimum valid password length for TGS users.
uint InstanceLimit([Service] IOptionsSnapshot< GeneralConfiguration > generalConfigurationOptions)
Gets the maximum allowed attached instances for the SwarmNode.
uint UserLimit([Service] IOptionsSnapshot< GeneralConfiguration > generalConfigurationOptions)
Gets the maximum allowed registered Users for the ServerSwarm.
int MajorGraphQLApiVersion
Gets the major GraphQL API global::System.Version number of the SwarmNode.
Version SwarmProtocolVersion
Gets the swarm protocol Version.
bool WindowsHost([Service] IPlatformIdentifier platformIdentifier)
Gets a flag indicating whether or not the current SwarmNode runs on a Windows operating system.
OAuthProviderInfos OAuthProviderInfos([Service] IOAuthProviders oAuthProviders)
Gets the information needed to perform open authentication with the SwarmNode.
uint UserGroupLimit([Service] IOptionsSnapshot< GeneralConfiguration > generalConfigurationOptions)
Gets the maximum allowed registered UserGroups for the ServerSwarm.
Attribute for bringing in the master versions list from MSBuild that aren't embedded into assemblies ...
string RawGraphQLVersion
The Version string of the TGS GraphQL API.
string RawSwarmProtocolVersion
The Version string of the TGS swarm protocol.
static MasterVersionsAttribute Instance
Return the Assembly's instance of the MasterVersionsAttribute.
For identifying the current platform.
@ List
User may list files if the Models.Instance allows it.
InstanceManagerRights
Rights for managing Models.Instances.
AdministrationRights
Administration rights for the server.