Skip to content

Releases: atidev/ATI.Services.Common

v13.7.2

05 Mar 11:22
0f48984
Compare
Choose a tag to compare

New:

  • Added the ability to connect serializers (now works for Redis) without bringing the dependency into common.
  • Added support for binary serializers in Redis.
  • Added SerializerProvider - gets registered common serializers from DI
  • SerializerFactory is marked obsolete - you should stop using it both inside and outside common.
  • Added interface IBinarySerializer

Requires your attention:

  • enum SerializerType - no longer describes all possible serializer types available in common. (Serializers can be connected via DI and will be available in SerializerProvider/RedisCache)
  • Changed the RedisOptions.Serializer property type from enum SerializerType to string. There is no need to take any action regarding this.
  • The ctor RedisCache and RedisScriptCache have changed - if for some reason you created RedisCache directly through the ctor, use the creation through RedisProvider.

For what:

  • Maybe you want or have been recommended to try some serializer (there are a great many of them) to optimize reading/writing to/from radishes and reduce storage volumes. Now you don't need to make this a dependency for all commands.
  • Reducing the cohesion of namespaces within common for subsequent decomposition

How to add your own serializer for Redis:

  • Create an implementation of the ISerializer or IBinarySerializer interface from the ati.services.common space and place it in a service/separate package/common - think about those who don't need it.
  • Register your serializer like this:
services.AddSingleton<ISerializer, Your implementation>()

or

services.AddSingleton<IBinarySerializer, Your implementation>()
  • Write the name of your serializer in your RedisOptions.Serializer. For example:
       "Keshik": {
         "TimeToLive": "1.00:00:00",
         ...
         "Serializer": "MemoryPack"
       },

v13.7.1

05 Mar 10:46
b132482
Compare
Choose a tag to compare

What's Changed:

Fix in AppHttpContext when metrics written from place without HttpContext.

v13.7.0

01 Mar 10:00
0e1ed49
Compare
Choose a tag to compare

What's Changed

  • Group prometheus metrics by @muphblu in #72
    • new metrics, changed naming, labels, factory methods etc.
    • updated prometheus-net to v8.2.1 due to bug that was fixed in v8.1.1
    • updated Microsoft.Data.SqlClient to v5.2.0 due to dotnet/SqlClient#1930
    • updated setting TrustServerCertificate in sql connection string is ignored and is true by default, could be overriden through DataBaseOptions

Full Changelog: v13.6.0...v13.7.0

New metrics list

common_metric_sql 
common_metric_http_client - for outgoing http requests, ConsulMetricsHttpClientWrapper uses it
common_metric_rabbitmq_subscibe - incoming messages from rmq, used by ATI.Services.RabbitMQ and ChangeTracking
common_metric_rabbitmq_publish - outgoing messages to rmq
common_metric_repository
common_metric_controller - incoming http requests, added by MeasureAttribute
common_metric_Exceptions
common_metric_HttpStatusCodeCounter - response codes
common_metric_redis
common_metric_mongo
common_metric_{something} - this one reserved for custom metric, if you really need it, try to keep number of unique metrics as low as possible

v13.6.0

19 Feb 09:49
26229a3
Compare
Choose a tag to compare

New XssSanitizerAttribute was added.

How you can use it:

  1. With bad request when xss was detected:
[XssSanitizer(IsReplace = false)]
public string ParameterName { get; set; }
  1. With clean xss injection
[XssSanitizer]
public string ParameterName { get; set; }

v13.5.0

18 Jan 09:29
770d7cc
Compare
Choose a tag to compare

Added traceId, traceParentId, traceSpanId and traceState to logs

Get all localized values

21 Dec 10:58
fe5b780
Compare
Choose a tag to compare

Now you can get all localized values by key

public List<string> GetAllLocalizedValues(string name) { ... }

Ignoring user sensitive data in logging

19 Dec 08:39
c1f626a
Compare
Choose a tag to compare

Now you can exclude sensitive user data from logging by adding UserSensitiveData attribute on a field. Update .Net version to 7

[UserSensitiveData]
public string Password { get; init; }

v13.2.2 Controller description in swagger

21 Nov 10:22
2efe77a
Compare
Choose a tag to compare

Comments for controllers description are enabled by includeControllerXmlComments: true in swagger configuration.
Now when a controller has a comment like this:

/// <summary>
/// Some desctiption of controller functionality
/// </summary>
public class InsuranceController : ControllerWithOpenApi
{
...
}

It transforms to controller description in swagger ui

v13.2.1

21 Nov 07:44
85874ec
Compare
Choose a tag to compare

What's Changed

Small changes allowing to use ETag/If-None-Match based requests by @muphblu and @dshved in #67

  • headers will be added without validation in MetricsHttpClientWrapper
  • new mapping for HttpStatusCode.NotModified => ActionStatus.NotModified (Success: false)
  • fix missing ActionStatus mapping for non success status code in public async Task<OperationResult<HttpResponseMessage<TResult>>> SendAsync<TModel, TResult>(...)

Full Changelog: v13.2.0...v13.2.1

v13.2.0

06 Oct 08:16
73b6fa3
Compare
Choose a tag to compare

[MemberNotNullWhen] attribute added for OperationResult<T>.Success property to specify that Value property has non-null value when Success returns true. It is helpful when nullable reference types are enabled in C# project