Skip to content

Commit

Permalink
Merge pull request #641 from Lombiq/issue/LMBQ-253
Browse files Browse the repository at this point in the history
LMBQ-253: Adding Lombiq.LoginAsAnybody submodule
  • Loading branch information
DemeSzabolcs authored Dec 21, 2023
2 parents 9b9c9c1 + 9c447fd commit 2148baa
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,7 @@
[submodule "src/Modules/Lombiq.ContentEditors"]
path = src/Modules/Lombiq.ContentEditors
url = https://github.com/Lombiq/Orchard-Content-Editors.git
[submodule "src/Modules/Lombiq.LoginAsAnybody"]
path = src/Modules/Lombiq.LoginAsAnybody
url = https://github.com/Lombiq/Orchard-Login-as-Anybody
branch = dev
60 changes: 45 additions & 15 deletions Lombiq.OSOCE.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.eslintrc.js = .eslintrc.js
.gitignore = .gitignore
.prettierrc.js = .prettierrc.js
.stylelintrc.js = .stylelintrc.js
Directory.Build.props = Directory.Build.props
License.md = License.md
NuGet.config = NuGet.config
package.json = package.json
Readme.md = Readme.md
Reset-Local.ps1 = Reset-Local.ps1
.prettierrc.js = .prettierrc.js
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{11E06A11-1733-408D-BB2F-BFA07075F812}"
Expand Down Expand Up @@ -228,7 +228,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.Orchard1",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.VisualStudioExtension", "tools\Lombiq.Analyzers\Lombiq.Analyzers.VisualStudioExtension\Lombiq.Analyzers.VisualStudioExtension.csproj", "{7870C9C9-14CF-48EA-8379-7CA3D513A022}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lombiq.Hosting.Tenants.Management.Tests.UI", "src\Modules\Lombiq.Hosting.Tenants\Lombiq.Hosting.Tenants.Management.Tests.UI\Lombiq.Hosting.Tenants.Management.Tests.UI.csproj", "{C312CD69-7F9B-4430-B99F-CCF2D48A301A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Hosting.Tenants.Management.Tests.UI", "src\Modules\Lombiq.Hosting.Tenants\Lombiq.Hosting.Tenants.Management.Tests.UI\Lombiq.Hosting.Tenants.Management.Tests.UI.csproj", "{C312CD69-7F9B-4430-B99F-CCF2D48A301A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.LoginAsAnybody.Tests.UI", "src\Modules\Lombiq.LoginAsAnybody\Lombiq.LoginAsAnybody.Tests.UI\Lombiq.LoginAsAnybody.Tests.UI.csproj", "{F29D71A8-417B-410B-82F6-0BCA254B2325}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.LoginAsAnybody", "src\Modules\Lombiq.LoginAsAnybody\Lombiq.LoginAsAnybody\Lombiq.LoginAsAnybody.csproj", "{E0B9B09C-0985-47DB-9F8A-79883547E1A9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -1224,18 +1228,6 @@ Global
{047F454E-8760-4F75-8519-32C9C2FE9F99}.Release|x64.Build.0 = Release|Any CPU
{047F454E-8760-4F75-8519-32C9C2FE9F99}.Release|x86.ActiveCfg = Release|Any CPU
{047F454E-8760-4F75-8519-32C9C2FE9F99}.Release|x86.Build.0 = Release|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Debug|x64.ActiveCfg = Debug|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Debug|x64.Build.0 = Debug|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Debug|x86.ActiveCfg = Debug|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Debug|x86.Build.0 = Debug|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Release|Any CPU.Build.0 = Release|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Release|x64.ActiveCfg = Release|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Release|x64.Build.0 = Release|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Release|x86.ActiveCfg = Release|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Release|x86.Build.0 = Release|Any CPU
{CDC5202B-EB66-4EE0-9FFC-A0B0FDA793E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDC5202B-EB66-4EE0-9FFC-A0B0FDA793E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDC5202B-EB66-4EE0-9FFC-A0B0FDA793E8}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -1272,6 +1264,42 @@ Global
{7870C9C9-14CF-48EA-8379-7CA3D513A022}.Release|x64.Build.0 = Release|Any CPU
{7870C9C9-14CF-48EA-8379-7CA3D513A022}.Release|x86.ActiveCfg = Release|Any CPU
{7870C9C9-14CF-48EA-8379-7CA3D513A022}.Release|x86.Build.0 = Release|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Debug|x64.ActiveCfg = Debug|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Debug|x64.Build.0 = Debug|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Debug|x86.ActiveCfg = Debug|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Debug|x86.Build.0 = Debug|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Release|Any CPU.Build.0 = Release|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Release|x64.ActiveCfg = Release|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Release|x64.Build.0 = Release|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Release|x86.ActiveCfg = Release|Any CPU
{C312CD69-7F9B-4430-B99F-CCF2D48A301A}.Release|x86.Build.0 = Release|Any CPU
{F29D71A8-417B-410B-82F6-0BCA254B2325}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F29D71A8-417B-410B-82F6-0BCA254B2325}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F29D71A8-417B-410B-82F6-0BCA254B2325}.Debug|x64.ActiveCfg = Debug|Any CPU
{F29D71A8-417B-410B-82F6-0BCA254B2325}.Debug|x64.Build.0 = Debug|Any CPU
{F29D71A8-417B-410B-82F6-0BCA254B2325}.Debug|x86.ActiveCfg = Debug|Any CPU
{F29D71A8-417B-410B-82F6-0BCA254B2325}.Debug|x86.Build.0 = Debug|Any CPU
{F29D71A8-417B-410B-82F6-0BCA254B2325}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F29D71A8-417B-410B-82F6-0BCA254B2325}.Release|Any CPU.Build.0 = Release|Any CPU
{F29D71A8-417B-410B-82F6-0BCA254B2325}.Release|x64.ActiveCfg = Release|Any CPU
{F29D71A8-417B-410B-82F6-0BCA254B2325}.Release|x64.Build.0 = Release|Any CPU
{F29D71A8-417B-410B-82F6-0BCA254B2325}.Release|x86.ActiveCfg = Release|Any CPU
{F29D71A8-417B-410B-82F6-0BCA254B2325}.Release|x86.Build.0 = Release|Any CPU
{E0B9B09C-0985-47DB-9F8A-79883547E1A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0B9B09C-0985-47DB-9F8A-79883547E1A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0B9B09C-0985-47DB-9F8A-79883547E1A9}.Debug|x64.ActiveCfg = Debug|Any CPU
{E0B9B09C-0985-47DB-9F8A-79883547E1A9}.Debug|x64.Build.0 = Debug|Any CPU
{E0B9B09C-0985-47DB-9F8A-79883547E1A9}.Debug|x86.ActiveCfg = Debug|Any CPU
{E0B9B09C-0985-47DB-9F8A-79883547E1A9}.Debug|x86.Build.0 = Debug|Any CPU
{E0B9B09C-0985-47DB-9F8A-79883547E1A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0B9B09C-0985-47DB-9F8A-79883547E1A9}.Release|Any CPU.Build.0 = Release|Any CPU
{E0B9B09C-0985-47DB-9F8A-79883547E1A9}.Release|x64.ActiveCfg = Release|Any CPU
{E0B9B09C-0985-47DB-9F8A-79883547E1A9}.Release|x64.Build.0 = Release|Any CPU
{E0B9B09C-0985-47DB-9F8A-79883547E1A9}.Release|x86.ActiveCfg = Release|Any CPU
{E0B9B09C-0985-47DB-9F8A-79883547E1A9}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1370,10 +1398,12 @@ Global
{890050AB-04F8-467A-81CB-8D83B4E61527} = {11E06A11-1733-408D-BB2F-BFA07075F812}
{818CA6CB-ED8F-4396-AEBE-F69619C75DA7} = {6ED7E28F-0556-471C-8AD1-5BB0941411DD}
{047F454E-8760-4F75-8519-32C9C2FE9F99} = {BF1EDFA5-0129-416C-B9ED-8CE68A3FD526}
{C312CD69-7F9B-4430-B99F-CCF2D48A301A} = {6ED7E28F-0556-471C-8AD1-5BB0941411DD}
{CDC5202B-EB66-4EE0-9FFC-A0B0FDA793E8} = {BF1EDFA5-0129-416C-B9ED-8CE68A3FD526}
{CC788E1F-E9C2-482E-BA10-9D3FFAA9CADD} = {BF1EDFA5-0129-416C-B9ED-8CE68A3FD526}
{7870C9C9-14CF-48EA-8379-7CA3D513A022} = {BF1EDFA5-0129-416C-B9ED-8CE68A3FD526}
{C312CD69-7F9B-4430-B99F-CCF2D48A301A} = {6ED7E28F-0556-471C-8AD1-5BB0941411DD}
{F29D71A8-417B-410B-82F6-0BCA254B2325} = {6ED7E28F-0556-471C-8AD1-5BB0941411DD}
{E0B9B09C-0985-47DB-9F8A-79883547E1A9} = {11E06A11-1733-408D-BB2F-BFA07075F812}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C6926E60-1F5A-4B05-B835-B1021FBE07C5}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<PackageReference Include="Lombiq.Hosting.Tenants.EmailQuotaManagement" Version="6.3.0-alpha.2.lmbq-249" />
<PackageReference Include="Lombiq.JsonEditor" Version="6.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.JsonEditor.Tests.UI" Version="6.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.LoginAsAnybody" Version="1.0.0" />
<PackageReference Include="Lombiq.Privacy" Version="7.0.2-alpha.2.osoe-638" />
<PackageReference Include="Lombiq.Privacy.Samples" Version="7.0.2-alpha.2.osoe-638" />
<PackageReference Include="Lombiq.SetupExtensions" Version="5.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"Lombiq.Hosting.Tenants.IdleTenantManagement.ShutDownIdleTenants",
"Lombiq.Hosting.Tenants.Maintenance.ChangeUserSensitiveContent",
"Lombiq.JsonEditor",
"Lombiq.LoginAsAnybody",
"Lombiq.OSOCE.Samples",
"Lombiq.OSOCE.NuGet.TestModule",
// We only enable these in a specific test, because the banner overlaps with too many things.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<PackageReference Include="Lombiq.Hosting.Tenants.Maintenance.Tests.UI" Version="6.3.0-alpha.2.lmbq-249" />
<PackageReference Include="Lombiq.Hosting.Tenants.Management.Tests.UI" Version="6.3.0-alpha.2.lmbq-249" />
<PackageReference Include="Lombiq.JsonEditor.Tests.UI" Version="6.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.LoginAsAnybody.Tests.UI" Version="1.0.0" />
<PackageReference Include="Lombiq.OrchardCoreApiClient.Tests.UI" Version="4.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.Privacy.Tests.UI" Version="7.0.2-alpha.2.osoe-638" />
<PackageReference Include="Lombiq.HelpfulExtensions.Tests.UI" Version="7.0.2-alpha.2.osoe-683" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Lombiq.LoginAsAnybody.Tests.UI.Extensions;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;

