Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly fail if all deployment manifests are excluded from signing #759

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion src/Sign.Core/DataFormatSigners/ClickOnceSigner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ await Parallel.ForEachAsync(files, _parallelOptions, async (file, state) =>
.Select(f => f.file)
.ToList();

// If the user supplies the path to a deployment manifest as the file to sign, and also supplies
// a file path filter via --file-list which DOES NOT match the deployment manifest path, then
// it won't be signed even though the rest of the files were. This is not an expected configuration
// so we should explicitly reject such a situation.
if (!deploymentManifestFiles.Any())
throw new InvalidOperationException(Resources.NoDeploymentManifestsSelectedForSigning);

foreach (FileInfo deploymentManifestFile in deploymentManifestFiles)
{
fileArgs = $@"-update ""{deploymentManifestFile.FullName}"" {args} {publisherParam}";
Expand Down Expand Up @@ -274,4 +281,4 @@ public void CopySigningDependencies(FileInfo deploymentManifestFile, DirectoryIn
}
}
}
}
}
18 changes: 18 additions & 0 deletions src/Sign.Core/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/Sign.Core/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,10 @@
<data name="VSIXSignToolUnsupportedAlgorithm" xml:space="preserve">
<value>The algorithm selected is not supported.</value>
</data>
<data name="ApplicationManifestNotFound" xml:space="preserve">
<value>Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</value>
</data>
<data name="NoDeploymentManifestsSelectedForSigning" xml:space="preserve">
<value>No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</value>
</data>
</root>
10 changes: 10 additions & 0 deletions src/Sign.Core/xlf/Resources.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="cs" original="../Resources.resx">
<body>
<trans-unit id="ApplicationManifestNotFound">
<source>Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</source>
<target state="new">Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</target>
<note />
</trans-unit>
<trans-unit id="AzureSignToolSignatureProviderSigning">
<source>Signing SignTool job with {count} files.</source>
<target state="translated">Podepisování úlohy SignTool s tímto počtem souborů: {count}.</target>
Expand Down Expand Up @@ -107,6 +112,11 @@
<target state="translated">Poskytlo se několik kontejnerů privátních klíčů. Pro úložiště uživatele použijte /k a pro úložiště počítače použijte /km.</target>
<note />
</trans-unit>
<trans-unit id="NoDeploymentManifestsSelectedForSigning">
<source>No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</source>
<target state="new">No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</target>
<note />
</trans-unit>
<trans-unit id="NoPrivateKeyContainerError">
<source>Private key container missing while using /csp. Use /k or /km to provide a key container.</source>
<target state="translated">Při použití /csp chybí kontejner privátního klíče. K poskytnutí kontejneru klíčů použijte /k nebo /km.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Sign.Core/xlf/Resources.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="de" original="../Resources.resx">
<body>
<trans-unit id="ApplicationManifestNotFound">
<source>Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</source>
<target state="new">Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</target>
<note />
</trans-unit>
<trans-unit id="AzureSignToolSignatureProviderSigning">
<source>Signing SignTool job with {count} files.</source>
<target state="translated">Der SignTool-Auftrag wird mit {count} Dateien signiert.</target>
Expand Down Expand Up @@ -107,6 +112,11 @@
<target state="translated">Es wurden mehrere Container mit privatem Schlüssel bereitgestellt. Verwenden Sie entweder "/k" für Benutzerspeicher oder "/km" für Computerspeicher.</target>
<note />
</trans-unit>
<trans-unit id="NoDeploymentManifestsSelectedForSigning">
<source>No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</source>
<target state="new">No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</target>
<note />
</trans-unit>
<trans-unit id="NoPrivateKeyContainerError">
<source>Private key container missing while using /csp. Use /k or /km to provide a key container.</source>
<target state="translated">Der Container für den privaten Schlüssel fehlt bei Verwendung von "/csp". Verwenden Sie "/k" oder "/km", um einen Schlüsselcontainer bereitzustellen.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Sign.Core/xlf/Resources.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="es" original="../Resources.resx">
<body>
<trans-unit id="ApplicationManifestNotFound">
<source>Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</source>
<target state="new">Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</target>
<note />
</trans-unit>
<trans-unit id="AzureSignToolSignatureProviderSigning">
<source>Signing SignTool job with {count} files.</source>
<target state="translated">Firmando el trabajo de SignTool con {count} archivos.</target>
Expand Down Expand Up @@ -107,6 +112,11 @@
<target state="translated">Se proporcionaron varios contenedores de clave privada. Use /k para almacenes de usuarios o /km para almacenes de máquinas.</target>
<note />
</trans-unit>
<trans-unit id="NoDeploymentManifestsSelectedForSigning">
<source>No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</source>
<target state="new">No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</target>
<note />
</trans-unit>
<trans-unit id="NoPrivateKeyContainerError">
<source>Private key container missing while using /csp. Use /k or /km to provide a key container.</source>
<target state="translated">Falta el contenedor de clave privada al usar /csp. Use /k o /km para proporcionar un contenedor de claves.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Sign.Core/xlf/Resources.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="fr" original="../Resources.resx">
<body>
<trans-unit id="ApplicationManifestNotFound">
<source>Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</source>
<target state="new">Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</target>
<note />
</trans-unit>
<trans-unit id="AzureSignToolSignatureProviderSigning">
<source>Signing SignTool job with {count} files.</source>
<target state="translated">Signature du travail SignTool avec {count} fichiers.</target>
Expand Down Expand Up @@ -107,6 +112,11 @@
<target state="translated">Plusieurs conteneurs de clé privée ont été fournis. Utilisez /k pour les magasins d’utilisateurs ou /km pour les magasins d’ordinateurs.</target>
<note />
</trans-unit>
<trans-unit id="NoDeploymentManifestsSelectedForSigning">
<source>No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</source>
<target state="new">No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</target>
<note />
</trans-unit>
<trans-unit id="NoPrivateKeyContainerError">
<source>Private key container missing while using /csp. Use /k or /km to provide a key container.</source>
<target state="translated">Le conteneur de clé privée est manquant lors de l’utilisation de /csp. Utilisez /k ou /km pour fournir un conteneur de clé.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Sign.Core/xlf/Resources.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="it" original="../Resources.resx">
<body>
<trans-unit id="ApplicationManifestNotFound">
<source>Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</source>
<target state="new">Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</target>
<note />
</trans-unit>
<trans-unit id="AzureSignToolSignatureProviderSigning">
<source>Signing SignTool job with {count} files.</source>
<target state="translated">Firma del processo SignTool con {count} file.</target>
Expand Down Expand Up @@ -107,6 +112,11 @@
<target state="translated">Sono stati specificati più contenitori di chiavi private. Utilizzare /k per gli archivi utente o /km per gli archivi computer.</target>
<note />
</trans-unit>
<trans-unit id="NoDeploymentManifestsSelectedForSigning">
<source>No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</source>
<target state="new">No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</target>
<note />
</trans-unit>
<trans-unit id="NoPrivateKeyContainerError">
<source>Private key container missing while using /csp. Use /k or /km to provide a key container.</source>
<target state="translated">Contenitore di chiavi private mancante durante l'utilizzo di /csp. Usare /k o /km per specificare un contenitore di chiavi.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Sign.Core/xlf/Resources.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ja" original="../Resources.resx">
<body>
<trans-unit id="ApplicationManifestNotFound">
<source>Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</source>
<target state="new">Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</target>
<note />
</trans-unit>
<trans-unit id="AzureSignToolSignatureProviderSigning">
<source>Signing SignTool job with {count} files.</source>
<target state="translated">{count} 個のファイルを使用して SignTool ジョブに署名しています。</target>
Expand Down Expand Up @@ -107,6 +112,11 @@
<target state="translated">複数の秘密キー コンテナーが提供されています。ユーザー ストアの場合は /k、コンピューター ストアの場合は /km を使用します。</target>
<note />
</trans-unit>
<trans-unit id="NoDeploymentManifestsSelectedForSigning">
<source>No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</source>
<target state="new">No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</target>
<note />
</trans-unit>
<trans-unit id="NoPrivateKeyContainerError">
<source>Private key container missing while using /csp. Use /k or /km to provide a key container.</source>
<target state="translated">/csp の使用中に秘密キー コンテナーが見つかりません。キー コンテナーを指定するには、/k または /km を使用します。</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Sign.Core/xlf/Resources.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ko" original="../Resources.resx">
<body>
<trans-unit id="ApplicationManifestNotFound">
<source>Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</source>
<target state="new">Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</target>
<note />
</trans-unit>
<trans-unit id="AzureSignToolSignatureProviderSigning">
<source>Signing SignTool job with {count} files.</source>
<target state="translated">{count} 파일로 SignTool 작업에 서명하는 중입니다.</target>
Expand Down Expand Up @@ -107,6 +112,11 @@
<target state="translated">여러 프라이빗 키 컨테이너가 제공되었습니다. 사용자 저장소에는 /k를, 컴퓨터 저장소에는 /km를 사용합니다.</target>
<note />
</trans-unit>
<trans-unit id="NoDeploymentManifestsSelectedForSigning">
<source>No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</source>
<target state="new">No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</target>
<note />
</trans-unit>
<trans-unit id="NoPrivateKeyContainerError">
<source>Private key container missing while using /csp. Use /k or /km to provide a key container.</source>
<target state="translated">/csp를 사용하는 동안 프라이빗 키 컨테이너가 없습니다. /k 또는 /km를 사용하여 키 컨테이너를 제공합니다.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Sign.Core/xlf/Resources.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pl" original="../Resources.resx">
<body>
<trans-unit id="ApplicationManifestNotFound">
<source>Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</source>
<target state="new">Did not find exactly 1 &lt;dependentAssembly&gt; element with a non-empty 'codebase' attribute within the deployment manifest.</target>
<note />
</trans-unit>
<trans-unit id="AzureSignToolSignatureProviderSigning">
<source>Signing SignTool job with {count} files.</source>
<target state="translated">Podpisywanie zadania SignTool przy użyciu {count} plików.</target>
Expand Down Expand Up @@ -107,6 +112,11 @@
<target state="translated">Podano wiele kontenerów kluczy prywatnych. Użyj opcji /k dla magazynów użytkowników lub opcji /km dla magazynów komputerów.</target>
<note />
</trans-unit>
<trans-unit id="NoDeploymentManifestsSelectedForSigning">
<source>No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</source>
<target state="new">No deployment manifest files have been detected for signing, possibly because they've been excluded via file path filters</target>
<note />
</trans-unit>
<trans-unit id="NoPrivateKeyContainerError">
<source>Private key container missing while using /csp. Use /k or /km to provide a key container.</source>
<target state="translated">Brak kontenera kluczy prywatnych podczas używania opcji /csp. Użyj opcji /k lub /km, aby podać kontener kluczy.</target>
Expand Down
Loading