From 5a7d24e2e7f3efc4f8ac4a25b9a76d9b6881e684 Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Wed, 17 Nov 2021 11:39:10 +0530 Subject: [PATCH 01/15] hmacsha256 refactor --- src/Api/PubnubApi/PubnubApi.csproj | 3 ++ .../PubnubApi/Security/PubnubCryptoBase.cs | 30 +------------------ src/Api/PubnubApiPCL/PubnubApiPCL.csproj | 1 + src/Api/PubnubApiUWP/PubnubApiUWP.csproj | 1 + 4 files changed, 6 insertions(+), 29 deletions(-) diff --git a/src/Api/PubnubApi/PubnubApi.csproj b/src/Api/PubnubApi/PubnubApi.csproj index 9c0eddfaa..1794c7b6a 100644 --- a/src/Api/PubnubApi/PubnubApi.csproj +++ b/src/Api/PubnubApi/PubnubApi.csproj @@ -115,6 +115,9 @@ Removed throw exception on atleast one PAM permission validation None + + 4.3.0 + diff --git a/src/Api/PubnubApi/Security/PubnubCryptoBase.cs b/src/Api/PubnubApi/Security/PubnubCryptoBase.cs index 7dcadeca1..fd2c15772 100644 --- a/src/Api/PubnubApi/Security/PubnubCryptoBase.cs +++ b/src/Api/PubnubApi/Security/PubnubCryptoBase.cs @@ -6,9 +6,7 @@ #if NET35 using System.Security.Cryptography; #else -using Org.BouncyCastle.Crypto; -using Org.BouncyCastle.Crypto.Parameters; -using Org.BouncyCastle.Security; +using System.Security.Cryptography; #endif namespace PubnubApi @@ -163,24 +161,11 @@ public string PubnubAccessManagerSign(string key, string data) byte[] keyByte = encoding.GetBytes(secret); byte[] messageBytes = encoding.GetBytes(message); -#if NET35 using (var hmacsha256 = new HMACSHA256(keyByte)) { byte[] hashmessage = hmacsha256.ComputeHash(messageBytes); return Convert.ToBase64String(hashmessage).Replace('+', '-').Replace('/', '_'); } -#else - - //http://mycsharp.de/wbb2/thread.php?postid=3550104 - KeyParameter paramKey = new KeyParameter(keyByte); - IMac mac = MacUtilities.GetMac("HMac-SHA256"); - mac.Init(paramKey); - mac.Reset(); - mac.BlockUpdate(messageBytes, 0, messageBytes.Length); - byte[] hashmessage = new byte[mac.GetMacSize()]; - mac.DoFinal(hashmessage, 0); - return Convert.ToBase64String(hashmessage).Replace('+', '-').Replace('/', '_'); -#endif } public static byte[] PubnubAccessManagerSign(string key, byte[] dataBytes) @@ -191,24 +176,11 @@ public static byte[] PubnubAccessManagerSign(string key, byte[] dataBytes) byte[] keyByte = encoding.GetBytes(secret); byte[] messageBytes = dataBytes; -#if NET35 using (var hmacsha256 = new HMACSHA256(keyByte)) { byte[] hashmessage = hmacsha256.ComputeHash(messageBytes); return hashmessage; } -#else - - //http://mycsharp.de/wbb2/thread.php?postid=3550104 - KeyParameter paramKey = new KeyParameter(keyByte); - IMac mac = MacUtilities.GetMac("HMac-SHA256"); - mac.Init(paramKey); - mac.Reset(); - mac.BlockUpdate(messageBytes, 0, messageBytes.Length); - byte[] hashmessage = new byte[mac.GetMacSize()]; - mac.DoFinal(hashmessage, 0); - return hashmessage; -#endif } public string GetHashRaw(string input) diff --git a/src/Api/PubnubApiPCL/PubnubApiPCL.csproj b/src/Api/PubnubApiPCL/PubnubApiPCL.csproj index f23fb686d..804ba8d62 100644 --- a/src/Api/PubnubApiPCL/PubnubApiPCL.csproj +++ b/src/Api/PubnubApiPCL/PubnubApiPCL.csproj @@ -582,6 +582,7 @@ Removed throw exception on atleast one PAM permission validationNone + diff --git a/src/Api/PubnubApiUWP/PubnubApiUWP.csproj b/src/Api/PubnubApiUWP/PubnubApiUWP.csproj index f83603d10..69ca4a4f0 100644 --- a/src/Api/PubnubApiUWP/PubnubApiUWP.csproj +++ b/src/Api/PubnubApiUWP/PubnubApiUWP.csproj @@ -671,6 +671,7 @@ Removed throw exception on atleast one PAM permission validation 1.8.1.2 + From c275dc1b0bef1a96eb12c4fa5335dee2d48946ae Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Wed, 17 Nov 2021 11:54:27 +0530 Subject: [PATCH 02/15] removed conditional directive --- src/Api/PubnubApi/Security/PubnubCryptoBase.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Api/PubnubApi/Security/PubnubCryptoBase.cs b/src/Api/PubnubApi/Security/PubnubCryptoBase.cs index fd2c15772..dc1d33201 100644 --- a/src/Api/PubnubApi/Security/PubnubCryptoBase.cs +++ b/src/Api/PubnubApi/Security/PubnubCryptoBase.cs @@ -2,12 +2,7 @@ using System.Globalization; using System.Text; using System.Text.RegularExpressions; - -#if NET35 -using System.Security.Cryptography; -#else using System.Security.Cryptography; -#endif namespace PubnubApi { From 74ac9d9c48cf9da845123298f1a477f9fb16bd39 Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Thu, 18 Nov 2021 12:38:17 +0530 Subject: [PATCH 03/15] Removed Portable.BouncyCastle & code refactored for native .net library --- src/Api/PubnubApi/PubnubApi.csproj | 9 ---- src/Api/PubnubApi/Security/PubnubCrypto.cs | 54 ++----------------- src/Api/PubnubApiPCL/PubnubApiPCL.csproj | 3 -- src/Api/PubnubApiUWP/PubnubApiUWP.csproj | 3 -- .../MockServerPubnubApiPCL.csproj | 6 --- 5 files changed, 3 insertions(+), 72 deletions(-) diff --git a/src/Api/PubnubApi/PubnubApi.csproj b/src/Api/PubnubApi/PubnubApi.csproj index bbe6adabb..458c08e8e 100644 --- a/src/Api/PubnubApi/PubnubApi.csproj +++ b/src/Api/PubnubApi/PubnubApi.csproj @@ -85,9 +85,6 @@ - - None - None @@ -99,9 +96,6 @@ - - None - @@ -110,9 +104,6 @@ - - None - 4.3.0 diff --git a/src/Api/PubnubApi/Security/PubnubCrypto.cs b/src/Api/PubnubApi/Security/PubnubCrypto.cs index f05117ea4..30803d616 100644 --- a/src/Api/PubnubApi/Security/PubnubCrypto.cs +++ b/src/Api/PubnubApi/Security/PubnubCrypto.cs @@ -2,17 +2,7 @@ using System.Text; using System.Globalization; -#if !NETSTANDARD10 && !NETSTANDARD11 using System.Security.Cryptography; -#endif - -#if !NET35 -using Org.BouncyCastle.Crypto.Digests; -using Org.BouncyCastle.Crypto.Engines; -using Org.BouncyCastle.Crypto.Modes; -using Org.BouncyCastle.Crypto.Paddings; -using Org.BouncyCastle.Crypto.Parameters; -#endif namespace PubnubApi { @@ -37,19 +27,10 @@ public PubnubCrypto(string cipher_key) protected override string ComputeHashRaw(string input) { -#if NET35 HashAlgorithm algorithm = SHA256.Create(); Byte[] inputBytes = System.Text.Encoding.UTF8.GetBytes(input); Byte[] hashedBytes = algorithm.ComputeHash(inputBytes); return BitConverter.ToString(hashedBytes); -#else - Sha256Digest algorithm = new Sha256Digest(); - Byte[] inputBytes = System.Text.Encoding.UTF8.GetBytes(input); - Byte[] bufferBytes = new byte[algorithm.GetDigestSize()]; - algorithm.BlockUpdate(inputBytes, 0, inputBytes.Length); - algorithm.DoFinal(bufferBytes, 0); - return BitConverter.ToString(bufferBytes); -#endif } protected override string EncryptOrDecrypt(bool type, string dataStr, bool dynamicIV) @@ -137,7 +118,7 @@ protected override byte[] EncryptOrDecrypt(bool type, byte[] dataBytes, bool dyn { LoggingMethod.WriteToLog(pubnubLog, string.Format("DateTime {0} IV = {1}", DateTime.Now.ToString(CultureInfo.InvariantCulture), GetDisplayableBytes(ivBytes)), config.LogVerbosity); } -#if NET35 + Aes aesAlg = Aes.Create(); aesAlg.KeySize = 256; aesAlg.BlockSize = 128; @@ -145,34 +126,15 @@ protected override byte[] EncryptOrDecrypt(bool type, byte[] dataBytes, bool dyn aesAlg.Padding = PaddingMode.PKCS7; aesAlg.IV = ivBytes; aesAlg.Key = System.Text.Encoding.UTF8.GetBytes(keyString); -#else - byte[] iv = ivBytes; - byte[] keyBytes = System.Text.Encoding.UTF8.GetBytes(keyString); - - //Set up - AesEngine engine = new AesEngine(); - CbcBlockCipher blockCipher = new CbcBlockCipher(engine); //CBC - PaddedBufferedBlockCipher cipher = new PaddedBufferedBlockCipher(blockCipher); //Default scheme is PKCS5/PKCS7 - KeyParameter keyParam = new KeyParameter(keyBytes); - ParametersWithIV keyParamWithIV = new ParametersWithIV(keyParam, iv, 0, iv.Length); -#endif - if (type) { // Encrypt byte[] outputBytes = null; -#if NET35 ICryptoTransform crypto = aesAlg.CreateEncryptor(); byte[] plainBytes = dataBytes; outputBytes = crypto.TransformFinalBlock(plainBytes, 0, plainBytes.Length); -#else - byte[] inputBytes = dataBytes; - cipher.Init(true, keyParamWithIV); - outputBytes = new byte[cipher.GetOutputSize(inputBytes.Length)]; - int length = cipher.ProcessBytes(inputBytes, outputBytes, 0); - cipher.DoFinal(outputBytes, length); //Do the final block -#endif + byte[] newOutputBytes = null; if (dynamicIV) { @@ -193,22 +155,12 @@ protected override byte[] EncryptOrDecrypt(bool type, byte[] dataBytes, bool dyn try { //Decrypt -#if NET35 byte[] decryptedBytes = dataBytes; ICryptoTransform decrypto = aesAlg.CreateDecryptor(); var data = decrypto.TransformFinalBlock(decryptedBytes, 0, decryptedBytes.Length); newOutputBytes = data; -#else - byte[] inputBytes = dataBytes; - cipher.Init(false, keyParamWithIV); - byte[] encryptedBytes = new byte[cipher.GetOutputSize(inputBytes.Length)]; - var encryptLength = cipher.ProcessBytes(inputBytes, encryptedBytes, 0); - var lastBytesLength = cipher.DoFinal(encryptedBytes, encryptLength); //Do the final block - var totalBytesLength = encryptLength + lastBytesLength; - newOutputBytes = new byte[totalBytesLength]; - Array.Copy(encryptedBytes, newOutputBytes, totalBytesLength); -#endif + return newOutputBytes; } catch (Exception ex) diff --git a/src/Api/PubnubApiPCL/PubnubApiPCL.csproj b/src/Api/PubnubApiPCL/PubnubApiPCL.csproj index 5142628cc..b6f4f9b89 100644 --- a/src/Api/PubnubApiPCL/PubnubApiPCL.csproj +++ b/src/Api/PubnubApiPCL/PubnubApiPCL.csproj @@ -596,9 +596,6 @@ - - None - None diff --git a/src/Api/PubnubApiUWP/PubnubApiUWP.csproj b/src/Api/PubnubApiUWP/PubnubApiUWP.csproj index de614a86f..87224b4d7 100644 --- a/src/Api/PubnubApiUWP/PubnubApiUWP.csproj +++ b/src/Api/PubnubApiUWP/PubnubApiUWP.csproj @@ -673,9 +673,6 @@ 9.0.1 - - 1.8.1.2 - diff --git a/src/UnitTests/MockServerPubnubApiPCL/MockServerPubnubApiPCL.csproj b/src/UnitTests/MockServerPubnubApiPCL/MockServerPubnubApiPCL.csproj index 3118e0f63..f58740da6 100644 --- a/src/UnitTests/MockServerPubnubApiPCL/MockServerPubnubApiPCL.csproj +++ b/src/UnitTests/MockServerPubnubApiPCL/MockServerPubnubApiPCL.csproj @@ -42,12 +42,6 @@ - - - None - - - 4.0.0 From 1e7f8a0582f8ba55d559da7620c2848f69014dd3 Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Thu, 18 Nov 2021 12:39:05 +0530 Subject: [PATCH 04/15] minor update to tests --- .../PubnubApi.Tests/EncryptionTests.cs | 16 ++++++++++++---- .../PubnubApi.Tests/PubnubApi.Tests.csproj | 1 + .../PubnubApi.Tests/WhenFileIsRequested.cs | 16 ++++++++-------- .../PubnubApi.Tests/fileupload_enc.txt | Bin 0 -> 64 bytes .../PubnubApiPCL.Tests.csproj | 1 + .../PubnubApiPCL.Tests/fileupload_enc.txt | Bin 0 -> 64 bytes 6 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 src/UnitTests/PubnubApi.Tests/fileupload_enc.txt create mode 100644 src/UnitTests/PubnubApiPCL.Tests/fileupload_enc.txt diff --git a/src/UnitTests/PubnubApi.Tests/EncryptionTests.cs b/src/UnitTests/PubnubApi.Tests/EncryptionTests.cs index f5d96dbe6..b812d6659 100644 --- a/src/UnitTests/PubnubApi.Tests/EncryptionTests.cs +++ b/src/UnitTests/PubnubApi.Tests/EncryptionTests.cs @@ -308,8 +308,12 @@ public void TestLocalFileEncryptionFromPath() { IPubnubUnitTest pubnubUnitTest = new PubnubUnitTest(); pubnubUnitTest.IV = new byte[16] { 133, 126, 158, 123, 43, 95, 96, 90, 215, 178, 17, 73, 166, 130, 79, 156 }; - string sourceFile = @"C:\Pandu\temp\new\input\file_upload_original.txt"; - string destFile = @"C:\Pandu\temp\new\input\file_upload_original_encrypted.txt"; + string sourceFile = "fileupload.txt"; + string destFile = "fileupload_encrypted.txt"; + if (System.IO.File.Exists(destFile)) + { + System.IO.File.Delete(destFile); + } PNConfiguration config = new PNConfiguration(); Pubnub pn = new Pubnub(config); pn.EncryptFile(sourceFile, destFile, "enigma"); @@ -320,8 +324,12 @@ public void TestLocalFileEncryptionFromPath() [Test] public void TestLocalFileDecryptionFromPath() { - string sourceFile = @"C:\Pandu\temp\new\input\file_image_enc.jpg"; - string destFile = @"C:\Pandu\temp\new\input\file_image_enc_decrypted_to_original.jpg"; + string sourceFile = "fileupload_enc.txt"; + string destFile = "fileupload_enc_decrypted_to_original.txt"; + if (System.IO.File.Exists(destFile)) + { + System.IO.File.Delete(destFile); + } PNConfiguration config = new PNConfiguration(); Pubnub pn = new Pubnub(config); pn.DecryptFile(sourceFile, destFile, "enigma"); diff --git a/src/UnitTests/PubnubApi.Tests/PubnubApi.Tests.csproj b/src/UnitTests/PubnubApi.Tests/PubnubApi.Tests.csproj index ede288552..e668d9912 100644 --- a/src/UnitTests/PubnubApi.Tests/PubnubApi.Tests.csproj +++ b/src/UnitTests/PubnubApi.Tests/PubnubApi.Tests.csproj @@ -84,5 +84,6 @@ + diff --git a/src/UnitTests/PubnubApi.Tests/WhenFileIsRequested.cs b/src/UnitTests/PubnubApi.Tests/WhenFileIsRequested.cs index 8683cd66a..8cf4fb9dd 100644 --- a/src/UnitTests/PubnubApi.Tests/WhenFileIsRequested.cs +++ b/src/UnitTests/PubnubApi.Tests/WhenFileIsRequested.cs @@ -69,7 +69,7 @@ public static void Init() Thread.Sleep(1000); - grantManualEvent.WaitOne(); + grantManualEvent.WaitOne(2000); pubnub.Destroy(); pubnub.PubnubUnitTest = null; @@ -152,7 +152,7 @@ public static void ThenSendFileShouldReturnSuccess() mre.Set(); })); Thread.Sleep(1000); - mre.WaitOne(); + mre.WaitOne(3 * 1000 * 60); if (receivedMessage) { @@ -169,7 +169,7 @@ public static void ThenSendFileShouldReturnSuccess() mre.Set(); })); Thread.Sleep(1000); - mre.WaitOne(); + mre.WaitOne(2 * 1000 * 60); } if (receivedMessage) @@ -186,7 +186,7 @@ public static void ThenSendFileShouldReturnSuccess() } mre.Set(); })); - mre.WaitOne(); + mre.WaitOne(2 * 1000 * 60); } if (receivedMessage) @@ -204,7 +204,7 @@ public static void ThenSendFileShouldReturnSuccess() mre.Set(); })); Thread.Sleep(1000); - mre.WaitOne(); + mre.WaitOne(2 * 1000 * 60); } @@ -298,7 +298,7 @@ public static async Task ThenWithAsyncSendFileShouldReturnSuccess() mre.Set(); })); Thread.Sleep(1000); - mre.WaitOne(); + mre.WaitOne(2 * 1000 * 60); if (receivedMessage) @@ -314,7 +314,7 @@ public static async Task ThenWithAsyncSendFileShouldReturnSuccess() } mre.Set(); })); - mre.WaitOne(); + mre.WaitOne(2 * 1000 * 60); } if (receivedMessage) @@ -332,7 +332,7 @@ public static async Task ThenWithAsyncSendFileShouldReturnSuccess() mre.Set(); })); Thread.Sleep(1000); - mre.WaitOne(); + mre.WaitOne(2 * 1000 * 60); } diff --git a/src/UnitTests/PubnubApi.Tests/fileupload_enc.txt b/src/UnitTests/PubnubApi.Tests/fileupload_enc.txt new file mode 100644 index 0000000000000000000000000000000000000000..0dade66382dd4e24684aadfe3d1950b0bc12d592 GIT binary patch literal 64 zcmV-G0Kfm-i(&$b*jB;IXv3g3tuFO^G9)kh@UmtJd literal 0 HcmV?d00001 diff --git a/src/UnitTests/PubnubApiPCL.Tests/PubnubApiPCL.Tests.csproj b/src/UnitTests/PubnubApiPCL.Tests/PubnubApiPCL.Tests.csproj index 6c4cab259..d763a794a 100644 --- a/src/UnitTests/PubnubApiPCL.Tests/PubnubApiPCL.Tests.csproj +++ b/src/UnitTests/PubnubApiPCL.Tests/PubnubApiPCL.Tests.csproj @@ -107,5 +107,6 @@ + diff --git a/src/UnitTests/PubnubApiPCL.Tests/fileupload_enc.txt b/src/UnitTests/PubnubApiPCL.Tests/fileupload_enc.txt new file mode 100644 index 0000000000000000000000000000000000000000..0dade66382dd4e24684aadfe3d1950b0bc12d592 GIT binary patch literal 64 zcmV-G0Kfm-i(&$b*jB;IXv3g3tuFO^G9)kh@UmtJd literal 0 HcmV?d00001 From 00cb7da4b4bdd20a76bf0ea5423ebd3a597e81cb Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Thu, 18 Nov 2021 15:07:36 +0530 Subject: [PATCH 05/15] minor update to tests --- src/UnitTests/PubnubApi.Tests/WhenFileIsRequested.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/UnitTests/PubnubApi.Tests/WhenFileIsRequested.cs b/src/UnitTests/PubnubApi.Tests/WhenFileIsRequested.cs index 8cf4fb9dd..b03fef58b 100644 --- a/src/UnitTests/PubnubApi.Tests/WhenFileIsRequested.cs +++ b/src/UnitTests/PubnubApi.Tests/WhenFileIsRequested.cs @@ -174,6 +174,7 @@ public static void ThenSendFileShouldReturnSuccess() if (receivedMessage) { + System.Net.ServicePointManager.SecurityProtocol = (System.Net.SecurityProtocolType)3072; //Need this line for .net 3.5/4.0/4.5 receivedMessage = false; mre = new ManualResetEvent(false); pubnub.DownloadFile().Channel(channelName).FileId(fileId).FileName(fileName).Execute(new PNDownloadFileResultExt((result, status) => @@ -303,6 +304,7 @@ public static async Task ThenWithAsyncSendFileShouldReturnSuccess() if (receivedMessage) { + System.Net.ServicePointManager.SecurityProtocol = (System.Net.SecurityProtocolType)3072; //Need this line for .net 3.5/4.0/4.5 receivedMessage = false; mre = new ManualResetEvent(false); pubnub.DownloadFile().Channel(channelName).FileId(fileId).FileName(fileName).Execute(new PNDownloadFileResultExt((result, status) => From 9cd483a99ce71ec6e2410a18bdcec15c56c2f1ff Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Thu, 18 Nov 2021 15:12:01 +0530 Subject: [PATCH 06/15] feature file update --- src/UnitTests/AcceptanceTests/Features/revoke-token.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UnitTests/AcceptanceTests/Features/revoke-token.feature b/src/UnitTests/AcceptanceTests/Features/revoke-token.feature index e7713a3dc..f83efad2d 100644 --- a/src/UnitTests/AcceptanceTests/Features/revoke-token.feature +++ b/src/UnitTests/AcceptanceTests/Features/revoke-token.feature @@ -30,7 +30,7 @@ Feature: Revoke an access token Given a token When I revoke a token Then an error is returned - * the error status code is 403 + * the error status code is 400 * the error message is 'Feature disabled' * the error source is 'revoke' * the error detail message is 'Token revocation is disabled.' From 52bda2f2b15fb19c603a372576693a6d579d6c86 Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Tue, 7 Dec 2021 16:57:05 +0530 Subject: [PATCH 07/15] try catch for publish --- .../EndPoint/PubSub/PublishOperation.cs | 184 ++++++++++-------- 1 file changed, 103 insertions(+), 81 deletions(-) diff --git a/src/Api/PubnubApi/EndPoint/PubSub/PublishOperation.cs b/src/Api/PubnubApi/EndPoint/PubSub/PublishOperation.cs index f587b65a3..2d647e7b2 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/PublishOperation.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/PublishOperation.cs @@ -205,67 +205,80 @@ internal void Publish(string channel, object message, bool storeInHistory, int t return; } - string requestMethodName = (this.httpPost) ? "POST" : "GET"; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); - - Uri request = urlBuilder.BuildPublishRequest(requestMethodName, "", channel, message, storeInHistory, ttl, metaData, null, externalQueryParam); - RequestState requestState = new RequestState(); - requestState.Channels = new [] { channel }; - requestState.ResponseType = PNOperationType.PNPublishOperation; - requestState.PubnubCallback = callback; - requestState.Reconnect = false; - requestState.EndPointOperation = this; + try + { + string requestMethodName = (this.httpPost) ? "POST" : "GET"; + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); - string json = ""; + Uri request = urlBuilder.BuildPublishRequest(requestMethodName, "", channel, message, storeInHistory, ttl, metaData, null, externalQueryParam); - if (this.httpPost) - { - requestState.UsePostMethod = true; - string postMessage = JsonEncodePublishMsg(message); - byte[] postData = Encoding.UTF8.GetBytes(postMessage); - UrlProcessRequest(request, requestState, false, postData).ContinueWith(r => + requestState.Channels = new[] { channel }; + requestState.ResponseType = PNOperationType.PNPublishOperation; + requestState.PubnubCallback = callback; + requestState.Reconnect = false; + requestState.EndPointOperation = this; + + string json = ""; + + if (this.httpPost) { - json = r.Result.Item1; - }, TaskContinuationOptions.ExecuteSynchronously).Wait(); - } - else - { - UrlProcessRequest(request, requestState, false).ContinueWith(r => + requestState.UsePostMethod = true; + string postMessage = JsonEncodePublishMsg(message); + byte[] postData = Encoding.UTF8.GetBytes(postMessage); + UrlProcessRequest(request, requestState, false, postData).ContinueWith(r => + { + json = r.Result.Item1; + }, TaskContinuationOptions.ExecuteSynchronously).Wait(); + } + else { - json = r.Result.Item1; - }, TaskContinuationOptions.ExecuteSynchronously).Wait(); - } - - if (!string.IsNullOrEmpty(json)) - { - List result = ProcessJsonResponse(requestState, json); + UrlProcessRequest(request, requestState, false).ContinueWith(r => + { + json = r.Result.Item1; + }, TaskContinuationOptions.ExecuteSynchronously).Wait(); + } - if (result != null && result.Count >= 3) + if (!string.IsNullOrEmpty(json)) { - int publishStatus; - Int32.TryParse(result[0].ToString(), out publishStatus); - if (publishStatus == 1) + List result = ProcessJsonResponse(requestState, json); + + if (result != null && result.Count >= 3) { - ProcessResponseCallbacks(result, requestState); + int publishStatus; + Int32.TryParse(result[0].ToString(), out publishStatus); + if (publishStatus == 1) + { + ProcessResponseCallbacks(result, requestState); + } + else + { + PNStatusCategory category = PNStatusCategoryHelper.GetPNStatusCategory(400, result[1].ToString()); + PNStatus status = new StatusBuilder(config, jsonLibrary).CreateStatusResponse(PNOperationType.PNPublishOperation, category, requestState, 400, new PNException(json)); + if (requestState.PubnubCallback != null) + { + requestState.PubnubCallback.OnResponse(default(PNPublishResult), status); + } + } } else { - PNStatusCategory category = PNStatusCategoryHelper.GetPNStatusCategory(400, result[1].ToString()); - PNStatus status = new StatusBuilder(config, jsonLibrary).CreateStatusResponse(PNOperationType.PNPublishOperation, category, requestState, 400, new PNException(json)); - if (requestState.PubnubCallback != null) - { - requestState.PubnubCallback.OnResponse(default(PNPublishResult), status); - } + ProcessResponseCallbacks(result, requestState); } } - else + + CleanUp(); + } + catch (Exception ex) + { + PNStatusCategory category = PNStatusCategoryHelper.GetPNStatusCategory(400, ex.ToString()); + PNStatus status = new StatusBuilder(config, jsonLibrary).CreateStatusResponse(PNOperationType.PNPublishOperation, category, requestState, 400, new PNException(ex.ToString())); + if (requestState.PubnubCallback != null) { - ProcessResponseCallbacks(result, requestState); + requestState.PubnubCallback.OnResponse(default(PNPublishResult), status); } - } - CleanUp(); + } } internal async Task> Publish(string channel, object message, bool storeInHistory, int ttl, Dictionary metaData, Dictionary externalQueryParam) @@ -290,56 +303,65 @@ internal async Task> Publish(string channel, object me return ret; } - string requestMethodName = (this.httpPost) ? "POST" : "GET"; - IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); - - Uri request = urlBuilder.BuildPublishRequest(requestMethodName, "", channel, message, storeInHistory, ttl, metaData, null, externalQueryParam); - RequestState requestState = new RequestState(); - requestState.Channels = new[] { channel }; - requestState.ResponseType = PNOperationType.PNPublishOperation; - requestState.Reconnect = false; - requestState.EndPointOperation = this; + try + { + string requestMethodName = (this.httpPost) ? "POST" : "GET"; + IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : ""); - Tuple JsonAndStatusTuple; + Uri request = urlBuilder.BuildPublishRequest(requestMethodName, "", channel, message, storeInHistory, ttl, metaData, null, externalQueryParam); - if (this.httpPost) - { - requestState.UsePostMethod = true; - string postMessage = JsonEncodePublishMsg(message); - byte[] postData = Encoding.UTF8.GetBytes(postMessage); - JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false, postData).ConfigureAwait(false); - } - else - { - JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false).ConfigureAwait(false); - } - ret.Status = JsonAndStatusTuple.Item2; - string json = JsonAndStatusTuple.Item1; + requestState.Channels = new[] { channel }; + requestState.ResponseType = PNOperationType.PNPublishOperation; + requestState.Reconnect = false; + requestState.EndPointOperation = this; - if (!string.IsNullOrEmpty(json)) - { - List result = ProcessJsonResponse(requestState, json); + Tuple JsonAndStatusTuple; + + if (this.httpPost) + { + requestState.UsePostMethod = true; + string postMessage = JsonEncodePublishMsg(message); + byte[] postData = Encoding.UTF8.GetBytes(postMessage); + JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false, postData).ConfigureAwait(false); + } + else + { + JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false).ConfigureAwait(false); + } + ret.Status = JsonAndStatusTuple.Item2; + string json = JsonAndStatusTuple.Item1; - if (result != null && result.Count >= 3) + if (!string.IsNullOrEmpty(json)) { - int publishStatus; - Int32.TryParse(result[0].ToString(), out publishStatus); - if (publishStatus == 1) + List result = ProcessJsonResponse(requestState, json); + + if (result != null && result.Count >= 3) { - List resultList = ProcessJsonResponse(requestState, json); - if (resultList != null && resultList.Count > 0) + int publishStatus; + Int32.TryParse(result[0].ToString(), out publishStatus); + if (publishStatus == 1) { - ResponseBuilder responseBuilder = new ResponseBuilder(config, jsonLibrary, pubnubLog); - PNPublishResult responseResult = responseBuilder.JsonToObject(resultList, true); - if (responseResult != null) + List resultList = ProcessJsonResponse(requestState, json); + if (resultList != null && resultList.Count > 0) { - ret.Result = responseResult; + ResponseBuilder responseBuilder = new ResponseBuilder(config, jsonLibrary, pubnubLog); + PNPublishResult responseResult = responseBuilder.JsonToObject(resultList, true); + if (responseResult != null) + { + ret.Result = responseResult; + } } } } } } + catch (Exception ex) + { + PNStatusCategory category = PNStatusCategoryHelper.GetPNStatusCategory(400, ex.ToString()); + PNStatus status = new StatusBuilder(config, jsonLibrary).CreateStatusResponse(PNOperationType.PNPublishOperation, category, requestState, 400, new PNException(ex.ToString())); + ret.Status = status; + } return ret; } From 169775d5df6aeafd9e901d56d232240aa5c59bff Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Tue, 7 Dec 2021 17:30:05 +0530 Subject: [PATCH 08/15] capture PNStatus from UrlProcessRequest --- src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs index a2dcad83a..4e8978e1a 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs @@ -670,9 +670,11 @@ private void MultiChannelSubscribeRequest(PNOperationType type, string[] chan // Wait for message string json = ""; + PNStatus pnStatus = null; UrlProcessRequest(request, pubnubRequestState, false).ContinueWith(r => { json = r.Result.Item1; + pnStatus = r.Result.Item2; }, TaskContinuationOptions.ExecuteSynchronously).Wait(); if (!string.IsNullOrEmpty(json)) { @@ -730,6 +732,11 @@ private void MultiChannelSubscribeRequest(PNOperationType type, string[] chan } else { + if (pnStatus != null && pnStatus.StatusCode == 403) + { + Announce(pnStatus); //Announce to subscribe callback when 403 + } + if (multiplexExceptionTimer != null) { multiplexExceptionTimer.Change(Timeout.Infinite, Timeout.Infinite); From 3ff11b78cfe3b557740c9032d1b24b20c09cb6e3 Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Tue, 7 Dec 2021 18:37:37 +0530 Subject: [PATCH 09/15] no resubscribe on access denied --- .../PubnubApi/EndPoint/PubSub/SubscribeManager.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs index 4e8978e1a..fa89d166e 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs @@ -732,9 +732,22 @@ private void MultiChannelSubscribeRequest(PNOperationType type, string[] chan } else { - if (pnStatus != null && pnStatus.StatusCode == 403) + if (pnStatus != null && pnStatus.Category == PNStatusCategory.PNAccessDeniedCategory) { + //Announce 403 and exit subscribe on 403 Announce(pnStatus); //Announce to subscribe callback when 403 + + ///Disabling flags/checks which can invoke resubscribe + if (SubscribeHeartbeatCheckTimer != null) + { + try + { + SubscribeHeartbeatCheckTimer.Change(Timeout.Infinite, Timeout.Infinite); + } + catch { /* ignore */ } + } + TerminateCurrentSubscriberRequest(); + return; } if (multiplexExceptionTimer != null) From 0a39378b850993a73af5397addaa3a78f05e841d Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Wed, 8 Dec 2021 01:08:19 +0530 Subject: [PATCH 10/15] refactor to stop subscribe on 403 --- .../EndPoint/PubSub/SubscribeManager.cs | 42 ++++++++++++------- .../EndPoint/PubSub/SubscribeOperation.cs | 4 ++ src/Api/PubnubApi/PubnubCoreBase.cs | 1 + 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs index fa89d166e..ba0087a31 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeManager.cs @@ -419,6 +419,7 @@ internal void MultiChannelSubscribeInit(PNOperationType responseType, string[ { bool channelGroupSubscribeOnly = false; SubscribeDisconnected[PubnubInstance.InstanceId] = false; + SubscribeAccessDenied[PubnubInstance.InstanceId] = false; if (rawChannels != null && rawChannels.Length > 0) { @@ -555,14 +556,7 @@ internal void MultiChannelSubscribeInit(PNOperationType responseType, string[ ResetInternetCheckSettings(channels, channelGroups); MultiChannelSubscribeRequest(responseType, channels, channelGroups, 0, 0, false, initialSubscribeUrlParams, externalQueryParam); - if (SubscribeHeartbeatCheckTimer != null) - { - try - { - SubscribeHeartbeatCheckTimer.Change(Timeout.Infinite, Timeout.Infinite); - } - catch { /* ignore */ } - } + CheckAndDisableubscribeHeartbeatCheckTimer(); SubscribeHeartbeatCheckTimer = new Timer(StartSubscribeHeartbeatCheckCallback, null, config.SubscribeTimeout * 500, config.SubscribeTimeout * 500); } } @@ -572,6 +566,18 @@ internal void MultiChannelSubscribeInit(PNOperationType responseType, string[ } } + private static void CheckAndDisableubscribeHeartbeatCheckTimer() + { + if (SubscribeHeartbeatCheckTimer != null) + { + try + { + SubscribeHeartbeatCheckTimer.Change(Timeout.Infinite, Timeout.Infinite); + } + catch { /* ignore */ } + } + } + private void MultiChannelSubscribeRequest(PNOperationType type, string[] channels, string[] channelGroups, object timetoken, int region, bool reconnect, Dictionary initialSubscribeUrlParams, Dictionary externalQueryParam) { if (SubscribeDisconnected[PubnubInstance.InstanceId]) @@ -738,15 +744,13 @@ private void MultiChannelSubscribeRequest(PNOperationType type, string[] chan Announce(pnStatus); //Announce to subscribe callback when 403 ///Disabling flags/checks which can invoke resubscribe - if (SubscribeHeartbeatCheckTimer != null) + SubscribeAccessDenied[PubnubInstance.InstanceId] = true; + Task.Factory.StartNew(() => { - try - { - SubscribeHeartbeatCheckTimer.Change(Timeout.Infinite, Timeout.Infinite); - } - catch { /* ignore */ } - } - TerminateCurrentSubscriberRequest(); + TerminateCurrentSubscriberRequest(); + }, CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default).ConfigureAwait(false); + + CheckAndDisableubscribeHeartbeatCheckTimer(); return; } @@ -1047,6 +1051,12 @@ internal void StartSubscribeHeartbeatCheckCallback(object state) LoggingMethod.WriteToLog(pubnubLog, string.Format("DateTime {0}, SubscribeManager - SubscribeDisconnected. No heartbeat check.", DateTime.Now.ToString(CultureInfo.InvariantCulture)), config.LogVerbosity); return; } + if (SubscribeAccessDenied[PubnubInstance.InstanceId]) + { + CheckAndDisableubscribeHeartbeatCheckTimer(); + LoggingMethod.WriteToLog(pubnubLog, string.Format("DateTime {0}, SubscribeManager - SubscribeAccessDenied. Exiting StartSubscribeHeartbeatCheckCallback.", DateTime.Now.ToString(CultureInfo.InvariantCulture)), config.LogVerbosity); + return; + } string[] channels = GetCurrentSubscriberChannels(); string[] chananelGroups = GetCurrentSubscriberChannelGroups(); diff --git a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeOperation.cs b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeOperation.cs index ecf340b6d..11e493e70 100644 --- a/src/Api/PubnubApi/EndPoint/PubSub/SubscribeOperation.cs +++ b/src/Api/PubnubApi/EndPoint/PubSub/SubscribeOperation.cs @@ -235,6 +235,10 @@ internal void CurrentPubnubInstance(Pubnub instance) { SubscribeDisconnected.GetOrAdd(instance.InstanceId, false); } + if (!SubscribeAccessDenied.ContainsKey(instance.InstanceId)) + { + SubscribeAccessDenied.GetOrAdd(instance.InstanceId, false); + } if (!LastSubscribeTimetoken.ContainsKey(instance.InstanceId)) { LastSubscribeTimetoken.GetOrAdd(instance.InstanceId, 0); diff --git a/src/Api/PubnubApi/PubnubCoreBase.cs b/src/Api/PubnubApi/PubnubCoreBase.cs index ea3e990cc..32ca8d43e 100644 --- a/src/Api/PubnubApi/PubnubCoreBase.cs +++ b/src/Api/PubnubApi/PubnubCoreBase.cs @@ -53,6 +53,7 @@ public abstract class PubnubCoreBase private bool clientNetworkStatusInternetStatus = true; protected static ConcurrentDictionary SubscribeDisconnected { get; set; } = new ConcurrentDictionary(); + protected static ConcurrentDictionary SubscribeAccessDenied { get; set; } = new ConcurrentDictionary(); protected Pubnub PubnubInstance { get; set; } From 3a1030b3cf6e8cdfbff80c1f80271e0cc85666ad Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Wed, 8 Dec 2021 17:18:20 +0530 Subject: [PATCH 11/15] example update --- src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs b/src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs index 798f042be..99c34566b 100644 --- a/src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs +++ b/src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs @@ -371,6 +371,10 @@ static public void Main() var affectedChannels = pnStatus.AffectedChannels; // The channels affected in the operation, of type array. var category = pnStatus.Category; //Returns PNConnectedCategory var operation = pnStatus.Operation; //Returns PNSubscribeOperation + if (pnStatus.Category == PNStatusCategory.PNAccessDeniedCategory) + { + pubnub.Disconnect(); + } } )); From 246d50c1be503e29bc769452bf4c9b6d98d7b2eb Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Wed, 8 Dec 2021 17:34:48 +0530 Subject: [PATCH 12/15] Revert "example update" This reverts commit 3a1030b3cf6e8cdfbff80c1f80271e0cc85666ad. --- src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs b/src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs index 99c34566b..798f042be 100644 --- a/src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs +++ b/src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs @@ -371,10 +371,6 @@ static public void Main() var affectedChannels = pnStatus.AffectedChannels; // The channels affected in the operation, of type array. var category = pnStatus.Category; //Returns PNConnectedCategory var operation = pnStatus.Operation; //Returns PNSubscribeOperation - if (pnStatus.Category == PNStatusCategory.PNAccessDeniedCategory) - { - pubnub.Disconnect(); - } } )); From 791d0b05a0407ee3d2dead9f55fcd878193dceb9 Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Wed, 8 Dec 2021 23:11:58 +0530 Subject: [PATCH 13/15] example update --- .../PubnubApi.ConsoleExample/PubnubExample.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs b/src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs index 798f042be..86c816705 100644 --- a/src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs +++ b/src/Examples/PubnubApi.ConsoleExample/PubnubExample.cs @@ -2221,12 +2221,12 @@ static public void Main() .AuthorizedUuid(grantAuthorizedUuiIdEntry) .Resources(new PNTokenResources() { - Channels = new Dictionary() { - { grantChannelName, new PNTokenAuthValues() { Read = grantRead, Write = grantWrite, Manage= grantManage, Create = grantCreate, Delete=grantDelete, Get = grantGet, Update = grantUpdate, Join = grantJoin } } }, - ChannelGroups = new Dictionary() { - {grantChannelGroupName, new PNTokenAuthValues() { Read = grantRead, Write = grantWrite, Manage= grantManage, Create = grantCreate, Delete=grantDelete, Get = grantGet, Update = grantUpdate, Join = grantJoin } } }, - Uuids = new Dictionary() { - { grantUuiIdEntry, new PNTokenAuthValues() { Read = grantRead, Write = grantWrite, Manage= grantManage, Create = grantCreate, Delete=grantDelete, Get = grantGet, Update = grantUpdate, Join = grantJoin } } }, + Channels = !string.IsNullOrEmpty(grantChannelName) ? new Dictionary() { + { grantChannelName, new PNTokenAuthValues() { Read = grantRead, Write = grantWrite, Manage= grantManage, Create = grantCreate, Delete=grantDelete, Get = grantGet, Update = grantUpdate, Join = grantJoin } } } : null, + ChannelGroups = !string.IsNullOrEmpty(grantChannelGroupName) ? new Dictionary() { + {grantChannelGroupName, new PNTokenAuthValues() { Read = grantRead, Write = grantWrite, Manage= grantManage, Create = grantCreate, Delete=grantDelete, Get = grantGet, Update = grantUpdate, Join = grantJoin } } } : null, + Uuids = !string.IsNullOrEmpty(grantUuiIdEntry) ? new Dictionary() { + { grantUuiIdEntry, new PNTokenAuthValues() { Read = grantRead, Write = grantWrite, Manage= grantManage, Create = grantCreate, Delete=grantDelete, Get = grantGet, Update = grantUpdate, Join = grantJoin } } } : null, }) .Execute(new PNAccessManagerTokenResultExt((result, status) => { From 30995fb248edc5497cbe2b53c7256a0d9da5e961 Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Wed, 5 Jan 2022 18:42:02 +0530 Subject: [PATCH 14/15] minor typo yml update --- .pubnub.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index 37ae351a4..760f040df 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -672,7 +672,7 @@ sdks: distributions: - distribution-type: source - distribution-repository: Github + distribution-repository: GitHub package-name: Pubnub location: https://github.com/pubnub/c-sharp/releases/tag/v5.4.0.0 requires: @@ -1342,7 +1342,7 @@ sdks: distributions: - distribution-type: source - distribution-repository: Github + distribution-repository: GitHub package-name: PubnubUWP location: https://github.com/pubnub/c-sharp/releases/tag/v5.4.0.0 requires: From 5b008b140d8173ad5bd11da0ce750727bec7d8f8 Mon Sep 17 00:00:00 2001 From: Pandu Masabathula Date: Wed, 5 Jan 2022 18:49:07 +0530 Subject: [PATCH 15/15] Revert "minor typo yml update" This reverts commit 30995fb248edc5497cbe2b53c7256a0d9da5e961. --- .pubnub.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index 760f040df..37ae351a4 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -672,7 +672,7 @@ sdks: distributions: - distribution-type: source - distribution-repository: GitHub + distribution-repository: Github package-name: Pubnub location: https://github.com/pubnub/c-sharp/releases/tag/v5.4.0.0 requires: @@ -1342,7 +1342,7 @@ sdks: distributions: - distribution-type: source - distribution-repository: GitHub + distribution-repository: Github package-name: PubnubUWP location: https://github.com/pubnub/c-sharp/releases/tag/v5.4.0.0 requires: