Skip to content

Commit

Permalink
Remove erroneous config warnings from social authentication modules (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytes1027 authored Jan 7, 2025
1 parent 4f7b1a7 commit b3d6591
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 81 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* GHColors theme by Avi Aryan (http://aviaryan.in)
* Inspired by Github syntax coloring
* Inspired by GitHub syntax coloring
*/

code[class*="language-"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using OrchardCore.Environment.Shell;
using OrchardCore.Facebook.Settings;

namespace OrchardCore.Facebook.Services;

public sealed class FacebookSettingsConfiguration : IConfigureOptions<FacebookSettings>
{
private readonly IFacebookService _facebookService;
private readonly ShellSettings _shellSettings;
private readonly ILogger _logger;

public FacebookSettingsConfiguration(
IFacebookService facebookService,
ShellSettings shellSettings,
ILogger<FacebookSettingsConfiguration> logger)
public FacebookSettingsConfiguration(IFacebookService facebookService)
{
_facebookService = facebookService;
_shellSettings = shellSettings;
_logger = logger;
}

public void Configure(FacebookSettings options)
Expand All @@ -45,11 +36,6 @@ private async Task<FacebookSettings> GetFacebookSettingsAsync()

if (_facebookService.ValidateSettings(settings).Any(result => result != ValidationResult.Success))
{
if (_shellSettings.IsRunning())
{
_logger.LogWarning("Facebook is not correctly configured.");
}

return null;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using OrchardCore.Environment.Shell;
using OrchardCore.GitHub.Services;
using OrchardCore.GitHub.Settings;

Expand All @@ -10,17 +8,10 @@ namespace OrchardCore.GitHub.Configuration;
public sealed class GitHubAuthenticationSettingsConfiguration : IConfigureOptions<GitHubAuthenticationSettings>
{
private readonly IGitHubAuthenticationService _gitHubAuthenticationService;
private readonly ShellSettings _shellSettings;
private readonly ILogger _logger;

public GitHubAuthenticationSettingsConfiguration(
IGitHubAuthenticationService gitHubAuthenticationService,
ShellSettings shellSettings,
ILogger<GitHubAuthenticationSettingsConfiguration> logger)
public GitHubAuthenticationSettingsConfiguration(IGitHubAuthenticationService gitHubAuthenticationService)
{
_gitHubAuthenticationService = gitHubAuthenticationService;
_shellSettings = shellSettings;
_logger = logger;
}

public void Configure(GitHubAuthenticationSettings options)
Expand All @@ -44,11 +35,6 @@ private async Task<GitHubAuthenticationSettings> GetGitHubAuthenticationSettings

if ((_gitHubAuthenticationService.ValidateSettings(settings)).Any(result => result != ValidationResult.Success))
{
if (_shellSettings.IsRunning())
{
_logger.LogWarning("GitHub Authentication is not correctly configured.");
}

return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void Configure(AuthenticationOptions options)
if (string.IsNullOrWhiteSpace(_gitHubAuthenticationSettings.ClientID) ||
string.IsNullOrWhiteSpace(_gitHubAuthenticationSettings.ClientSecret))
{
_logger.LogWarning("The Github login provider is enabled but not configured.");
_logger.LogWarning("The GitHub login provider is enabled but not configured.");

return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using OrchardCore.Environment.Shell;
using OrchardCore.Google.Authentication.Settings;

namespace OrchardCore.Google.Authentication.Services;

public sealed class GoogleAuthenticationSettingsConfiguration : IConfigureOptions<GoogleAuthenticationSettings>
{
private readonly GoogleAuthenticationService _googleAuthenticationService;
private readonly ShellSettings _shellSettings;
private readonly ILogger _logger;

public GoogleAuthenticationSettingsConfiguration(
GoogleAuthenticationService gitHubAuthenticationService,
ShellSettings shellSettings,
ILogger<GoogleAuthenticationSettingsConfiguration> logger)
public GoogleAuthenticationSettingsConfiguration(GoogleAuthenticationService googleAuthenticationService)
{
_googleAuthenticationService = gitHubAuthenticationService;
_shellSettings = shellSettings;
_logger = logger;
_googleAuthenticationService = googleAuthenticationService;
}

public void Configure(GoogleAuthenticationSettings options)
Expand All @@ -43,11 +34,6 @@ private async Task<GoogleAuthenticationSettings> GetGoogleAuthenticationSettings

if ((_googleAuthenticationService.ValidateSettings(settings)).Any(result => result != ValidationResult.Success))
{
if (_shellSettings.IsRunning())
{
_logger.LogWarning("Google Authentication is not correctly configured.");
}

return null;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using OrchardCore.Environment.Shell;
using OrchardCore.Microsoft.Authentication.Services;
using OrchardCore.Microsoft.Authentication.Settings;

Expand All @@ -10,17 +8,10 @@ namespace OrchardCore.Microsoft.Authentication.Configuration;
public sealed class MicrosoftAccountSettingsConfiguration : IConfigureOptions<MicrosoftAccountSettings>
{
private readonly IMicrosoftAccountService _microsoftAccountService;
private readonly ShellSettings _shellSettings;
private readonly ILogger _logger;

public MicrosoftAccountSettingsConfiguration(
IMicrosoftAccountService microsoftAccountService,
ShellSettings shellSettings,
ILogger<MicrosoftAccountSettingsConfiguration> logger)
public MicrosoftAccountSettingsConfiguration(IMicrosoftAccountService microsoftAccountService)
{
_microsoftAccountService = microsoftAccountService;
_shellSettings = shellSettings;
_logger = logger;
}

public void Configure(MicrosoftAccountSettings options)
Expand All @@ -43,11 +34,6 @@ private async Task<MicrosoftAccountSettings> GetMicrosoftAccountSettingsAsync()
var settings = await _microsoftAccountService.GetSettingsAsync();
if (_microsoftAccountService.ValidateSettings(settings).Any(result => result != ValidationResult.Success))
{
if (_shellSettings.IsRunning())
{
_logger.LogWarning("The Microsoft Account Authentication is not correctly configured.");
}

return null;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using OrchardCore.Environment.Shell;
using OrchardCore.Twitter.Settings;

namespace OrchardCore.Twitter.Services;

public sealed class TwitterSettingsConfiguration : IConfigureOptions<TwitterSettings>
{
private readonly ITwitterSettingsService _twitterSettingsService;
private readonly ShellSettings _shellSettings;
private readonly ILogger _logger;

public TwitterSettingsConfiguration(
ITwitterSettingsService twitterSettingsService,
ShellSettings shellSettings,
ILogger<TwitterSettingsConfiguration> logger)
public TwitterSettingsConfiguration(ITwitterSettingsService twitterSettingsService)
{
_twitterSettingsService = twitterSettingsService;
_shellSettings = shellSettings;
_logger = logger;
}

public void Configure(TwitterSettings options)
Expand All @@ -43,11 +34,6 @@ private async Task<TwitterSettings> GetTwitterSettingsAsync()

if ((_twitterSettingsService.ValidateSettings(settings)).Any(result => result != ValidationResult.Success))
{
if (_shellSettings.IsRunning())
{
_logger.LogWarning("X (Twitter) is not correctly configured.");
}

return null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/docs/releases/1.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ This release contains security vulnerability fixes. It is recommended you update
* Startbootstrap agency 7.0.11 by @agriffard in <https://github.com/OrchardCMS/OrchardCore/pull/11521>
* NodaTime 3.1.0 by @agriffard in <https://github.com/OrchardCMS/OrchardCore/pull/11557>
* Rename ReverseProxySettings permission to ManageReverseProxySettings by @hishamco in <https://github.com/OrchardCMS/OrchardCore/pull/11543>
* Github Actions : PreviewCI - Publishing of Docker images and Nuget packages only for main branch by @Skrypt in <https://github.com/OrchardCMS/OrchardCore/pull/11348>
* GitHub Actions : PreviewCI - Publishing of Docker images and Nuget packages only for main branch by @Skrypt in <https://github.com/OrchardCMS/OrchardCore/pull/11348>
* Add missing permission registration in OC.ReverseProxy module by @hishamco in <https://github.com/OrchardCMS/OrchardCore/pull/11542>
* Feature aware razor pages by @ns8482e in <https://github.com/OrchardCMS/OrchardCore/pull/11573>
* Lucene query docs, fixing QueryStringQueryProvider (Lombiq Technologies: OCORE-93) by @Piedone in <https://github.com/OrchardCMS/OrchardCore/pull/11561>
Expand Down
4 changes: 2 additions & 2 deletions src/docs/topics/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Here you can find a list of different environments with a Dockerfile example for

### Dockerfile-CI, Dockerfile-CI.gitignore

Github Actions is the Continuous Integration tool we use to build and test the different branches we have in our repository. It can allow us to create Docker images and containers but building Orchard Core on them would be slower than on the actual CI. So, for that matter, we don't use an intermediate image for building on the CI. Though, it perfectly makes sense to do this locally for yourself as performance should not be limited at all.
GitHub Actions is the Continuous Integration tool we use to build and test the different branches we have in our repository. It can allow us to create Docker images and containers but building Orchard Core on them would be slower than on the actual CI. So, for that matter, we don't use an intermediate image for building on the CI. Though, it perfectly makes sense to do this locally for yourself as performance should not be limited at all.

## Can I use different Dockerfiles for myself?

Expand All @@ -196,7 +196,7 @@ See :
[Build images with BuildKit](https://docs.docker.com/develop/develop-images/build_enhancements/)
[What is Docker BuildKit and What can I use it for?](https://brianchristner.io/what-is-docker-buildkit/#:~:text=Docker%20BuildKit%20is%20a%20little,and%20increase%20productivity%20for%20free.)

Github Actions currently supports Buildkit under Linux only.
GitHub Actions currently supports Buildkit under Linux only.

See :

Expand Down

0 comments on commit b3d6591

Please sign in to comment.