闽公网安备 35020302035485号
4.修复 Redis Streams 读取或创建流时幂等检查的问题
services.AddAuthorization((options =>
{
// only if you want to apply role filter to CAP Dashboard user
options.AddPolicy("PolicyCap", policy => policy.RequireRole("admin.events"));
}))
.AddAuthentication(options =>
{
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
})
.AddCookie()
.AddOpenIdConnect(options =>
{
options.Authority = "https://demo.identityserver.io/";
options.ClientId = "interactive.confidential";
options.ClientSecret = "secret";
options.ResponseType = "code";
options.UsePkce = true;
options.Scope.Clear();
options.Scope.Add("openid");
options.Scope.Add("profile");
});
services.AddCap(cap =>
{
cap.UseDashboard(d =>
{
d.UseChallengeOnAuth = true;
d.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
d.UseAuth = true;
// only if you want to apply policy authorization filter to CAP Dashboard user
d.AuthorizationPolicy = "PolicyCap";
});
// ***
}
Azure Service Bus 添加对延迟消息的支持[HttpPost("publish")]
public async Task Publish()
{
await _publisher.PublishAsync("demo-publish", string.Empty, new Dictionary<string, string?>
{
[AzureServiceBusHeaders.ScheduledEnqueueTimeUtc] = DateTimeOffset.UtcNow.AddSeconds(60).ToString(),
});
}
顺便说一下,有一些同学之前也提起了在 RabbitMQ 中对延迟消息的支持,我们一致没有对其进行支持,一是因为需要它配置插件才可以不是原生支持,二是还是希望大家能使用调度器(Quartz,Hangfire)等来做这件事情,专业的事情交给专业的组件做。我们新增了一个配置项 FailedMessageExpiredAfter 用于配置失败的消息过期时间,到达过期时间后,消息会被删除。之前这个是写死的值 15 天,现在你可以利用此配置项进行配置。
修复 Redis Streams 读取或创建流时幂等检查的问题