-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from Resgrid/develop
Develop
- Loading branch information
Showing
682 changed files
with
41,344 additions
and
12,440 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
target-branch: "develop" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Resgrid.Config | ||
{ | ||
/// <summary> | ||
/// Config settings for JWT's used in the website and api | ||
/// </summary> | ||
public static class JwtConfig | ||
{ | ||
public static string Key = ""; | ||
|
||
public static string Issuer = "resgrid.local"; | ||
|
||
public static string Audience = "resgrid.local"; | ||
|
||
public static int Duration = 30; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace Resgrid.Config | ||
{ | ||
/// <summary> | ||
/// Configuration for OpenID Connect (https://documentation.openiddict.com/) | ||
/// </summary> | ||
public static class OidcConfig | ||
{ | ||
public static string Key = ""; | ||
|
||
public static string ConnectionString = "Server=rgdevserver;Database=ResgridOIDC;User Id=resgrid_app;Password=resgrid123;MultipleActiveResultSets=True;"; | ||
|
||
public static int AccessTokenExpiryMinutes = 1440; | ||
|
||
public static int RefreshTokenExpiryDays = 30; | ||
|
||
public static string EncryptionCert = ""; | ||
|
||
public static string SigningCert = ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Resgrid.Config | ||
{ | ||
public static class TelemetryConfig | ||
{ | ||
public static string Exporter = ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
namespace Resgrid.Config | ||
{ | ||
/// <summary> | ||
/// Configuration for using a VOIP system for voice communication between applications | ||
/// </summary> | ||
public static class VoipConfig | ||
{ | ||
public static int BaseChannelExtensionNumber = 15; | ||
public static int BaseChannelExtensionBump = 15; | ||
|
||
public static string VoipDomain = ""; | ||
public static string VoipServerAddress = ""; | ||
public static string VoipServerWebsocketAddress = ""; | ||
public static string VoipServerWebsocketSslAddress = ""; | ||
|
||
public static string KazooUsername = ""; | ||
public static string KazooPassword = ""; | ||
public static string KazzoAccount = ""; | ||
public static string KazooCrossbarApiUrl = @""; | ||
public static string KazooCrossbarApiVersion = ""; | ||
|
||
public static string OpenViduUrl = ""; | ||
public static string OpenViduSecret = ""; | ||
} | ||
|
||
/// <summary> | ||
/// Possible backend voip providers | ||
/// </summary> | ||
public enum VoipProviderTypes | ||
{ | ||
Kazoo = 0, | ||
OpenVidu = 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Resgrid.Config; | ||
|
||
namespace Resgrid.Framework | ||
{ | ||
public static class ConfigHelper | ||
{ | ||
public static bool CanTransmit(int departmentId) | ||
{ | ||
if (SystemBehaviorConfig.BypassDoNotBroadcastDepartments.Contains(departmentId)) | ||
return true; | ||
|
||
return !SystemBehaviorConfig.DoNotBroadcast; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using Resgrid.Config; | ||
using System.Security.Cryptography; | ||
using System.Text; | ||
|
||
namespace Resgrid.Framework | ||
{ | ||
public static class Hashing | ||
{ | ||
public static string ComputeSha256Hash(string rawData) | ||
{ | ||
// Create a SHA256 | ||
using (SHA256 sha256Hash = SHA256.Create()) | ||
{ | ||
// ComputeHash - returns byte array | ||
byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(rawData + SymmetricEncryptionConfig.SaltValue)); | ||
|
||
// Convert byte array to a string | ||
StringBuilder builder = new StringBuilder(); | ||
for (int i = 0; i < bytes.Length; i++) | ||
{ | ||
builder.Append(bytes[i].ToString("x2")); | ||
} | ||
return builder.ToString(); | ||
} | ||
} | ||
|
||
public static string ComputeMD5Hash(string input) | ||
{ | ||
using (MD5 md5 = MD5.Create()) | ||
{ | ||
byte[] inputBytes = Encoding.ASCII.GetBytes(input); | ||
byte[] hashBytes = md5.ComputeHash(inputBytes); | ||
|
||
StringBuilder sb = new StringBuilder(); | ||
for (int i = 0; i < hashBytes.Length; i++) | ||
{ | ||
sb.Append(hashBytes[i].ToString("x2")); | ||
} | ||
return sb.ToString(); | ||
} | ||
} | ||
|
||
public static string ComputeSHA1Hash(string input) | ||
{ | ||
using (SHA1Managed sha1 = new SHA1Managed()) | ||
{ | ||
var hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(input)); | ||
var sb = new StringBuilder(hash.Length * 2); | ||
|
||
foreach (byte b in hash) | ||
{ | ||
// can be "x2" if you want lowercase | ||
sb.Append(b.ToString("x2")); | ||
} | ||
|
||
return sb.ToString(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.