diff --git a/.dockerignore b/.dockerignore
index 1dfe466b59..2339718e2d 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,4 +1,5 @@
.dockerignore
+!build/analyzers.ruleset
.git
.gitignore
.vs
diff --git a/build/analyzers.ruleset b/build/analyzers.ruleset
new file mode 100644
index 0000000000..c3d0f539a2
--- /dev/null
+++ b/build/analyzers.ruleset
@@ -0,0 +1,1197 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Tgstation.Server.Api/ApiHeaders.cs b/src/Tgstation.Server.Api/ApiHeaders.cs
index bf1c1cbb08..949fc5aaf4 100644
--- a/src/Tgstation.Server.Api/ApiHeaders.cs
+++ b/src/Tgstation.Server.Api/ApiHeaders.cs
@@ -1,12 +1,12 @@
-using System;
+using Microsoft.AspNetCore.Http.Headers;
+using Microsoft.Extensions.Primitives;
+using Microsoft.Net.Http.Headers;
+using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net.Http.Headers;
using System.Reflection;
-using Microsoft.AspNetCore.Http.Headers;
-using Microsoft.Net.Http.Headers;
-using Microsoft.Extensions.Primitives;
namespace Tgstation.Server.Api
{
@@ -28,32 +28,32 @@ namespace Tgstation.Server.Api
///
/// The header key
///
- const string usernameHeader = "Username";
+ const string UsernameHeader = "Username";
///
/// The header key
///
- const string instanceIdHeader = "Instance";
+ const string InstanceIdHeader = "Instance";
///
/// The JWT authentication header scheme
///
- const string jwtAuthenticationScheme = "Bearer";
+ const string JwtAuthenticationScheme = "Bearer";
///
/// The password authentication header scheme
///
- const string passwordAuthenticationScheme = "Password";
+ const string PasswordAuthenticationScheme = "Password";
///
- /// The current
+ /// The current
///
- static readonly AssemblyName assemblyName = Assembly.GetExecutingAssembly().GetName();
+ static readonly AssemblyName AssemblyName = Assembly.GetExecutingAssembly().GetName();
///
/// Get the version of the the caller is using
///
- public static Version Version => assemblyName.Version;
+ public static Version Version => AssemblyName.Version;
///
/// The being accessed
@@ -139,12 +139,12 @@ namespace Tgstation.Server.Api
if (!requestHeaders.Headers.TryGetValue(HeaderNames.UserAgent, out var userAgentValues) || !ProductInfoHeaderValue.TryParse(userAgentValues.FirstOrDefault(), out var clientUserAgent))
throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, "Missing {0} headers!", HeaderNames.UserAgent));
- //assure the client user agent has a name and version
+ // assure the client user agent has a name and version
if (String.IsNullOrWhiteSpace(clientUserAgent.Product.Name) || !Version.TryParse(clientUserAgent.Product.Version, out var clientVersion))
throw new InvalidOperationException("Malformed client user agent!");
- //make sure the api header matches ours
- if (!requestHeaders.Headers.TryGetValue(ApiVersionHeader, out var apiUserAgentHeaderValues) || !ProductInfoHeaderValue.TryParse(apiUserAgentHeaderValues.FirstOrDefault(), out var apiUserAgent) || apiUserAgent.Product.Name != assemblyName.Name)
+ // make sure the api header matches ours
+ if (!requestHeaders.Headers.TryGetValue(ApiVersionHeader, out var apiUserAgentHeaderValues) || !ProductInfoHeaderValue.TryParse(apiUserAgentHeaderValues.FirstOrDefault(), out var apiUserAgent) || apiUserAgent.Product.Name != AssemblyName.Name)
throw new InvalidOperationException("Missing API version!");
if (!Version.TryParse(apiUserAgent.Product.Version, out var apiVersion))
@@ -166,7 +166,7 @@ namespace Tgstation.Server.Api
if (String.IsNullOrEmpty(parameter))
throw new InvalidOperationException("Missing authentication parameter!");
- if (requestHeaders.Headers.TryGetValue(instanceIdHeader, out var instanceIdValues))
+ if (requestHeaders.Headers.TryGetValue(InstanceIdHeader, out var instanceIdValues))
{
var instanceIdString = instanceIdValues.FirstOrDefault();
if (instanceIdString != default && Int64.TryParse(instanceIdString, out var instanceId))
@@ -175,17 +175,18 @@ namespace Tgstation.Server.Api
switch (scheme)
{
- case jwtAuthenticationScheme:
+ case JwtAuthenticationScheme:
Token = parameter;
break;
- case passwordAuthenticationScheme:
+ case PasswordAuthenticationScheme:
Password = parameter;
- var fail = !requestHeaders.Headers.TryGetValue(usernameHeader, out var values);
+ var fail = !requestHeaders.Headers.TryGetValue(UsernameHeader, out var values);
if (!fail)
{
Username = values.FirstOrDefault();
fail = String.IsNullOrWhiteSpace(Username);
}
+
if (fail)
throw new InvalidOperationException("Missing Username header!");
break;
@@ -231,17 +232,18 @@ namespace Tgstation.Server.Api
headers.Clear();
headers.Accept.Add(new MediaTypeWithQualityHeaderValue(ApplicationJson));
if (IsTokenAuthentication)
- headers.Authorization = new AuthenticationHeaderValue(jwtAuthenticationScheme, Token);
+ headers.Authorization = new AuthenticationHeaderValue(JwtAuthenticationScheme, Token);
else
{
- headers.Authorization = new AuthenticationHeaderValue(passwordAuthenticationScheme, Password);
- headers.Add(usernameHeader, Username);
+ headers.Authorization = new AuthenticationHeaderValue(PasswordAuthenticationScheme, Password);
+ headers.Add(UsernameHeader, Username);
}
+
headers.UserAgent.Add(new ProductInfoHeaderValue(UserAgent));
- headers.Add(ApiVersionHeader, new ProductHeaderValue(assemblyName.Name, ApiVersion.ToString()).ToString());
+ headers.Add(ApiVersionHeader, new ProductHeaderValue(AssemblyName.Name, ApiVersion.ToString()).ToString());
instanceId = instanceId ?? InstanceId;
if (instanceId.HasValue)
- headers.Add(instanceIdHeader, instanceId.ToString());
+ headers.Add(InstanceIdHeader, instanceId.ToString());
}
}
}
diff --git a/src/Tgstation.Server.Api/Models/Administration.cs b/src/Tgstation.Server.Api/Models/Administration.cs
index 71eaba974b..01c0dcf9ac 100644
--- a/src/Tgstation.Server.Api/Models/Administration.cs
+++ b/src/Tgstation.Server.Api/Models/Administration.cs
@@ -2,7 +2,9 @@
namespace Tgstation.Server.Api.Models
{
- ///
+ ///
+ /// Represents administrative server information
+ ///
public sealed class Administration
{
///
diff --git a/src/Tgstation.Server.Api/Models/ChatProvider.cs b/src/Tgstation.Server.Api/Models/ChatProvider.cs
index f41d9de9c5..4fb3e90902 100644
--- a/src/Tgstation.Server.Api/Models/ChatProvider.cs
+++ b/src/Tgstation.Server.Api/Models/ChatProvider.cs
@@ -9,6 +9,7 @@
/// Internet relay chat
///
Irc,
+
///
/// Superior chat service
///
diff --git a/src/Tgstation.Server.Api/Models/ConfigurationFile.cs b/src/Tgstation.Server.Api/Models/ConfigurationFile.cs
index bbacc2e3ba..cddaa5eecf 100644
--- a/src/Tgstation.Server.Api/Models/ConfigurationFile.cs
+++ b/src/Tgstation.Server.Api/Models/ConfigurationFile.cs
@@ -28,6 +28,8 @@
///
/// The content of the . Will be if is or during listing and write operations
///
+#pragma warning disable CA1819 // Properties should not return arrays
public byte[] Content { get; set; }
+#pragma warning restore CA1819 // Properties should not return arrays
}
}
diff --git a/src/Tgstation.Server.Api/Models/ConfigurationType.cs b/src/Tgstation.Server.Api/Models/ConfigurationType.cs
index d322e79a75..350af0c36f 100644
--- a/src/Tgstation.Server.Api/Models/ConfigurationType.cs
+++ b/src/Tgstation.Server.Api/Models/ConfigurationType.cs
@@ -9,10 +9,12 @@
/// Configuration editing is not allowed
///
Disallowed,
+
///
/// Configuration editing is allowed by all users on all files
///
HostWrite,
+
///
/// Co
///
diff --git a/src/Tgstation.Server.Api/Models/DreamDaemonSecurity.cs b/src/Tgstation.Server.Api/Models/DreamDaemonSecurity.cs
index 68804af41b..8f6b1f0f26 100644
--- a/src/Tgstation.Server.Api/Models/DreamDaemonSecurity.cs
+++ b/src/Tgstation.Server.Api/Models/DreamDaemonSecurity.cs
@@ -9,10 +9,12 @@
/// Server is unrestricted in terms of file access and shell commands
///
Trusted,
+
///
/// Server will not be able to run shell commands or access files outside it's working directory
///
Safe,
+
///
/// Server will not be able to run shell commands or access anything but temporary files. Currently unsupported!
///
diff --git a/src/Tgstation.Server.Api/Models/DreamDaemonStatus.cs b/src/Tgstation.Server.Api/Models/DreamDaemonStatus.cs
index a09c75d399..413a3e8586 100644
--- a/src/Tgstation.Server.Api/Models/DreamDaemonStatus.cs
+++ b/src/Tgstation.Server.Api/Models/DreamDaemonStatus.cs
@@ -11,10 +11,12 @@
/// Server is not running
///
Offline,
+
///
/// Server is being rebooted
///
HardRebooting,
+
///
/// Server is running
///
diff --git a/src/Tgstation.Server.Api/Models/Internal/RevisionInformation.cs b/src/Tgstation.Server.Api/Models/Internal/RevisionInformation.cs
index e1331a1029..312f5812d1 100644
--- a/src/Tgstation.Server.Api/Models/Internal/RevisionInformation.cs
+++ b/src/Tgstation.Server.Api/Models/Internal/RevisionInformation.cs
@@ -10,13 +10,15 @@ namespace Tgstation.Server.Api.Models.Internal
///
/// The revision sha
///
- [Required, StringLength(40)]
+ [Required]
+ [StringLength(40)]
public string CommitSha { get; set; }
///
/// The sha of the most recent remote commit
///
- [Required, StringLength(40)]
+ [Required]
+ [StringLength(40)]
public string OriginCommitSha { get; set; }
}
}
diff --git a/src/Tgstation.Server.Api/Models/IrcConnectionStringBuilder.cs b/src/Tgstation.Server.Api/Models/IrcConnectionStringBuilder.cs
index 55df172e51..8f4534f0c5 100644
--- a/src/Tgstation.Server.Api/Models/IrcConnectionStringBuilder.cs
+++ b/src/Tgstation.Server.Api/Models/IrcConnectionStringBuilder.cs
@@ -87,6 +87,8 @@ namespace Tgstation.Server.Api.Models
case IrcPasswordType.Server:
PasswordType = passwordType;
break;
+ default:
+ break;
}
if (splits.Length < 6)
@@ -116,6 +118,7 @@ namespace Tgstation.Server.Api.Models
sb.Append(';');
sb.Append(Password);
}
+
return sb.ToString();
}
}
diff --git a/src/Tgstation.Server.Api/Models/IrcPasswordType.cs b/src/Tgstation.Server.Api/Models/IrcPasswordType.cs
index bb3451bfbd..4c612f618a 100644
--- a/src/Tgstation.Server.Api/Models/IrcPasswordType.cs
+++ b/src/Tgstation.Server.Api/Models/IrcPasswordType.cs
@@ -9,10 +9,12 @@
/// Use server authentication
///
Server,
+
///
/// Use PLAIN sasl authentication
///
Sasl,
+
///
/// Use NickServ authentication
///
diff --git a/src/Tgstation.Server.Api/Rights/AdministrationRights.cs b/src/Tgstation.Server.Api/Rights/AdministrationRights.cs
index 84c93c4cb3..1d175b25db 100644
--- a/src/Tgstation.Server.Api/Rights/AdministrationRights.cs
+++ b/src/Tgstation.Server.Api/Rights/AdministrationRights.cs
@@ -12,22 +12,27 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
///
None = 0,
+
///
/// User can edit themself and other s and also create others
///
WriteUsers = 1,
+
///
/// User can gracefully restart the host
///
RestartHost = 2,
+
///
/// User can change
///
ChangeVersion = 4,
+
///
/// User can change their password
///
EditOwnPassword = 8,
+
///
/// User can read info and rights of other users
///
diff --git a/src/Tgstation.Server.Api/Rights/ByondRights.cs b/src/Tgstation.Server.Api/Rights/ByondRights.cs
index 4cf795d352..f6642164c7 100644
--- a/src/Tgstation.Server.Api/Rights/ByondRights.cs
+++ b/src/Tgstation.Server.Api/Rights/ByondRights.cs
@@ -12,18 +12,22 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
///
None = 0,
+
///
/// User may check the active installed BYOND version
///
ReadActive = 1,
+
///
/// User may list all installed BYOND versions
///
ListInstalled = 2,
+
///
/// User may change the active BYOND version
///
ChangeVersion = 4,
+
///
/// User may cancel version installations
///
diff --git a/src/Tgstation.Server.Api/Rights/ChatBotRights.cs b/src/Tgstation.Server.Api/Rights/ChatBotRights.cs
index b993335c3c..11572bb0b1 100644
--- a/src/Tgstation.Server.Api/Rights/ChatBotRights.cs
+++ b/src/Tgstation.Server.Api/Rights/ChatBotRights.cs
@@ -12,38 +12,47 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
///
None = 0,
+
///
/// User can change
///
WriteEnabled = 1,
+
///
/// User can change
///
WriteProvider = 2,
+
///
/// User can change
///
WriteChannels = 4,
+
///
/// User can change
///
WriteConnectionString = 8,
+
///
/// User can read requires
///
ReadConnectionString = 16,
+
///
/// User can read all chat settings except
///
Read = 32,
+
///
/// User can create new
///
Create = 64,
+
///
/// User can delete
///
Delete = 128,
+
///
/// User can change
///
diff --git a/src/Tgstation.Server.Api/Rights/ConfigurationRights.cs b/src/Tgstation.Server.Api/Rights/ConfigurationRights.cs
index c05a40923b..774fa68bd9 100644
--- a/src/Tgstation.Server.Api/Rights/ConfigurationRights.cs
+++ b/src/Tgstation.Server.Api/Rights/ConfigurationRights.cs
@@ -12,18 +12,22 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
///
None = 0,
+
///
/// User may read files
///
Read = 1,
+
///
/// User may write files
///
Write = 2,
+
///
/// User may list files
///
List = 4,
+
///
/// User may delete empty folders
///
diff --git a/src/Tgstation.Server.Api/Rights/DreamDaemonRights.cs b/src/Tgstation.Server.Api/Rights/DreamDaemonRights.cs
index b9a950b3f0..fc07682e1b 100644
--- a/src/Tgstation.Server.Api/Rights/DreamDaemonRights.cs
+++ b/src/Tgstation.Server.Api/Rights/DreamDaemonRights.cs
@@ -12,50 +12,62 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
///
None = 0,
+
///
/// User can read and
///
ReadRevision = 1,
+
///
/// User can change both primary and secondary ports
///
SetPorts = 2,
+
///
/// User can change
///
SetAutoStart = 4,
+
///
/// User set
///
SetSecurity = 8,
+
///
/// User can read all ports, , , , , and
///
ReadMetadata = 16,
+
///
/// User can change
///
SetWebClient = 32,
+
///
/// User can enable
///
SoftRestart = 64,
+
///
/// User can enable
///
SoftShutdown = 128,
+
///
/// User can immediately restart
///
Restart = 256,
+
///
/// User can immediately shutdown
///
Shutdown = 512,
+
///
/// User can start and disable and
///
Start = 1024,
+
///
/// User can change
///
diff --git a/src/Tgstation.Server.Api/Rights/DreamMakerRights.cs b/src/Tgstation.Server.Api/Rights/DreamMakerRights.cs
index e9b04645f4..e92f6bfcd3 100644
--- a/src/Tgstation.Server.Api/Rights/DreamMakerRights.cs
+++ b/src/Tgstation.Server.Api/Rights/DreamMakerRights.cs
@@ -12,30 +12,37 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
///
None = 0,
+
///
/// User may read status
///
Read = 1,
+
///
/// User may trigger compiles
///
Compile = 2,
+
///
/// User may cancel compiles
///
CancelCompile = 4,
+
///
/// User may modify
///
SetDme = 8,
+
///
/// User may modify
///
SetApiValidationPort = 16,
+
///
/// User may list and read all s
///
CompileJobs = 32,
+
///
/// User may modify
///
diff --git a/src/Tgstation.Server.Api/Rights/InstanceManagerRights.cs b/src/Tgstation.Server.Api/Rights/InstanceManagerRights.cs
index 552af89b45..1961b81d13 100644
--- a/src/Tgstation.Server.Api/Rights/InstanceManagerRights.cs
+++ b/src/Tgstation.Server.Api/Rights/InstanceManagerRights.cs
@@ -12,38 +12,47 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
///
None = 0,
+
///
/// User can view s which they have any rights for
///
Read = 1,
+
///
/// User can create s
///
Create = 2,
+
///
/// User can rename s they can view
///
Rename = 4,
+
///
/// User can relocate s they can view
///
Relocate = 8,
+
///
/// User can online s they can view
///
SetOnline = 16,
+
///
/// User can delete s they can view
///
Delete = 32,
+
///
/// User can view all s
///
List = 64,
+
///
/// User can change
///
SetConfiguration = 128,
+
///
/// User can change
///
diff --git a/src/Tgstation.Server.Api/Rights/InstanceUserRights.cs b/src/Tgstation.Server.Api/Rights/InstanceUserRights.cs
index b3860cc36d..a32ee62016 100644
--- a/src/Tgstation.Server.Api/Rights/InstanceUserRights.cs
+++ b/src/Tgstation.Server.Api/Rights/InstanceUserRights.cs
@@ -12,14 +12,17 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
///
None = 0,
+
///
/// Allow read access to for the
///
ReadUsers = 1,
+
///
/// Allow write and delete access to for the
///
WriteUsers = 2,
+
///
/// Allow adding additional to the
///
diff --git a/src/Tgstation.Server.Api/Rights/RepositoryRights.cs b/src/Tgstation.Server.Api/Rights/RepositoryRights.cs
index 2729f72ae0..65639a5b3d 100644
--- a/src/Tgstation.Server.Api/Rights/RepositoryRights.cs
+++ b/src/Tgstation.Server.Api/Rights/RepositoryRights.cs
@@ -12,54 +12,67 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
///
None = 0,
+
///
/// User may cancel synchronize operations
///
CancelPendingChanges = 1,
+
///
/// User may create the if it does not exist
///
SetOrigin = 2,
+
///
/// User may directly set the sha the 's HEAD points to
///
SetSha = 4,
+
///
/// User may fetch and merge GitHub pull requests
///
MergePullRequest = 8,
+
///
/// User may use the update feature
///
UpdateBranch = 16,
+
///
/// User may change and
///
ChangeCommitter = 32,
+
///
/// User may change
///
ChangeTestMergeCommits = 64,
+
///
/// User may read and change and
///
ChangeCredentials = 128,
+
///
/// User may set to another git reference (not a SHA)
///
SetReference = 256,
+
///
/// User may read all fields in the with the exception of
///
Read = 512,
+
///
/// User may change and
///
ChangeAutoUpdateSettings = 1024,
+
///
/// User may delete the
///
Delete = 2048,
+
///
/// User may cancel clone operations
///
diff --git a/src/Tgstation.Server.Api/Rights/RightsHelper.cs b/src/Tgstation.Server.Api/Rights/RightsHelper.cs
index bf062d81e7..6df923331e 100644
--- a/src/Tgstation.Server.Api/Rights/RightsHelper.cs
+++ b/src/Tgstation.Server.Api/Rights/RightsHelper.cs
@@ -12,11 +12,10 @@ namespace Tgstation.Server.Api.Rights
///
/// Map of s to their respective flag s
///
- static readonly IReadOnlyDictionary typeMap = new Dictionary
+ static readonly IReadOnlyDictionary TypeMap = new Dictionary
{
{ RightsType.Administration, typeof(AdministrationRights) },
{ RightsType.InstanceManager, typeof(InstanceManagerRights) },
-
{ RightsType.Repository, typeof(RepositoryRights) },
{ RightsType.Byond, typeof(ByondRights) },
{ RightsType.DreamMaker, typeof(DreamMakerRights) },
@@ -31,7 +30,7 @@ namespace Tgstation.Server.Api.Rights
///
/// The to lookup
/// The of the given
- public static Type RightToType(RightsType rightsType) => typeMap[rightsType];
+ public static Type RightToType(RightsType rightsType) => TypeMap[rightsType];
///
/// Gets the role claim name used for a given
@@ -47,7 +46,8 @@ namespace Tgstation.Server.Api.Rights
foreach (Enum J in Enum.GetValues(right.GetType()))
if (Convert.ToInt32(J, CultureInfo.InvariantCulture) != 0 && right.HasFlag(J))
yield return String.Concat(typeof(TRight).Name, '.', J.ToString());
- };
+ }
+
var names = GetRoleNames();
return String.Join(",", names);
}
@@ -60,7 +60,7 @@ namespace Tgstation.Server.Api.Rights
/// A representing the claim role name
public static string RoleName(RightsType rightsType, Enum right)
{
- var enumType = typeMap[rightsType];
+ var enumType = TypeMap[rightsType];
return String.Concat(enumType.Name, '.', Enum.GetName(enumType, right));
}
diff --git a/src/Tgstation.Server.Api/Rights/RightsType.cs b/src/Tgstation.Server.Api/Rights/RightsType.cs
index 5ebd1948e3..a541c5048f 100644
--- a/src/Tgstation.Server.Api/Rights/RightsType.cs
+++ b/src/Tgstation.Server.Api/Rights/RightsType.cs
@@ -9,34 +9,42 @@
///
///
Administration,
+
///
///
///
InstanceManager,
+
///
///
///
Repository,
+
///
///
///
Byond,
+
///
///
///
DreamMaker,
+
///
///
///
DreamDaemon,
+
///
///
///
ChatBots,
+
///
///
///
Configuration,
+
///
///
///
diff --git a/src/Tgstation.Server.Api/Tgstation.Server.Api.csproj b/src/Tgstation.Server.Api/Tgstation.Server.Api.csproj
index b8bc1dccf0..d4566a2d4f 100644
--- a/src/Tgstation.Server.Api/Tgstation.Server.Api.csproj
+++ b/src/Tgstation.Server.Api/Tgstation.Server.Api.csproj
@@ -18,19 +18,19 @@
json web api tgstation-server tgstation ss13 byond
Initial release
4.0.0.0
+ ../../build/analyzers.ruleset
+ latest
- latest
true
bin\Release\netstandard2.0\Tgstation.Server.Api.xml
- 1701;1702;1705;CA2227;CA1819;CA1028
+ 1701;1702;CA1028
- latest
- 1701;1702;1705;CA2227;CA1819;CA1028
+ 1701;1702;SA1652;CA1028
@@ -39,7 +39,10 @@
all
compile; build; native; contentfiles; analyzers
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
-
diff --git a/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj b/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj
index a3fb7a256e..e59a84d3da 100644
--- a/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj
+++ b/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj
@@ -18,18 +18,18 @@
json web api tgstation-server tgstation ss13 byond client
Added the ability to change the Token of IServerClient
2018
+ ../../build/analyzers.ruleset
+ latest
- latest
true
bin\Release\netstandard2.0\Tgstation.Server.Client.xml
- 0
- latest
+ 1701;1702;SA1652
@@ -38,6 +38,10 @@
compile; build; native; contentfiles; analyzers
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
diff --git a/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj b/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj
index d181d5f605..d007c3675a 100644
--- a/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj
+++ b/src/Tgstation.Server.Host.Console/Tgstation.Server.Host.Console.csproj
@@ -5,17 +5,18 @@
netcoreapp2.1
Full
4.0.1.4
+ ../../build/analyzers.ruleset
+ latest
- latest
true
bin\Release\netcoreapp2.1\Tgstation.Server.Host.Console.xml
- latest
+ 1701;1702;SA1652
@@ -24,6 +25,10 @@
compile; build; native; contentfiles; analyzers
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
diff --git a/src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj b/src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj
index c259de621b..f697563016 100644
--- a/src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj
+++ b/src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj
@@ -26,33 +26,31 @@
false
false
true
+ latest
+ 4
+ ../../build/analyzers.ruleset
+ true
+ AnyCPU
- AnyCPU
true
full
false
bin\Debug\
DEBUG;TRACE
prompt
- 4
- latest
- true
- AllRules.ruleset
+
+ SA1652
- AnyCPU
pdbonly
true
bin\Release\
TRACE
prompt
- 4
- latest
true
bin\Release\Tgstation.Server.Host.Service.xml
- true
- AllRules.ruleset
+
Tgstation.Server.Host.Service.Program
@@ -104,6 +102,10 @@
2.1.1
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
\ No newline at end of file
diff --git a/src/Tgstation.Server.Host.Watchdog/Tgstation.Server.Host.Watchdog.csproj b/src/Tgstation.Server.Host.Watchdog/Tgstation.Server.Host.Watchdog.csproj
index ec75cc5b0d..c463b20bc6 100644
--- a/src/Tgstation.Server.Host.Watchdog/Tgstation.Server.Host.Watchdog.csproj
+++ b/src/Tgstation.Server.Host.Watchdog/Tgstation.Server.Host.Watchdog.csproj
@@ -5,17 +5,18 @@
Full
false
4.0.1.4
+ ../../build/analyzers.ruleset
+ latest
- latest
true
bin\Release\netstandard2.0\Tgstation.Server.Host.Watchdog.xml
- latest
+ 1701;1702;SA1652
@@ -24,6 +25,10 @@
compile; build; native; contentfiles; analyzers
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
diff --git a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj
index a52ca184ad..e094b2f28a 100644
--- a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj
+++ b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj
@@ -4,19 +4,18 @@
netcoreapp2.1
Full
4.0.1.4
+ latest
+ ../../build/analyzers.ruleset
- latest
true
bin\Release\netcoreapp2.1\Tgstation.Server.Host.xml
- 1701;1702;1705;CA2227
- latest
- 1701;1702;1705;CA2227
+ 1701;1702;SA1652
@@ -47,6 +46,10 @@
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
diff --git a/tests/Tgstation.Server.Api.Tests/Tgstation.Server.Api.Tests.csproj b/tests/Tgstation.Server.Api.Tests/Tgstation.Server.Api.Tests.csproj
index 1ec7f54612..fd32c0dc52 100644
--- a/tests/Tgstation.Server.Api.Tests/Tgstation.Server.Api.Tests.csproj
+++ b/tests/Tgstation.Server.Api.Tests/Tgstation.Server.Api.Tests.csproj
@@ -7,6 +7,14 @@
latest
+
+
+
+
+
+
+
+
diff --git a/tests/Tgstation.Server.Client.Tests/Tgstation.Server.Client.Tests.csproj b/tests/Tgstation.Server.Client.Tests/Tgstation.Server.Client.Tests.csproj
index 4041253f61..29891d93e0 100644
--- a/tests/Tgstation.Server.Client.Tests/Tgstation.Server.Client.Tests.csproj
+++ b/tests/Tgstation.Server.Client.Tests/Tgstation.Server.Client.Tests.csproj
@@ -7,6 +7,14 @@
latest
+
+
+
+
+
+
+
+
diff --git a/tests/Tgstation.Server.Host.Console.Tests/Tgstation.Server.Host.Console.Tests.csproj b/tests/Tgstation.Server.Host.Console.Tests/Tgstation.Server.Host.Console.Tests.csproj
index 7e17c460e2..f8921ac7ac 100644
--- a/tests/Tgstation.Server.Host.Console.Tests/Tgstation.Server.Host.Console.Tests.csproj
+++ b/tests/Tgstation.Server.Host.Console.Tests/Tgstation.Server.Host.Console.Tests.csproj
@@ -7,6 +7,14 @@
latest
+
+
+
+
+
+
+
+
diff --git a/tests/Tgstation.Server.Host.Service.Tests/Tgstation.Server.Host.Service.Tests.csproj b/tests/Tgstation.Server.Host.Service.Tests/Tgstation.Server.Host.Service.Tests.csproj
index b2b93b20f3..d2375010bb 100644
--- a/tests/Tgstation.Server.Host.Service.Tests/Tgstation.Server.Host.Service.Tests.csproj
+++ b/tests/Tgstation.Server.Host.Service.Tests/Tgstation.Server.Host.Service.Tests.csproj
@@ -28,6 +28,7 @@
prompt
4
7.1
+
pdbonly
@@ -37,6 +38,7 @@
prompt
4
7.1
+
diff --git a/tests/Tgstation.Server.Host.Tests/Tgstation.Server.Host.Tests.csproj b/tests/Tgstation.Server.Host.Tests/Tgstation.Server.Host.Tests.csproj
index c075c20e1c..454e3d69e9 100644
--- a/tests/Tgstation.Server.Host.Tests/Tgstation.Server.Host.Tests.csproj
+++ b/tests/Tgstation.Server.Host.Tests/Tgstation.Server.Host.Tests.csproj
@@ -7,6 +7,14 @@
latest
+
+
+
+
+
+
+
+
diff --git a/tests/Tgstation.Server.Host.Watchdog.Tests/Tgstation.Server.Host.Watchdog.Tests.csproj b/tests/Tgstation.Server.Host.Watchdog.Tests/Tgstation.Server.Host.Watchdog.Tests.csproj
index 5f4e69a72a..27bb53e866 100644
--- a/tests/Tgstation.Server.Host.Watchdog.Tests/Tgstation.Server.Host.Watchdog.Tests.csproj
+++ b/tests/Tgstation.Server.Host.Watchdog.Tests/Tgstation.Server.Host.Watchdog.Tests.csproj
@@ -11,10 +11,12 @@
false
+
latest
+
diff --git a/tests/Tgstation.Server.Tests/Tgstation.Server.Tests.csproj b/tests/Tgstation.Server.Tests/Tgstation.Server.Tests.csproj
index 6927548dae..84ddd0386a 100644
--- a/tests/Tgstation.Server.Tests/Tgstation.Server.Tests.csproj
+++ b/tests/Tgstation.Server.Tests/Tgstation.Server.Tests.csproj
@@ -8,10 +8,12 @@
7.1
+
7.1
+
diff --git a/tgstation-server.sln b/tgstation-server.sln
index d3155c0ea4..599acf7da1 100644
--- a/tgstation-server.sln
+++ b/tgstation-server.sln
@@ -20,6 +20,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tgstation.Server.Host.Conso
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{6FF654E6-3E2C-46D4-872D-D528F77D6973}"
ProjectSection(SolutionItems) = preProject
+ build\analyzers.ruleset = build\analyzers.ruleset
build\BuildDox.ps1 = build\BuildDox.ps1
build\Dockerfile = build\Dockerfile
build\install_byond.sh = build\install_byond.sh