diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c6a4fc07..2a45b20a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,6 +51,7 @@ jobs: run: ./scripts/Write-Secrets.ps1 env: GOOGLE_DRIVE_API_SECRET: ${{ secrets.GOOGLE_DRIVE_API_SECRET }} + GITHUB_OAUTH_SECRET: ${{ secrets.MY_GITHUB_OAUTH_SECRET }} - name: Build Solution run: dotnet build -c Release -property:Version="${{ steps.get-build-version.outputs.build-version }}" -warnaserror diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 855fe117..bd408329 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -46,6 +46,7 @@ jobs: run: ./scripts/Write-Secrets.ps1 env: GOOGLE_DRIVE_API_SECRET: ${{ secrets.GOOGLE_DRIVE_API_SECRET }} + GITHUB_OAUTH_SECRET: ${{ secrets.MY_GITHUB_OAUTH_SECRET }} - name: Build Solution run: dotnet build -c Release -warnaserror diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bbea3d5d..12b68642 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,6 +47,7 @@ jobs: run: ./scripts/Write-Secrets.ps1 env: GOOGLE_DRIVE_API_SECRET: ${{ secrets.GOOGLE_DRIVE_API_SECRET }} + GITHUB_OAUTH_SECRET: ${{ secrets.MY_GITHUB_OAUTH_SECRET }} - name: Build Solution run: dotnet build -c Release -property:Version="${{ steps.get-build-version.outputs.build-version }}" -warnaserror diff --git a/scripts/Write-Secrets.ps1 b/scripts/Write-Secrets.ps1 index 3d28559b..697aeedb 100644 --- a/scripts/Write-Secrets.ps1 +++ b/scripts/Write-Secrets.ps1 @@ -17,6 +17,7 @@ $ReplacementScriptBlock = { switch ($SecretName) { "GOOGLE_DRIVE_API_SECRET" { $SecretValue = $env:GOOGLE_DRIVE_API_SECRET } + "GITHUB_OAUTH_SECRET" { $SecretValue = $env:GITHUB_OAUTH_SECRET } default { throw "Invalid secret name $SecretName" } } diff --git a/src/Tql.App/Services/Synchronization/GoogleDriveBackupProvider.cs b/src/Tql.App/Services/Synchronization/GoogleDriveBackupProvider.cs index 9f696415..1fa30c60 100644 --- a/src/Tql.App/Services/Synchronization/GoogleDriveBackupProvider.cs +++ b/src/Tql.App/Services/Synchronization/GoogleDriveBackupProvider.cs @@ -57,7 +57,7 @@ private Task GetCredentials(CancellationToken cancellationToken) private string GetClientSecret() { -#if !DEBUG +#if DEBUG return Environment.GetEnvironmentVariable("GOOGLE_DRIVE_API_SECRET")!; #else return Encoding diff --git a/src/Tql.DebugApp/packages.lock.json b/src/Tql.DebugApp/packages.lock.json index dccb85d3..134cbc3a 100644 --- a/src/Tql.DebugApp/packages.lock.json +++ b/src/Tql.DebugApp/packages.lock.json @@ -805,6 +805,15 @@ "resolved": "6.8.0", "contentHash": "WBu15cdv1lqKkPKXDQOEmEzwKemwrczKYlc2jtuZgRYiZ8TG8F4QzPYiE0Q9eVIpMSk8Aky7mUephf19HjBPOw==" }, + "OAuth2": { + "type": "Transitive", + "resolved": "0.10.3", + "contentHash": "Yg5OaNfNrUq2HN0LNcxGL9plMh3XC9fja1/iTVZB96D7UwIxk0iq9irN0EbvardXlALUIIv3NKz6CVRHk+1Mxg==", + "dependencies": { + "Newtonsoft.Json": "13.0.2", + "RestSharp": "106.12.0" + } + }, "Octokit": { "type": "Transitive", "resolved": "9.0.0", @@ -818,6 +827,11 @@ "Newtonsoft.Json": "13.0.1" } }, + "RestSharp": { + "type": "Transitive", + "resolved": "106.12.0", + "contentHash": "irOsQHe5nTJB0BKxGQnTX1dsgCPl5dLTxvL7gbl98JiFPiHMN4wpFyUG/66ZpaFCsIrPKh6XwozWXlwYe9JwYQ==" + }, "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", "resolved": "4.3.0", @@ -1991,6 +2005,7 @@ "type": "Project", "dependencies": { "HtmlAgilityPack": "[1.11.54, )", + "OAuth2": "[0.10.3, )", "Octokit": "[9.0.0, )", "Octokit.GraphQL": "[0.3.0-beta, )", "TQLApp.Utilities": "[0.0.0, )" diff --git a/src/Tql.Plugins.GitHub/ConfigurationUI/DeviceCodeWindow.xaml b/src/Tql.Plugins.GitHub/ConfigurationUI/DeviceCodeWindow.xaml deleted file mode 100644 index 8bfc17d1..00000000 --- a/src/Tql.Plugins.GitHub/ConfigurationUI/DeviceCodeWindow.xaml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -