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

Commit 3fc6b82

Browse files
author
Isaiah Williams
authored
Token feature update (#255)
1 parent 8cc860a commit 3fc6b82

7 files changed

Lines changed: 43 additions & 15 deletions

File tree

docs/help/Connect-PartnerCenter.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ Connect-PartnerCenter -AccessToken <String> [-Environment <EnvironmentName>] [-T
2828

2929
### RefreshToken
3030
```powershell
31-
Connect-PartnerCenter -ApplicationId <String> [-Credential <PSCredential>] [-Environment <EnvironmentName>]
32-
-RefreshToken <String> [-Tenant <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
31+
Connect-PartnerCenter -ApplicationId <String> [-CertificateThumbprint <String>] [-Credential <PSCredential>]
32+
[-Environment <EnvironmentName>] -RefreshToken <String> [-Tenant <String>] [-WhatIf] [-Confirm]
33+
[<CommonParameters>]
3334
```
3435

3536
### ServicePrincipalCertificate
@@ -121,6 +122,18 @@ Accept wildcard characters: False
121122
### -CertificateThumbprint
122123
Certificate Hash (Thumbprint)
123124
125+
```yaml
126+
Type: String
127+
Parameter Sets: RefreshToken
128+
Aliases:
129+
130+
Required: False
131+
Position: Named
132+
Default value: None
133+
Accept pipeline input: False
134+
Accept wildcard characters: False
135+
```
136+
124137
```yaml
125138
Type: String
126139
Parameter Sets: ServicePrincipalCertificate

docs/help/New-PartnerAccessToken.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ New-PartnerAccessToken -AccessToken <String> -ApplicationId <String> [-Credentia
2222

2323
### RefreshToken
2424
```powershell
25-
New-PartnerAccessToken [-ApplicationId <String>] [-Credential <PSCredential>] [-Environment <EnvironmentName>]
26-
[-Module <ModuleName>] -RefreshToken <String> -Scopes <String[]> [-ServicePrincipal] [-Tenant <String>]
27-
[<CommonParameters>]
25+
New-PartnerAccessToken [-ApplicationId <String>] [-CertificateThumbprint <String>] [-Credential <PSCredential>]
26+
[-Environment <EnvironmentName>] [-Module <ModuleName>] -RefreshToken <String> -Scopes <String[]>
27+
[-ServicePrincipal] [-Tenant <String>] [<CommonParameters>]
2828
```
2929

3030
### ServicePrincipal
@@ -47,8 +47,8 @@ New-PartnerAccessToken -ApplicationId <String> [-Environment <EnvironmentName>]
4747

4848
### ByModule
4949
```powershell
50-
New-PartnerAccessToken [-Environment <EnvironmentName>] -Module <ModuleName> -Scopes <String[]>
51-
[-Tenant <String>] [-UseAuthorizationCode] [<CommonParameters>]
50+
New-PartnerAccessToken [-Environment <EnvironmentName>] -Module <ModuleName> [-Tenant <String>]
51+
[-UseAuthorizationCode] [<CommonParameters>]
5252
```
5353

5454
## DESCRIPTION
@@ -122,6 +122,18 @@ Accept wildcard characters: False
122122
### -CertificateThumbprint
123123
Certificate Hash (Thumbprint)
124124
125+
```yaml
126+
Type: String
127+
Parameter Sets: RefreshToken
128+
Aliases:
129+
130+
Required: False
131+
Position: Named
132+
Default value: None
133+
Accept pipeline input: False
134+
Accept wildcard characters: False
135+
```
136+
125137
```yaml
126138
Type: String
127139
Parameter Sets: ServicePrincipalCertificate
@@ -226,7 +238,7 @@ Scopes requested to access a protected API.
226238
227239
```yaml
228240
Type: String[]
229-
Parameter Sets: (All)
241+
Parameter Sets: AccessToken, RefreshToken, ServicePrincipal, ServicePrincipalCertificate, User
230242
Aliases:
231243

232244
Required: True

src/PowerShell/Commands/NewPartnerAccessToken.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ public class NewPartnerAccessToken : PartnerAsyncCmdlet
115115
/// <summary>
116116
/// Gets or sets the scopes used for authentication.
117117
/// </summary>
118-
[Parameter(HelpMessage = "Scopes requested to access a protected API.", Mandatory = true)]
118+
[Parameter(HelpMessage = "Scopes requested to access a protected API.", Mandatory = true, ParameterSetName = AccessTokenParameterSet)]
119+
[Parameter(HelpMessage = "Scopes requested to access a protected API.", Mandatory = true, ParameterSetName = RefreshTokenParameterSet)]
120+
[Parameter(HelpMessage = "Scopes requested to access a protected API.", Mandatory = true, ParameterSetName = ServicePrincipalParameterSet)]
121+
[Parameter(HelpMessage = "Scopes requested to access a protected API.", Mandatory = true, ParameterSetName = ServicePrincipalCertificateParameterSet)]
122+
[Parameter(HelpMessage = "Scopes requested to access a protected API.", Mandatory = true, ParameterSetName = UserParameterSet)]
119123
public string[] Scopes { get; set; }
120124

121125
/// <summary>

src/PowerShell/Commands/PartnerPSCmdlet.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ protected override void BeginProcessing()
194194

195195
if (!string.IsNullOrEmpty(PartnerSession.Instance?.Context?.Account?.Identifier))
196196
{
197-
qosEvent.UserId = GenerateSha256HashString(PartnerSession.Instance.Context.Account.Identifier);
197+
qosEvent.UserId = GenerateSha256HashString(PartnerSession.Instance.Context.Account.Identifier)?.Replace("-", string.Empty)?.ToLowerInvariant();
198198
}
199199

200200
if (MyInvocation != null && MyInvocation.BoundParameters != null && MyInvocation.BoundParameters.Keys != null)
@@ -271,7 +271,6 @@ protected override void StopProcessing()
271271
base.StopProcessing();
272272
}
273273

274-
275274
/// <summary>
276275
/// Terminate the command and report an error.
277276
/// </summary>

src/PowerShell/PartnerCenter.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 01/08/2010
6+
# Generated on: 01/10/2010
77
#
88

99
@{
1010
# Script module or binary module file associated with this manifest.
1111
RootModule = 'PartnerCenter.psm1'
1212

1313
# Version number of this module.
14-
ModuleVersion = '3.0.4'
14+
ModuleVersion = '3.0.5'
1515

1616
# Supported PSEditions
1717
CompatiblePSEditions = 'Core', 'Desktop'

src/PowerShell/PartnerCenter.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 01/08/2020
6+
# Generated on: 01/10/2020
77
#
88

99
$PSDefaultParameterValues.Clear()

src/PowerShell/PowerShell.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
1919
<OutputPath>$(RepoArtifacts)$(Configuration)\</OutputPath>
2020
<PublishDir>$(OutputPath)</PublishDir>
21-
<Version>3.0.4</Version>
21+
<Version>3.0.5</Version>
2222
<LangVersion>latest</LangVersion>
2323
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2424
</PropertyGroup>

0 commit comments

Comments
 (0)