You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
/// This is a proxy function that downloads the pwa_builder.exe command line utility for packaging PWAs for the Microsoft Store. This utility is not publicly available per request of its authors, the Microsoft Edge team.
29
+
/// The proxy is needed because the CLI is stored on a private Azure Blob Storage container that requires authentication and private virtual network to access.
30
+
///
31
+
/// This endpoint is used by the GitHub Action YML file that deploys PWABuilder MSStore packaging platform: https://github.com/pwa-builder/PWABuilder/blob/main/.github/workflows/deploy-msstore-to-preview.yml
32
+
/// Since the GitHub Action cannot access the private storage container directly, it calls this endpoint to download the CLI using a private key. The private key is stored in two places:
33
+
/// - GitHub repo's secrets - in order for the GitHub Action to access it
34
+
/// - In the Azure web app `pwabuilder` -> Environment Variables, under AppSettings__PWABuilderCliKey - in order for this code to validate the key.
35
+
/// </summary>
36
+
/// <param name="options"></param>
37
+
/// <returns></returns>
38
+
39
+
[HttpGet("cli")]
40
+
publicasyncTask<IActionResult>GetCli(stringkey)
41
+
{
42
+
// Validate the key.
43
+
if(key!=cliKey)
44
+
{
45
+
logger.LogWarning("Unauthorized attempt to download pwabuilder.exe CLI with invalid key.");
Copy file name to clipboardExpand all lines: apps/pwabuilder/Program.cs
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,9 @@
46
46
47
47
// In development, we use an in-memory database for Analysis objects. This makes local development and testing simpler, as we don't need to connect to Redis.
/// Interface for accessing Azure Storage. When in local development, this will be implemented as an in-memory store. Otherwise, it will access the Azure Storage account for PWABuilder using Managed Identity.