Skip to content

Commit

Permalink
Merge branch 'master' into remote_api_error
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroP authored Apr 25, 2024
2 parents 00a0c22 + c7d684f commit 488a35f
Show file tree
Hide file tree
Showing 219 changed files with 8,605 additions and 1,349 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ jobs:
$PushToAzureArgs += "--skip-duplicate"
}
dotnet $PushToAzureArgs
dotnet $PushToAzureArgs || exit 1
$pushedToAzure += 1
if (!$IsPrerelease) {
dotnet $PushToGitHubArgs
dotnet $PushToGitHubArgs || exit 1
$pushedToGitHub += 1
dotnet $PushToNugetArgs
dotnet $PushToNugetArgs || exit 1
$pushedToNuget += 1
}
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# GeneXus Standard Classes for .NET and .NET Framework
GeneXus Standard Classes for .NET and .NET Framework generators.

## Build status
| Branch | Status
|---|---
|master|[![](https://github.com/genexuslabs/dotnetclasses/workflows/Build/badge.svg?branch=master)](https://github.com/genexuslabs/dotnetclasses/actions?query=workflow%3ABuild+branch%3Amaster)
|beta|[![](https://github.com/genexuslabs/dotnetclasses/workflows/Build/badge.svg?branch=beta)](https://github.com/genexuslabs/dotnetclasses/actions?query=workflow%3ABuild+branch%3Abeta)
## Repo status
| Branch | Build | Security
|---|---|---
|master|[![](https://github.com/genexuslabs/dotnetclasses/workflows/Build/badge.svg?branch=master)](https://github.com/genexuslabs/dotnetclasses/actions?query=workflow%3ABuild+branch%3Amaster)|[![CodeQL](https://github.com/genexuslabs/DotNetClasses/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/genexuslabs/DotNetClasses/actions/workflows/codeql-analysis.yml)
|beta|[![](https://github.com/genexuslabs/dotnetclasses/workflows/Build/badge.svg?branch=beta)](https://github.com/genexuslabs/dotnetclasses/actions?query=workflow%3ABuild+branch%3Abeta)|[![CodeQL](https://github.com/genexuslabs/DotNetClasses/actions/workflows/codeql-analysis.yml/badge.svg?branch=beta)](https://github.com/genexuslabs/DotNetClasses/actions/workflows/codeql-analysis.yml)

## Modules

Expand Down
4 changes: 3 additions & 1 deletion dotnet/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<AssemblyVersion>11.0.0.0</AssemblyVersion>
<MajorFileVersion>1</MajorFileVersion>
<MajorFileVersion Condition="$(GIT_REF.EndsWith('beta'))">$([MSBuild]::Add($(MajorFileVersion), 100))</MajorFileVersion>
<MinorFileVersion>27</MinorFileVersion>
<MinorFileVersion>30</MinorFileVersion>
<PatchFileVersion Condition="'$(COMMIT_NUMBER)'!=''">$(COMMIT_NUMBER)</PatchFileVersion>
<PatchFileVersion Condition="'$(COMMIT_NUMBER)'==''">0</PatchFileVersion>
<FileVersion>$(MajorFileVersion).$(MinorFileVersion).$(PatchFileVersion)</FileVersion>
Expand All @@ -29,6 +29,8 @@
<NoWarn>NU5105;CS0618;CS8032;CS0618;SYSLIB0021;SYSLIB0023</NoWarn>
<IsPackable>true</IsPackable>
<DisableImplicitNamespaceImports>True</DisableImplicitNamespaceImports>
<!--keep low and moderate vulnerabilities (NU1901;NU1902;NU1903;NU1904), high and critical vulnerabilities (NU1903 and NU1904) as warnings-->
<WarningsNotAsErrors>NU1900;NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>

<Target Name="GetFileVersionForPackage">
Expand Down
19 changes: 17 additions & 2 deletions dotnet/DotNetStandardClasses.sln
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GXOtel.Diagnostics", "src\d
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetCoreCmdTest", "test\DotNetCoreCmdTest\DotNetCoreCmdTest.csproj", "{956402BD-AC8C-426E-961B-B77B3F3EDAEB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{46DAAFD1-FAF5-4904-8EC5-406BE04E5538}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogTest", "test\benchmarks\LogTest\LogTest.csproj", "{A1DBDCE0-4F09-445F-A202-9B260CDD46CF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AccessTokenController_Test", "test\NativeAccessControllerTest\AccessTokenController_Test.csproj", "{A5589382-DB6F-4450-AE2B-6C6AA1643EF1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -627,7 +633,14 @@ Global
{956402BD-AC8C-426E-961B-B77B3F3EDAEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{956402BD-AC8C-426E-961B-B77B3F3EDAEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{956402BD-AC8C-426E-961B-B77B3F3EDAEB}.Release|Any CPU.Build.0 = Release|Any CPU

{A1DBDCE0-4F09-445F-A202-9B260CDD46CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1DBDCE0-4F09-445F-A202-9B260CDD46CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1DBDCE0-4F09-445F-A202-9B260CDD46CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1DBDCE0-4F09-445F-A202-9B260CDD46CF}.Release|Any CPU.Build.0 = Release|Any CPU
{A5589382-DB6F-4450-AE2B-6C6AA1643EF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5589382-DB6F-4450-AE2B-6C6AA1643EF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5589382-DB6F-4450-AE2B-6C6AA1643EF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5589382-DB6F-4450-AE2B-6C6AA1643EF1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -751,7 +764,9 @@ Global
{0FCFB078-5584-469F-92CC-61B0A6216D0D} = {1D6F1776-FF4B-46C2-9B3D-BC46CCF049DC}
{A42066E8-DDB9-4767-AEFA-E6D13EFF051A} = {BBE020D4-C0FF-41A9-9EB1-D1EE12CC4BB8}
{956402BD-AC8C-426E-961B-B77B3F3EDAEB} = {1D6F1776-FF4B-46C2-9B3D-BC46CCF049DC}

{46DAAFD1-FAF5-4904-8EC5-406BE04E5538} = {1D6F1776-FF4B-46C2-9B3D-BC46CCF049DC}
{A1DBDCE0-4F09-445F-A202-9B260CDD46CF} = {46DAAFD1-FAF5-4904-8EC5-406BE04E5538}
{A5589382-DB6F-4450-AE2B-6C6AA1643EF1} = {1D6F1776-FF4B-46C2-9B3D-BC46CCF049DC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E18684C9-7D76-45CD-BF24-E3944B7F174C}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@
<ItemGroup Condition="'$(TargetFramework)'=='net462'">
<ProjectReference Include="..\..\dotnetframework\GxClasses\GxClasses.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.0.103" />
<ProjectReference Include="..\DynService.Core\DynService.Core.csproj" />
</ItemGroup>
Expand Down
8 changes: 2 additions & 6 deletions dotnet/src/dotnetcommon/GxEncrypt/GxEncrypt.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
<PackageTags>Encrypt64 Decrypt64</PackageTags>
<PackageId>GeneXus.Encrypt</PackageId>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'!='net462'">
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.8.0" />
<ItemGroup>
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.34.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net462'">
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.5.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.Core" Version="1.35.0" />
<PackageReference Include="Azure.Core" Version="1.36.0" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.36.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Compile Include="..\..\..\dotnetframework\DynServiceOData\DynServiceOData.cs" Link="DynServiceOData.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="GeneXus.Odata.Client" Version="5.2.3.8" />
</ItemGroup>
<ItemGroup>
Expand Down
15 changes: 3 additions & 12 deletions dotnet/src/dotnetcore/GxClasses.Web/GxClasses.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -44,15 +45,5 @@
<Folder Include="Notifications\WebSocket\" />
<Folder Include="View\UserControls\" />
</ItemGroup>
<ItemGroup>
<Reference Include="Jayrock-JSON" Condition="'$(TargetFramework)'=='net8.0'">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\libs\net8.0\Jayrock.dll</HintPath>
</Reference>
<Reference Include="Jayrock-JSON" Condition="'$(TargetFramework)'=='net6.0'">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\libs\Jayrock.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
43 changes: 28 additions & 15 deletions dotnet/src/dotnetcore/GxClasses.Web/Middleware/GXRouting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public GXRouting(string baseURL)
ServicesGroupSetting();
ServicesFunctionsMetadata();
GetAzureDeploy();
SvcFiles();
}

static public List<ControllerInfo> GetRouteController(Dictionary<string, string> apiPaths,
Expand Down Expand Up @@ -377,8 +378,7 @@ public GxRestWrapper GetController(HttpContext context, ControllerInfo controlle
GxContext gxContext = GxContext.CreateDefaultInstance();
gxContext.HttpContext = context;
context.NewSessionCheck();
string nspace;
Config.GetValueOf("AppMainNamespace", out nspace);
string nspace = Preferences.AppMainNamespace;

String tmpController = controller;
String addNspace = string.Empty;
Expand All @@ -397,7 +397,7 @@ public GxRestWrapper GetController(HttpContext context, ControllerInfo controlle
bool privateDirExists = Directory.Exists(privateDir);

GXLogging.Debug(log, $"PrivateDir:{privateDir} asssemblycontroller:{asssemblycontroller}");

string svcFile=null;
if (privateDirExists && File.Exists(Path.Combine(privateDir, $"{asssemblycontroller.ToLower()}.grp.json")))
{
controller = tmpController;
Expand All @@ -412,9 +412,7 @@ public GxRestWrapper GetController(HttpContext context, ControllerInfo controlle
else
{
string controllerLower = controller.ToLower();
string svcFile = SvcFile($"{controller}{SvcExtension}");
if (svcFile==null)
svcFile = SvcFile($"{controllerLower}{SvcExtension}");
svcFile = SvcFile($"{controller}{SvcExtension}");
if (File.Exists(svcFile))
{
string[] controllerAssemblyQualifiedName = new string(File.ReadLines(svcFile).First().SkipWhile(c => c != '"')
Expand Down Expand Up @@ -446,22 +444,26 @@ public GxRestWrapper GetController(HttpContext context, ControllerInfo controlle
GXLogging.Warn(log, $"Controller was not found");
return null;
}
string SvcFile(string controller)

private void SvcFiles()
{
if (svcFiles == null)
svcFiles = new HashSet<string>(new CaseInsensitiveStringEqualityComparer());
foreach (string file in Directory.GetFiles(ContentRootPath, SvcExtensionPattern, SearchOption.AllDirectories))
{
svcFiles = new HashSet<string>();
foreach (string file in Directory.GetFiles(ContentRootPath, SvcExtensionPattern, SearchOption.AllDirectories))
{
svcFiles.Add(file);
}
svcFiles.Add(file);
}
}
string SvcFile(string controller)
{
string fileName;
string controllerFullName = Path.Combine(ContentRootPath, controller);
if (svcFiles.TryGetValue(new FileInfo(controllerFullName).FullName, out fileName))
string controllerFullName = new FileInfo(Path.Combine(ContentRootPath, controller)).FullName;
if (svcFiles.TryGetValue(controllerFullName, out fileName))
return fileName;
else
{
GXLogging.Warn(log, "Service file not found:" + controllerFullName);
return null;
}

}
public void ServicesGroupSetting()
Expand Down Expand Up @@ -601,7 +603,18 @@ public string GAM


}
internal class CaseInsensitiveStringEqualityComparer : IEqualityComparer<string>
{
public bool Equals(string x, string y)
{
return string.Equals(x, y, StringComparison.OrdinalIgnoreCase);
}

public int GetHashCode(string obj)
{
return obj.ToLower().GetHashCode();
}
}
public static class AzureFeature
{
public const string AzureServerless = "AzureServerless";
Expand Down
44 changes: 19 additions & 25 deletions dotnet/src/dotnetcore/GxClasses.Web/Middleware/HandlerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using GeneXus.Configuration;
using GeneXus.Http;
using GeneXus.Mime;
using GeneXus.Procedure;
using GeneXus.Utils;
using Microsoft.AspNetCore.Http;

Expand Down Expand Up @@ -37,25 +38,6 @@ public class HandlerFactory
{"gxoauthuserinfo",typeof(GXOAuthUserInfo)},
{"gxoauthaccesstoken",typeof(GXOAuthAccessToken)},
{"gxmulticall",typeof(GXMultiCall)}};
static Dictionary<string, string> _aspxRewrite = new Dictionary<string, string>(){
{"oauth/access_token","gxoauthaccesstoken.aspx"},
{"oauth/logout","gxoauthlogout.aspx"},
{"oauth/userinfo","gxoauthuserinfo.aspx"},
{"oauth/gam/signin","agamextauthinput.aspx"},
{"oauth/gam/callback","agamextauthinput.aspx"},
{"oauth/gam/access_token","agamoauth20getaccesstoken.aspx"},
{"oauth/gam/userinfo","agamoauth20getuserinfo.aspx"},
{"oauth/gam/signout","agamextauthinput.aspx"},
{"saml/gam/signin","Saml2/SignIn"},
{"saml/gam/callback","gamexternalauthenticationinputsaml20_ws.aspx"},
{"saml/gam/signout","Saml2/Logout"},
{"oauth/requesttokenservice","agamstsauthappgetaccesstoken.aspx"},
{"oauth/queryaccesstoken","agamstsauthappvalidaccesstoken.aspx"},
{"oauth/gam/v2.0/access_token","agamoauth20getaccesstoken_v20.aspx"},
{"oauth/gam/v2.0/userinfo","agamoauth20getuserinfo_v20.aspx"},
{"oauth/gam/v2.0/requesttokenanduserinfo","aGAMSSORestRequestTokenAndUserInfo_v20.aspx"}};
private const string QUERYVIEWER_NAMESPACE = "QueryViewer.Services";
private const string GXFLOW_NSPACE = "GXflow.Programs";
private static List<string> GxNamespaces;

public HandlerFactory()
Expand Down Expand Up @@ -93,8 +75,16 @@ public async Task Invoke(HttpContext context)
handler.sendAdditionalHeaders();
return Task.CompletedTask;
});
handler.ProcessRequest(context);
await Task.CompletedTask;
GXWebProcedure gxWebProc = handler as GXWebProcedure;
if (gxWebProc != null && gxWebProc.GetAsyncEnabledInternal())
{
await gxWebProc.ProcessRequestAsync(context);
}
else
{
handler.ProcessRequest(context);
await Task.CompletedTask;
}
handler.ControlOutputWriter?.Flush();
}
else
Expand Down Expand Up @@ -122,9 +112,9 @@ private static string ObjectUrl(string requestPath, string basePath)
}
lastSegment = CleanUploadUrlSuffix(lastSegment.TrimStart('/').ToLower());
GXLogging.Debug(log, "ObjectUrl:", lastSegment);
if (_aspxRewrite.ContainsKey(lastSegment))
if (HttpHelper.GAMServices.ContainsKey(lastSegment))
{
return _aspxRewrite[lastSegment];
return HttpHelper.GAMServices[lastSegment];
}
return lastSegment;
}
Expand Down Expand Up @@ -167,11 +157,15 @@ public IHttpHandler GetHandler(HttpContext context, string requestType, string u
string className;
if (cname.StartsWith("agxpl_", StringComparison.OrdinalIgnoreCase) || cname.Equals("gxqueryviewerforsd", StringComparison.OrdinalIgnoreCase))
{
className = $"{QUERYVIEWER_NAMESPACE}.{cname}";
className = $"{HttpHelper.QUERYVIEWER_NAMESPACE}.{cname}";
}
else if (Preferences.GxpmEnabled && (cname.StartsWith("awf", StringComparison.OrdinalIgnoreCase) || cname.StartsWith("wf", StringComparison.OrdinalIgnoreCase) || cname.StartsWith("apwf", StringComparison.OrdinalIgnoreCase)))
{
className = $"{GXFLOW_NSPACE}.{cname}";
className = $"{HttpHelper.GXFLOW_NSPACE}.{cname}";
}
else if (HttpHelper.GamServicesInternalName.Contains(cname))
{
className = $"{HttpHelper.GAM_NSPACE}.{cname}";
}
else
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#if NETCORE
using GeneXus.Application;
#else
using Jayrock.Json;
#endif
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -11,7 +16,6 @@
using GeneXus.Procedure;
using GeneXus.Services;
using GeneXus.Utils;
using Jayrock.Json;

namespace GeneXus.Http.WebSocket
{
Expand Down Expand Up @@ -119,8 +123,7 @@ private bool ExecuteHandler(HandlerType type, Object[] parameters)
{
try
{
string nSpace = string.Empty;
Config.GetValueOf("AppMainNamespace", out nSpace);
string nSpace = Preferences.AppMainNamespace;
GXProcedure obj = null;
try
{
Expand Down
Loading

0 comments on commit 488a35f

Please sign in to comment.