Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
cfffb7e
adding codesigning module
DawnWang17 Mar 31, 2023
6785a9e
added azure codesigning sdk for debugging
DawnWang17 Mar 31, 2023
b8a8040
added CI signing
DawnWang17 Apr 4, 2023
a818fb3
fixed token error
DawnWang17 Apr 6, 2023
f8ddb8a
fixed ACS SDK version issue
DawnWang17 Apr 6, 2023
ce01d7b
added retry
DawnWang17 Apr 6, 2023
1c48841
fixed retry and added metadata json file supports
DawnWang17 Apr 6, 2023
1e4a3b5
added signed version dlls
DawnWang17 Apr 7, 2023
7f8bbfa
added missing dll
DawnWang17 Apr 7, 2023
847a2bd
removed DLLs from the library folder
DawnWang17 Apr 7, 2023
d753e4d
changed to use newtonjson instead of system.text for Windows PowerShell
DawnWang17 Apr 7, 2023
5c4e970
fixed provider version
DawnWang17 Apr 11, 2023
6da9a4f
remove polly
DawnWang17 Apr 11, 2023
8f23d50
Revert "Upadte NewtonSoft.Json to 13.0.2 (#21479)"
DawnWang17 Apr 12, 2023
847d242
changes as per feedback - cmdlet name and output
DawnWang17 Apr 14, 2023
4ddb7c9
fixed cmdlets format and output, and added help files
DawnWang17 Apr 18, 2023
549f5bf
removed sdk
DawnWang17 Apr 19, 2023
307820f
chore: fixes and package updates for dependencies
Jaxelr Jan 9, 2024
0d1d83e
docs: update changelog with preview information
Jaxelr Jan 9, 2024
85893e0
chore: added licensing header information to source files missing it
Jaxelr Jan 9, 2024
86295ea
chore: modify psd1 to same version as changelog doc
Jaxelr Jan 9, 2024
75db388
chore: remove unused project
Jaxelr Jan 9, 2024
7d28ec4
fix: reverting files that shouldnt have been modified
Jaxelr Jan 10, 2024
6731d57
style: remove whitespaces
Jaxelr Jan 10, 2024
468ef02
chore: removed moq from src
Jaxelr Jan 10, 2024
c1ae8d3
chore: remove unneeded markdown file
Jaxelr Jan 10, 2024
9bebd86
fix: corrected parameter order per review feedback
Jaxelr Jan 11, 2024
08731ba
fix: removed dependency on Azure.Core and Msal
Jaxelr Jan 11, 2024
08d7a36
style: remove whitespaces
Jaxelr Jan 11, 2024
d048751
refactor: removed unused dependency
Jaxelr Jan 11, 2024
cb0cc40
style : remove unused referenced namespaces & whitespaces
Jaxelr Jan 11, 2024
36f0c30
style: removel of unused namespaces
Jaxelr Jan 12, 2024
0f8237b
refactor: moving from internal libs to nuget
Jaxelr Jan 24, 2024
e941c1e
refactor: minor simplification of code
Jaxelr Jan 24, 2024
4d2e5fc
fix: test definition for Get-AzCodeSigningCustomerEku
Jaxelr Jan 29, 2024
477bfa7
refactor: removing unit tests from codebase since they dont use TestFx
Jaxelr Jan 30, 2024
05f1dd4
chore: bump to Polly version 7.2.4
Jaxelr Jan 30, 2024
ae4cc4d
fix: remove unused props
Jaxelr Jan 30, 2024
d54ebd2
chore: Adding Common tasks to ps1
Jaxelr Jan 30, 2024
4bc0419
feat: added code sign root cert test
Jaxelr Jan 31, 2024
25a6b66
fix: Assert logic for CodeSigning Eku test
Jaxelr Jan 31, 2024
53473fd
chore: removing UX since its for resource management
Jaxelr Feb 1, 2024
b6ab0c1
fix: removing unneeded directories
Jaxelr Feb 1, 2024
98c99c1
refactor: modified tests category to LiveOnly
Jaxelr Feb 1, 2024
aeb9701
fix: remove unneeded files from copied repo
Jaxelr Feb 1, 2024
522ad39
Update src/CodeSigning/CodeSigning/help/Invoke-AzCodeSigningCIPolicyS…
wyunchi-ms Feb 2, 2024
4c7726d
Update src/CodeSigning/CodeSigning/help/Get-AzCodeSigningRootCert.md
wyunchi-ms Feb 2, 2024
e204be3
Update src/CodeSigning/CodeSigning/help/Get-AzCodeSigningCustomerEku.md
wyunchi-ms Feb 2, 2024
164ef11
Update src/CodeSigning/CodeSigning/help/Invoke-AzCodeSigningCIPolicyS…
wyunchi-ms Feb 2, 2024
12ccbf9
Update src/CodeSigning/CodeSigning/help/Get-AzCodeSigningCustomerEku.md
wyunchi-ms Feb 2, 2024
7ec8e9f
Update src/CodeSigning/CodeSigning/help/Get-AzCodeSigningRootCert.md
wyunchi-ms Feb 2, 2024
8a94301
Update Get-AzCodeSigningRootCert.md
wyunchi-ms Feb 2, 2024
1bd1b2e
Update Invoke-AzCodeSigningCIPolicySigning.md
wyunchi-ms Feb 2, 2024
db98084
Update Get-AzCodeSigningCustomerEku.md
wyunchi-ms Feb 5, 2024
08cadf3
Update Get-AzCodeSigningRootCert.md
wyunchi-ms Feb 5, 2024
062b754
Update Invoke-AzCodeSigningCIPolicySigning.md
wyunchi-ms Feb 5, 2024
fa74582
Update Get-AzCodeSigningCustomerEku.md
wyunchi-ms Feb 5, 2024
993c5b1
docs: fix help command markdowns
Jaxelr Feb 5, 2024
76bdcfb
fix: modified code signing customer eku operation to return string array
Jaxelr Feb 5, 2024
623d475
docs: corrected examples per guidance.
Jaxelr Feb 6, 2024
ceaead4
chore: remove unused constants
Jaxelr Feb 7, 2024
15c923c
refactor: simplified object creation
Jaxelr Feb 7, 2024
00f6265
style: remove unused namespace, added space between props
Jaxelr Feb 7, 2024
5b7a301
refactor: removed positions 4 and 5 from invoke ci policy signing
Jaxelr Feb 7, 2024
1dbd7fa
chore: bump Azure.CodeSigning.Client.CryptoProvider to version 0.1.16
Jaxelr Feb 7, 2024
9b14dbe
chore: added module exception for static analysis
Jaxelr Feb 9, 2024
9ab298d
Update src/CodeSigning/CodeSigning/ChangeLog.md
Jaxelr Feb 12, 2024
06ac441
fix: per PR feedback, removing unused ps1
Jaxelr Feb 12, 2024
a34ba65
chore: remove unused classes
Jaxelr Feb 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/CodeSigning/CodeSigning.Test/CodeSigning.Test.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PsModuleName>CodeSigning</PsModuleName>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\Az.Test.props" />

