Skip to content

Commit

Permalink
merge hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm360 committed Jan 7, 2024
2 parents 51f2990 + bebc747 commit 971d444
Show file tree
Hide file tree
Showing 38 changed files with 195 additions and 169 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/stable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup dotnet
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build with dotnet
run: dotnet build --configuration Release
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/unstable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup dotnet
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build with dotnet
run: dotnet build --configuration Release
Expand Down
1 change: 0 additions & 1 deletion EthernaACR.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
EthernaACR.sln.licenseheader = EthernaACR.sln.licenseheader
LICENSE = LICENSE
README.md = README.md
EndProjectSection
Expand Down
15 changes: 15 additions & 0 deletions EthernaACR.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue"> Copyright 2021-present Etherna Sa

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Etherna/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
47 changes: 0 additions & 47 deletions EthernaACR.sln.licenseheader

This file was deleted.

12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
Etherna Asp Common Resources
============================
# Etherna Asp Common Resources

Overview
--------
## Overview

A Razor Class Library for share resources between Etherna Services on Asp.Net Core.

Issue reports
-------------
## Issue reports

If you've discovered a bug, or have an idea for a new feature, please report it to our issue manager based on Jira https://etherna.atlassian.net/projects/ACR.

Questions? Problems?
---------------------
## Questions? Problems?

For questions or problems please write an email to [info@etherna.io](mailto:info@etherna.io).
8 changes: 4 additions & 4 deletions src/EthernaACR/Attributes/SwarmResourceValidationAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2021-present Etherna Sagl
//
// Copyright 2021-present Etherna Sa
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down
10 changes: 5 additions & 5 deletions src/EthernaACR/EthernaACR.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<RootNamespace>Etherna.ACR</RootNamespace>

<Authors>Etherna Sagl</Authors>
<Authors>Etherna Sa</Authors>
<Description>A RCL for share resources between Etherna Services on Asp.Net Core</Description>

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand All @@ -32,9 +32,9 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="HtmlSanitizer" Version="8.0.645" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.16" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="HtmlSanitizer" Version="8.0.811" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.25" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
8 changes: 4 additions & 4 deletions src/EthernaACR/Exceptions/ServiceConfigurationException.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2021-present Etherna Sagl
//
// Copyright 2021-present Etherna Sa
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down
10 changes: 5 additions & 5 deletions src/EthernaACR/Extensions/LoggerExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2021-present Etherna Sagl
//
// Copyright 2021-present Etherna Sa
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -29,7 +29,7 @@ public static class LoggerExtensions
LoggerMessage.Define<string>(
LogLevel.Error,
new EventId(0, nameof(RequestError)),
"Request {RequestId} throwed error");
"Request {RequestId} threw error");

// Methods.
public static void RequestError(this ILogger logger, string requestId) =>
Expand Down
8 changes: 4 additions & 4 deletions src/EthernaACR/Filters/StatusStartupFilter.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2021-present Etherna Sagl
//
// Copyright 2021-present Etherna Sa
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down
11 changes: 5 additions & 6 deletions src/EthernaACR/Helpers/EmailHelper.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2021-present Etherna Sagl
//
// Copyright 2021-present Etherna Sa
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -31,8 +31,7 @@ public static bool IsValidEmail(string email) =>

public static string NormalizeEmail(string email)
{
if (email is null)
throw new ArgumentNullException(nameof(email));
ArgumentNullException.ThrowIfNull(email, nameof(email));

email = email.ToUpper(CultureInfo.InvariantCulture); //to upper case

Expand Down
25 changes: 18 additions & 7 deletions src/EthernaACR/Middlewares/DebugPages/DebugPagesExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
using Microsoft.AspNetCore.Builder;
// Copyright 2021-present Etherna Sa
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Options;
using System;

Expand All @@ -8,8 +22,7 @@ public static class ApplicationBuilderExtensions
{
public static IApplicationBuilder UseEthernaAcrDebugPages(this IApplicationBuilder app)
{
if (app == null)
throw new ArgumentNullException(nameof(app));
ArgumentNullException.ThrowIfNull(app, nameof(app));

return app.UseMiddleware<DebugPagesMiddleware>();
}
Expand All @@ -18,10 +31,8 @@ public static IApplicationBuilder UseEthernaAcrDebugPages(
this IApplicationBuilder app,
DebugPagesOptions options)
{
if (app == null)
throw new ArgumentNullException(nameof(app));
if (options == null)
throw new ArgumentNullException(nameof(options));
ArgumentNullException.ThrowIfNull(app, nameof(app));
ArgumentNullException.ThrowIfNull(options, nameof(options));

return app.UseMiddleware<DebugPagesMiddleware>(Options.Create(options));
}
Expand Down
26 changes: 19 additions & 7 deletions src/EthernaACR/Middlewares/DebugPages/DebugPagesMiddleware.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
using Etherna.ACR.Middlewares.DebugPages.Views;
// Copyright 2021-present Etherna Sa
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using Etherna.ACR.Middlewares.DebugPages.Views;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Infrastructure;
Expand All @@ -22,24 +36,22 @@ public DebugPagesMiddleware(
RequestDelegate next,
IOptions<DebugPagesOptions> options)
{
if (options is null)
throw new ArgumentNullException(nameof(options));
ArgumentNullException.ThrowIfNull(options, nameof(options));

this.next = next;
this.options = options.Value;
}

public async Task InvokeAsync(HttpContext context)
{
if (context is null)
throw new ArgumentNullException(nameof(context));
ArgumentNullException.ThrowIfNull(context, nameof(context));

if (context.Request.Path == options.ConfigurationPagePath)
{
var executor = context.RequestServices.GetRequiredService<IActionResultExecutor<ViewResult>>();
var actionContext = new ActionContext(
context,
context.GetRouteData() ?? new RouteData(),
context.GetRouteData(),
new Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor());
var viewResult = new ViewResult()
{
Expand All @@ -60,7 +72,7 @@ public async Task InvokeAsync(HttpContext context)
var executor = context.RequestServices.GetRequiredService<IActionResultExecutor<ViewResult>>();
var actionContext = new ActionContext(
context,
context.GetRouteData() ?? new RouteData(),
context.GetRouteData(),
new Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor());
var viewResult = new ViewResult()
{
Expand Down
16 changes: 15 additions & 1 deletion src/EthernaACR/Middlewares/DebugPages/DebugPagesOptions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
namespace Etherna.ACR.Middlewares.DebugPages
// Copyright 2021-present Etherna Sa
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Etherna.ACR.Middlewares.DebugPages
{
public class DebugPagesOptions
{
Expand Down
Loading

0 comments on commit 971d444

Please sign in to comment.