Skip to content

Commit

Permalink
Merge pull request #530 from radixdlt/develop
Browse files Browse the repository at this point in the history
release 1.0.1
  • Loading branch information
krzlabrdx authored Oct 10, 2023
2 parents f6592d9 + 59075d7 commit f8556b8
Show file tree
Hide file tree
Showing 41 changed files with 347 additions and 274 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ env:
jobs:
build:
runs-on: ubuntu-22.04
environment: release
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Setup .NET SDK
Expand Down Expand Up @@ -78,7 +77,6 @@ jobs:
context: "."
dockerfile: "./apps/DatabaseMigrations/Dockerfile"
platforms: "linux/amd64"
environment: release
cache_tag_suffix: "release"
enable_dockerhub: "true"
restore_artifact: "true"
Expand Down Expand Up @@ -127,7 +125,6 @@ jobs:
context: "."
dockerfile: "./apps/DataAggregator/Dockerfile"
platforms: "linux/amd64"
environment: release
cache_tag_suffix: "release"
enable_dockerhub: "true"
restore_artifact: "true"
Expand Down Expand Up @@ -176,7 +173,6 @@ jobs:
context: "."
dockerfile: "./apps/GatewayApi/Dockerfile"
platforms: "linux/amd64"
environment: release
cache_tag_suffix: "release"
enable_dockerhub: "true"
restore_artifact: "true"
Expand Down
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
## 1.0.0 - Babylon Launch
## 1.0.1 - Babylon
Release Date: _unreleased_

### Breaking changes
_None_
- Fixed missing `RecordTopOfDbLedger` observer call in `LedgerTransactionsProcessor`.
- Fixed invalid response model for HTTP 400 Bad Request responses on input parameter validation failure.
- Return 400 with validation error instead of 500 if `from_ledger_state` `state_version` is beyond known ledger tip.

## 1.0.0 - Babylon Launch
Release Date: 28.09.2023

### What’s new?
- log warning if sql query takes longer than configured threshold (default to 250ms) for both entity framework and dapper queries.
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionPrefix>1.0.1</VersionPrefix>
<VersionSuffix>develop</VersionSuffix>
</PropertyGroup>

Expand Down
9 changes: 9 additions & 0 deletions apps/DataAggregator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0-bookworm-slim AS base
WORKDIR /app

# Fixes CVE-2023-4911 can be removed when we update the base OS image to include this fix
# docker run -it mcr.microsoft.com/dotnet/aspnet:7.0-bookworm-slim ldd --version
# This fix can be removed as long as the version printed in the above command is 2.36-9+deb12u3 or above
RUN apt-get update -y \
&& apt-get -y --no-install-recommends install \
libc6=2.36-9+deb12u3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

FROM mcr.microsoft.com/dotnet/sdk:7.0-bookworm-slim AS build
WORKDIR /src
COPY . .
Expand Down
9 changes: 9 additions & 0 deletions apps/DatabaseMigrations/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0-bookworm-slim AS base
WORKDIR /app

# Fixes CVE-2023-4911 can be removed when we update the base OS image to include this fix
# docker run -it mcr.microsoft.com/dotnet/aspnet:7.0-bookworm-slim ldd --version
# This fix can be removed as long as the version printed in the above command is 2.36-9+deb12u3 or above
RUN apt-get update -y \
&& apt-get -y --no-install-recommends install \
libc6=2.36-9+deb12u3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

FROM mcr.microsoft.com/dotnet/sdk:7.0-bookworm-slim AS build
WORKDIR /src
COPY . .
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/StateEntityController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("state/entity")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public class StateController : ControllerBase
{
private readonly IEntityHandler _entityHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/StateKeyValueStoreController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("state/key-value-store")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public class StateKeyValueStoreController : ControllerBase
{
private readonly IKeyValueStoreHandler _keyValueStoreHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/StateNonFungibleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("state/non-fungible")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public class StateNonFungibleController : ControllerBase
{
private readonly INonFungibleHandler _nonFungibleHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/StatisticsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("statistics")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public class StatisticsController : ControllerBase
{
private readonly IValidatorHandler _validatorHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/StatusController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using RadixDlt.NetworkGateway.GatewayApi.Services;
using System.Threading;
Expand All @@ -74,8 +73,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("status")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public sealed class StatusController : ControllerBase
{
private readonly IStatusHandler _statusHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/StreamController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("stream")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public sealed class StreamController : ControllerBase
{
private readonly ITransactionHandler _transactionHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/TransactionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("transaction")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public sealed class TransactionController : ControllerBase
{
private readonly ITransactionHandler _transactionHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/ValidatorStateController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("state/validators")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public class ValidatorController : ControllerBase
{
private readonly IValidatorStateHandler _validatorStateHandler;
Expand Down
9 changes: 9 additions & 0 deletions apps/GatewayApi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0-bookworm-slim AS base
WORKDIR /app

# Fixes CVE-2023-4911 can be removed when we update the base OS image to include this fix
# docker run -it mcr.microsoft.com/dotnet/aspnet:7.0-bookworm-slim ldd --version
# This fix can be removed as long as the version printed in the above command is 2.36-9+deb12u3 or above
RUN apt-get update -y \
&& apt-get -y --no-install-recommends install \
libc6=2.36-9+deb12u3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

FROM mcr.microsoft.com/dotnet/sdk:7.0-bookworm-slim AS build
WORKDIR /src
COPY . .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,28 +62,14 @@
* permissions under this License.
*/

using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.DependencyInjection;
using RadixDlt.NetworkGateway.GatewayApi.Services;
using Microsoft.AspNetCore.Builder;

namespace RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
namespace GatewayApi.ExceptionHandlingMiddleware;

public sealed class InvalidModelStateFilter : IActionFilter, IOrderedFilter
public static class ApplicationBuilderExtension
{
public int Order => -3000;

public void OnActionExecuting(ActionExecutingContext context)
{
if (context.Result == null && !context.ModelState.IsValid)
{
var validationErrorHandler = context.HttpContext.RequestServices.GetRequiredService<IValidationErrorHandler>();

context.Result = validationErrorHandler.GetClientError(context);
}
}

public void OnActionExecuted(ActionExecutedContext context)
public static IApplicationBuilder UseGatewayExceptionHandler(this IApplicationBuilder app)
{
// no-op
return app.UseMiddleware<ExceptionHandlingMiddleware>();
}
}
Loading

0 comments on commit f8556b8

Please sign in to comment.