Releases: atidev/ATI.Services.Common
Releases · atidev/ATI.Services.Common
v13.7.2
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
v13.7.0
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
New XssSanitizerAttribute was added.
How you can use it:
- With bad request when xss was detected:
[XssSanitizer(IsReplace = false)]
public string ParameterName { get; set; }
- With clean xss injection
[XssSanitizer]
public string ParameterName { get; set; }
v13.5.0
Get all localized values
Now you can get all localized values by key
public List<string> GetAllLocalizedValues(string name) { ... }
Ignoring user sensitive data in logging
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
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
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