namespace Lombiq.OSOCE.NuGet.Tests.UI.Tests.ModuleTests;

public class BehaviorLoginAsAnybodyTests : UITestBase
{
public BehaviorLoginAsAnybodyTests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}

[Fact]
public Task SwitchingUserShouldWorkCorrectly() =>
ExecuteTestAfterSetupAsync(context => context.TestLoginAsAnybodyAsync());

[Fact]
public Task PermissionCheckShouldWorkCorrectly() =>
ExecuteTestAfterSetupAsync(
context => context.TestLoginAsAnybodyAuthorizationAsync(),
changeConfiguration: Configurations.IgnoreUnauthorizedBrowserLogEntries);
}
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Note that this solution also has an Orchard 1 counterpart, [Lombiq's Open-Source
- [`Lombiq.Hosting.Tenants.IdleTenantManagement`](https://github.com/Lombiq/Hosting-Tenants/tree/dev/Lombiq.Hosting.Tenants.IdleTenantManagement): With the help of this module, you can ensure that any tenant where the feature is enabled will shutdown after a preset time is elapsed. This can be used to free up resources.
- [`Lombiq.Hosting.Tenants.EnvironmentRobots`](https://github.com/Lombiq/Hosting-Tenants/tree/dev/Lombiq.Hosting.Tenants.EnvironmentRobots): With the help of this module, you can ensure that your sites will not be indexed by search bots. Check out a demo video of this module [here](https://youtu.be/Rp3ao2ZbNRs).
- [`Lombiq.JsonEditor`](https://github.com/Lombiq/Orchard-JSON-Editor): Orchard Core module for displaying a JSON Editor like on [jsoneditoronline.org](https://jsoneditoronline.org/). Watch a demo video of it from the Orchard Community Meeting [here](https://www.youtube.com/watch?app=desktop&v=nFhRjhXTKAY).
- [`Lombiq.LoginAsAnybody`](https://github.com/Lombiq/Orchard-Login-as-Anybody): With the help of this module, a user with the site owner permission can log in as anybody on the admin dashboard.
- [`Lombiq.OSOCE.Samples`](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/tree/dev/src/Modules/Lombiq.OSOCE.Samples): This is a placeholder module that will contain sample code for UI tests and demonstration content for our open-source Orchard Core extensions.
- [`Lombiq.Privacy`](https://github.com/Lombiq/Orchard-Privacy): Orchard module containing features related to data protection/privacy and the EU law on it, the [General Data Protection Regulation](https://eur-lex.europa.eu/legal-content/EN/TXT/?qid=1462439808430&uri=CELEX:32016R0679) (GDPR). Check out a demo video of this module [here](https://www.youtube.com/watch?v=GnyYL9Zdo8Q). **Important!** Using this module will not make your site GDPR-compliant alone. Do not forget to create a privacy policy page that you need to link to from the various consent-asking features.
- [`Lombiq.TrainingDemo`](https://github.com/Lombiq/Orchard-Training-Demo-Module): Demo Orchard Core module for training purposes guiding you to become an Orchard developer. Note that this module also has an Orchard 1.x version in the [`dev-orchard-1` branch of the repository](https://github.com/Lombiq/Orchard-Training-Demo-Module/tree/dev-orchard-1). If you prefer tutorial videos more then check out the [Dojo Course 3, the complete Orchard Core tutorial series](https://orcharddojo.net/orchard-training/dojo-course-3-the-full-orchard-core-tutorial).
Expand Down
1 change: 1 addition & 0 deletions src/Lombiq.OSOCE.Web/Lombiq.OSOCE.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<ProjectReference Include="..\Modules\Lombiq.Hosting.Tenants\Lombiq.Hosting.Tenants.Management\Lombiq.Hosting.Tenants.Management.csproj" />
<ProjectReference Include="..\Modules\Lombiq.Hosting.Tenants\Lombiq.Hosting.Tenants.MediaStorageManagement\Lombiq.Hosting.Tenants.MediaStorageManagement.csproj" />
<ProjectReference Include="..\Modules\Lombiq.JsonEditor\Lombiq.JsonEditor\Lombiq.JsonEditor.csproj" />
<ProjectReference Include="..\Modules\Lombiq.LoginAsAnybody\Lombiq.LoginAsAnybody\Lombiq.LoginAsAnybody.csproj" />
<ProjectReference Include="..\Modules\Lombiq.OSOCE.Samples\Lombiq.OSOCE.Samples.csproj" />
<ProjectReference Include="..\Modules\Lombiq.Privacy\Lombiq.Privacy\Lombiq.Privacy.csproj" />
<ProjectReference Include="..\Modules\Lombiq.Privacy\Lombiq.Privacy.Samples\Lombiq.Privacy.Samples.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"Lombiq.Hosting.Tenants.EmailQuotaManagement",
"Lombiq.JsonEditor",
"Lombiq.JsonEditor.ContentEditor",
"Lombiq.LoginAsAnybody",
"Lombiq.OSOCE.Samples",
// We only enable these on a specific test, because it overlaps with too many things.
// "Lombiq.Privacy.ConsentBanner",
Expand Down
1 change: 1 addition & 0 deletions src/Modules/Lombiq.LoginAsAnybody
Submodule Lombiq.LoginAsAnybody added at c82355
1 change: 1 addition & 0 deletions test/Lombiq.OSOCE.Tests.UI/Lombiq.OSOCE.Tests.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<ProjectReference Include="..\..\src\Modules\Lombiq.Hosting.Tenants\Lombiq.Hosting.Tenants.Management.Tests.UI\Lombiq.Hosting.Tenants.Management.Tests.UI.csproj" />
<ProjectReference Include="..\..\src\Modules\Lombiq.Hosting.Tenants\Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI\Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI.csproj" />
<ProjectReference Include="..\..\src\Modules\Lombiq.JsonEditor\Lombiq.JsonEditor.Test.UI\Lombiq.JsonEditor.Tests.UI.csproj" />
<ProjectReference Include="..\..\src\Modules\Lombiq.LoginAsAnybody\Lombiq.LoginAsAnybody.Tests.UI\Lombiq.LoginAsAnybody.Tests.UI.csproj" />
<ProjectReference Include="..\..\src\Modules\Lombiq.Privacy\Lombiq.Privacy.Tests.UI\Lombiq.Privacy.Tests.UI.csproj" />
<ProjectReference Include="..\..\src\Modules\Lombiq.UIKit\Lombiq.UIKit.Tests.UI\Lombiq.UIKit.Tests.UI.csproj" />
<ProjectReference Include="..\..\src\Modules\Lombiq.VueJs\Lombiq.VueJs.Tests.UI\Lombiq.VueJs.Tests.UI.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Lombiq.LoginAsAnybody.Tests.UI.Extensions;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;

namespace Lombiq.OSOCE.Tests.UI.Tests.ModuleTests;

public class BehaviorLoginAsAnybodyTests : UITestBase
{
public BehaviorLoginAsAnybodyTests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}

[Fact]
public Task SwitchingUserShouldWorkCorrectly() =>
ExecuteTestAfterSetupAsync(context => context.TestLoginAsAnybodyAsync());

[Fact]
public Task PermissionCheckShouldWorkCorrectly() =>
ExecuteTestAfterSetupAsync(
context => context.TestLoginAsAnybodyAuthorizationAsync(),
changeConfiguration: Configurations.IgnoreUnauthorizedBrowserLogEntries);
}

0 comments on commit 2148baa

Please sign in to comment.