Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 8cc860a

Browse files
author
Isaiah Williams
authored
Release update (#250)
1 parent 905afa3 commit 8cc860a

32 files changed

Lines changed: 226 additions & 80 deletions

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
# Change Log
2222

23-
## Upcoming Release
23+
## 3.0.4 January 2020
2424

2525
* Authentication
2626
* Addressed an issue where NullReferenceException exception was being encountered when invoking [Connect-PartnerCenter](https://docs.microsoft.com/powershell/module/partnercenter/Connect-PartnerCenter) using a certificate

src/PowerShell/Authenticators/AccessTokenAuthenticator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ namespace Microsoft.Store.PartnerCenter.PowerShell.Authenticators
77
using System.Security.Claims;
88
using System.Threading;
99
using System.Threading.Tasks;
10+
using Exceptions;
1011
using Extensions;
1112
using Identity.Client;
1213
using IdentityModel.JsonWebTokens;
1314
using Models.Authentication;
14-
using PartnerCenter.Exceptions;
1515
using Rest;
1616

1717
/// <summary>
@@ -38,7 +38,7 @@ public override async Task<AuthenticationResult> AuthenticateAsync(Authenticatio
3838

3939
if (DateTimeOffset.UtcNow > token.ValidTo)
4040
{
41-
throw new PartnerException("The access token has expired. Generate a new one and try again.");
41+
throw new PartnerPowerShellException("The access token has expired. Generate a new one and try again.", PartnerPowerShellErrorCategory.TokenExpired);
4242
}
4343

4444
await Task.CompletedTask.ConfigureAwait(false);

src/PowerShell/Authenticators/DefaultAuthenticatorBuilder.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,11 @@ public void AppendAuthenticator(Func<IAuthenticator> constructor)
4444

4545
IAuthenticator current;
4646

47-
48-
for (current = Authenticator; current != null && current.Next != null; current = current.Next)
47+
for (current = Authenticator; current != null && current.NextAuthenticator != null; current = current.NextAuthenticator)
4948
{
50-
;
5149
}
5250

53-
current.Next = constructor();
54-
return;
51+
current.NextAuthenticator = constructor();
5552
}
5653
}
5754
}

src/PowerShell/Authenticators/DelegatingAuthenticator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal abstract class DelegatingAuthenticator : IAuthenticator
1919
/// <summary>
2020
/// Gets or sets the next authenticator in the chain.
2121
/// </summary>
22-
public IAuthenticator Next { get; set; }
22+
public IAuthenticator NextAuthenticator { get; set; }
2323

2424
/// <summary>
2525
/// Apply this authenticator to the given authentication parameters.
@@ -84,9 +84,9 @@ public async Task<AuthenticationResult> TryAuthenticateAsync(AuthenticationParam
8484
return await AuthenticateAsync(parameters, cancellationToken).ConfigureAwait(false);
8585
}
8686

87-
if (Next != null)
87+
if (NextAuthenticator != null)
8888
{
89-
return await Next.TryAuthenticateAsync(parameters, cancellationToken).ConfigureAwait(false);
89+
return await NextAuthenticator.TryAuthenticateAsync(parameters, cancellationToken).ConfigureAwait(false);
9090
}
9191

9292
return null;

src/PowerShell/Authenticators/IAuthenticator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public interface IAuthenticator
1515
/// <summary>
1616
/// Gets or sets the next authenticator in the chain.
1717
/// </summary>
18-
IAuthenticator Next { get; set; }
18+
IAuthenticator NextAuthenticator { get; set; }
1919

2020
/// <summary>
2121
/// Apply this authenticator to the given authentication parameters.

src/PowerShell/Commands/ConnectPartnerCenter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ namespace Microsoft.Store.PartnerCenter.PowerShell.Commands
88
using System.Management.Automation;
99
using System.Reflection;
1010
using System.Text.RegularExpressions;
11-
using Exceptions;
1211
using Extensions;
1312
using Factories;
1413
using Models.Authentication;
14+
using PartnerCenter.Exceptions;
1515
using PartnerCenter.Models.Partners;
1616
using Utilities;
1717

src/PowerShell/Commands/DisconnectPartnerCenter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ protected override void ProcessRecord()
1818
if (ShouldProcess(Resources.DisconnectWhatIf))
1919
{
2020
PartnerSession.Instance.Context = null;
21-
PartnerService.Instance.EnforceMfa = false;
2221
}
2322
}
2423
}

src/PowerShell/Commands/GetPartnerInvoiceLineItem.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace Microsoft.Store.PartnerCenter.PowerShell.Commands
1111
using PartnerCenter.Enumerators;
1212
using PartnerCenter.Models;
1313
using PartnerCenter.Models.Invoices;
14+
using RequestContext;
1415

1516
/// <summary>
1617
/// Gets a list of line items for the specified invoice from Partner Center.
@@ -78,7 +79,7 @@ public override void ExecuteCmdlet()
7879
while (enumerator.HasValue)
7980
{
8081
items.AddRange(enumerator.Current.Items);
81-
await enumerator.NextAsync(null, CancellationToken).ConfigureAwait(false);
82+
await enumerator.NextAsync(RequestContextFactory.Create(CorrelationId), CancellationToken).ConfigureAwait(false);
8283
}
8384

8485
if (LineItemType == InvoiceLineItemType.BillingLineItems)

src/PowerShell/Commands/NewPartnerAccessToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ private static string ExtractExistingOrEmptyString(JObject json, string key)
312312
if (json.TryGetValue(key, out JToken val))
313313
{
314314
json.Remove(key);
315-
return val.ToObject<string>(); ;
315+
return val.ToObject<string>();
316316
}
317317

318318
return string.Empty;

src/PowerShell/Commands/NewPartnerCustomer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ namespace Microsoft.Store.PartnerCenter.PowerShell.Commands
77
using System.Globalization;
88
using System.Management.Automation;
99
using System.Text.RegularExpressions;
10+
using Exceptions;
1011
using Models.Authentication;
1112
using Models.Customers;
12-
using PartnerCenter.Exceptions;
1313
using PartnerCenter.Models;
1414
using Properties;
1515
using Validations;
@@ -212,7 +212,7 @@ public override void ExecuteCmdlet()
212212

213213
if (!await validator.IsValidAsync(customer.BillingProfile.DefaultAddress, CancellationToken).ConfigureAwait(false))
214214
{
215-
throw new PartnerException("The address for the customer is not valid.");
215+
throw new PartnerPowerShellException("The address for the customer is not valid.", PartnerPowerShellErrorCategory.Validation);
216216
}
217217
}
218218

0 commit comments

Comments
 (0)