<PropertyGroup>
<RootNamespace>$(LegacyAssemblyPrefix)$(PsModuleName)$(AzTestAssemblySuffix)</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Models\**" />
<Compile Remove="Resources\**" />
<Compile Remove="Scripts\**" />
<Compile Remove="SessionRecords\**" />
<EmbeddedResource Remove="Models\**" />
<EmbeddedResource Remove="Resources\**" />
<EmbeddedResource Remove="Scripts\**" />
<EmbeddedResource Remove="SessionRecords\**" />
<None Remove="Models\**" />
<None Remove="Resources\**" />
<None Remove="Scripts\**" />
<None Remove="SessionRecords\**" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CodeSigning\CodeSigning.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="ScenarioTests\" />
</ItemGroup>
</Project>
121 changes: 121 additions & 0 deletions src/CodeSigning/CodeSigning.Test/Resource.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema

Version 2.0

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>

There are any number of "resheader" rows that contain simple
name/value pairs.

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.TestFx;
using Xunit.Abstractions;

namespace Microsoft.Azure.Commands.CodeSigning.Test.ScenarioTests
{
public class CodeSigningTestRunner
{
protected readonly ITestRunner TestRunner;

protected CodeSigningTestRunner(ITestOutputHelper output)
{
TestRunner = TestManager.CreateInstance(output)
.WithNewPsScriptFilename($"{GetType().Name}.ps1")
.WithProjectSubfolderForTests("ScenarioTests")
.WithCommonPsScripts(new[]
{
@"../AzureRM.Resources.ps1"
})
.WithNewRmModules(helper => new[]
{
helper.RMProfileModule,
helper.GetRMModulePath("Az.CodeSigning.psd1"),
})
.Build();
}
}
}
40 changes: 40 additions & 0 deletions src/CodeSigning/CodeSigning.Test/ScenarioTests/CodeSigningTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;

namespace Microsoft.Azure.Commands.CodeSigning.Test.ScenarioTests
{
public class CodeSigningTests: CodeSigningTestRunner
{
public CodeSigningTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
{
}

[Fact]
[Trait(Category.AcceptanceType, Category.LiveOnly)]
public void TestCodeSigningEku()
{
TestRunner.RunTestScript("Test-CodeSigningEku");
}

[Fact]
[Trait(Category.AcceptanceType, Category.LiveOnly)]
public void TestGetSigningRootCertificate()
{
TestRunner.RunTestScript("Test-GetCodeSigningRootCert");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------

<#
.SYNOPSIS
Test codesigning command to get extended key usage from the certificate profile
#>
function Test-CodeSigningEku {

$accountName = "acs-test-account"
$profileName = "acs-test-account-ci"
$endPointUrl = "https://scus.codesigning.azure.net/"
$expectedEku = "1.3.6.1.4.1.311.97.1.3.1.29433.35007.34545.16815.37291.11644.53265.56135,1.3.6.1.4.1.311.97.1.4.1.29433.35007.34545.16815.37291.11644.53265.56135"

try {
# Test Get CodeSigning Eku
$eku = Get-AzCodeSigningCustomerEku -AccountName $accountName -ProfileName $profileName -EndpointUrl $endPointUrl
Assert-AreEqual $eku $expectedEku
}

finally {

}
}

<#
.SYNOPSIS
Test codesigning command to get the root certificate from the certificate profile
#>
function Test-GetCodeSigningRootCert {
$accountName = "acs-test-account"
$profileName = "acs-test-account-ci"
$endPointUrl = "https://scus.codesigning.azure.net/"
$destination = "C:\temp"

try {
# Test Get CodeSigning Root Cert
$cert = Get-AzCodeSigningRootCert -AccountName $accountName -ProfileName $profileName -EndpointUrl $endPointUrl -Destination $destination
Assert-NotNullOrEmpty $cert
}

finally {

}
}
Loading